diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AddApiKeyResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AddApiKeyResponse.java new file mode 100644 index 00000000000..0d7222491fb --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AddApiKeyResponse.java @@ -0,0 +1,106 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** AddApiKeyResponse */ +public class AddApiKeyResponse { + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public AddApiKeyResponse key(String key) { + this.key = key; + return this; + } + + /** + * Key string. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key string.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AddApiKeyResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation (ISO-8601 format). + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of creation (ISO-8601 format)." + ) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime 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/ApiKey.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ApiKey.java new file mode 100644 index 00000000000..d6669327f12 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ApiKey.java @@ -0,0 +1,416 @@ +package com.algolia.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Api Key object. */ +@ApiModel(description = "Api Key object.") +public class ApiKey { + + /** Gets or Sets acl */ + @JsonAdapter(AclEnum.Adapter.class) + public enum AclEnum { + ADDOBJECT("addObject"), + + ANALYTICS("analytics"), + + BROWSE("browse"), + + DELETEOBJECT("deleteObject"), + + DELETEINDEX("deleteIndex"), + + EDITSETTINGS("editSettings"), + + LISTINDEXES("listIndexes"), + + LOGS("logs"), + + PERSONALIZATION("personalization"), + + RECOMMENDATION("recommendation"), + + SEARCH("search"), + + SEEUNRETRIEVABLEATTRIBUTES("seeUnretrievableAttributes"), + + SETTINGS("settings"), + + USAGE("usage"); + + private String value; + + AclEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AclEnum fromValue(String value) { + for (AclEnum b : AclEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + + @Override + public void write(final JsonWriter jsonWriter, final AclEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AclEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AclEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACL = "acl"; + + @SerializedName(SERIALIZED_NAME_ACL) + private List acl = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description = ""; + + public static final String SERIALIZED_NAME_INDEXES = "indexes"; + + @SerializedName(SERIALIZED_NAME_INDEXES) + private List indexes = null; + + public static final String SERIALIZED_NAME_MAX_HITS_PER_QUERY = + "maxHitsPerQuery"; + + @SerializedName(SERIALIZED_NAME_MAX_HITS_PER_QUERY) + private Integer maxHitsPerQuery = 0; + + public static final String SERIALIZED_NAME_MAX_QUERIES_PER_I_P_PER_HOUR = + "maxQueriesPerIPPerHour"; + + @SerializedName(SERIALIZED_NAME_MAX_QUERIES_PER_I_P_PER_HOUR) + private Integer maxQueriesPerIPPerHour = 0; + + public static final String SERIALIZED_NAME_QUERY_PARAMETERS = + "queryParameters"; + + @SerializedName(SERIALIZED_NAME_QUERY_PARAMETERS) + private String queryParameters = ""; + + public static final String SERIALIZED_NAME_REFERERS = "referers"; + + @SerializedName(SERIALIZED_NAME_REFERERS) + private List referers = null; + + public static final String SERIALIZED_NAME_VALIDITY = "validity"; + + @SerializedName(SERIALIZED_NAME_VALIDITY) + private Integer validity = 0; + + public ApiKey acl(List acl) { + this.acl = acl; + return this; + } + + public ApiKey addAclItem(AclEnum aclItem) { + this.acl.add(aclItem); + return this; + } + + /** + * Set of permissions associated with the key. + * + * @return acl + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Set of permissions associated with the key." + ) + 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 + @ApiModelProperty( + value = "A comment used to identify a key more easily in the dashboard. It is not interpreted by" + + " the API." + ) + 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 + @ApiModelProperty( + value = "Restrict this new API key to a list of indices or index patterns. If the list is empty," + + " all indices are allowed." + ) + 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 + @ApiModelProperty( + value = "Maximum number of hits this API key can retrieve in one query. If zero, no limit is" + + " enforced." + ) + 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 + @ApiModelProperty( + value = "Maximum number of API calls per hour allowed from a given IP address or a user token." + ) + 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 + @ApiModelProperty( + value = "URL-encoded query string. Force some query parameters to be applied for each query made" + + " with this API key." + ) + 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 + @ApiModelProperty( + value = "Restrict this new API key to specific referers. If empty or blank, defaults to all" + + " referers." + ) + 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 + @ApiModelProperty( + value = "Validity limit for this key in seconds. The key will automatically be removed after this" + + " period of time." + ) + 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/AssignUserIdObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AssignUserIdObject.java new file mode 100644 index 00000000000..3e0fdc73325 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AssignUserIdObject.java @@ -0,0 +1,76 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Assign userID object. */ +@ApiModel(description = "Assign userID object.") +public class AssignUserIdObject { + + public static final String SERIALIZED_NAME_CLUSTER = "cluster"; + + @SerializedName(SERIALIZED_NAME_CLUSTER) + private String cluster; + + public AssignUserIdObject cluster(String cluster) { + this.cluster = cluster; + return this; + } + + /** + * Name of the cluster. + * + * @return cluster + */ + @javax.annotation.Nonnull + @ApiModelProperty( + example = "c11-test", + required = true, + value = "Name of the cluster." + ) + 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; + } + AssignUserIdObject assignUserIdObject = (AssignUserIdObject) o; + return Objects.equals(this.cluster, assignUserIdObject.cluster); + } + + @Override + public int hashCode() { + return Objects.hash(cluster); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssignUserIdObject {\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/AssignUserIdResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AssignUserIdResponse.java new file mode 100644 index 00000000000..f18853c2eb4 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/AssignUserIdResponse.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** AssignUserIdResponse */ +public class AssignUserIdResponse { + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public AssignUserIdResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation (ISO-8601 format). + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of creation (ISO-8601 format)." + ) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssignUserIdResponse assignUserIdResponse = (AssignUserIdResponse) o; + return Objects.equals(this.createdAt, assignUserIdResponse.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssignUserIdResponse {\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/BaseSearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BaseSearchResponse.java index 8a7d905271d..65bd5dfd3f9 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BaseSearchResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BaseSearchResponse.java @@ -462,7 +462,7 @@ public BaseSearchResponse nbHits(Integer nbHits) { } /** - * Number of hits that the search query matched + * Number of hits that the search query matched. * * @return nbHits */ @@ -470,7 +470,7 @@ public BaseSearchResponse nbHits(Integer nbHits) { @ApiModelProperty( example = "20", required = true, - value = "Number of hits that the search query matched" + value = "Number of hits that the search query matched." ) public Integer getNbHits() { return nbHits; diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchAssignUserIdsObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchAssignUserIdsObject.java new file mode 100644 index 00000000000..867b2e25eb7 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchAssignUserIdsObject.java @@ -0,0 +1,115 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Assign userID object. */ +@ApiModel(description = "Assign userID object.") +public class BatchAssignUserIdsObject { + + public static final String SERIALIZED_NAME_CLUSTER = "cluster"; + + @SerializedName(SERIALIZED_NAME_CLUSTER) + private String cluster; + + public static final String SERIALIZED_NAME_USERS = "users"; + + @SerializedName(SERIALIZED_NAME_USERS) + private List users = new ArrayList<>(); + + public BatchAssignUserIdsObject cluster(String cluster) { + this.cluster = cluster; + return this; + } + + /** + * Name of the cluster. + * + * @return cluster + */ + @javax.annotation.Nonnull + @ApiModelProperty( + example = "c11-test", + required = true, + value = "Name of the cluster." + ) + public String getCluster() { + return cluster; + } + + public void setCluster(String cluster) { + this.cluster = cluster; + } + + public BatchAssignUserIdsObject users(List users) { + this.users = users; + return this; + } + + public BatchAssignUserIdsObject 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 + @ApiModelProperty( + required = true, + value = "userIDs to assign. Note you cannot move users with this method." + ) + 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; + } + BatchAssignUserIdsObject batchAssignUserIdsObject = (BatchAssignUserIdsObject) o; + return ( + Objects.equals(this.cluster, batchAssignUserIdsObject.cluster) && + Objects.equals(this.users, batchAssignUserIdsObject.users) + ); + } + + @Override + public int hashCode() { + return Objects.hash(cluster, users); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchAssignUserIdsObject {\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/BatchAssignUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchAssignUserIdsResponse.java new file mode 100644 index 00000000000..beff188d922 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchAssignUserIdsResponse.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** BatchAssignUserIdsResponse */ +public class BatchAssignUserIdsResponse { + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public BatchAssignUserIdsResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation (ISO-8601 format). + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of creation (ISO-8601 format)." + ) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchAssignUserIdsResponse batchAssignUserIdsResponse = (BatchAssignUserIdsResponse) o; + return Objects.equals(this.createdAt, batchAssignUserIdsResponse.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchAssignUserIdsResponse {\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/CreatedAtObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/CreatedAtObject.java new file mode 100644 index 00000000000..0953db21b16 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/CreatedAtObject.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** CreatedAtObject */ +public class CreatedAtObject { + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public CreatedAtObject createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation (ISO-8601 format). + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of creation (ISO-8601 format)." + ) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime 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/DeleteApiKeyResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DeleteApiKeyResponse.java new file mode 100644 index 00000000000..c17e344833d --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DeleteApiKeyResponse.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** DeleteApiKeyResponse */ +public class DeleteApiKeyResponse { + + public static final String SERIALIZED_NAME_DELETED_AT = "deletedAt"; + + @SerializedName(SERIALIZED_NAME_DELETED_AT) + private OffsetDateTime deletedAt; + + public DeleteApiKeyResponse deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Date of deletion (ISO-8601 format). + * + * @return deletedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of deletion (ISO-8601 format)." + ) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime 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/DeleteIndexResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DeleteIndexResponse.java index 28c6eba1257..3f8c11a7fbb 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DeleteIndexResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DeleteIndexResponse.java @@ -13,10 +13,10 @@ public class DeleteIndexResponse { @SerializedName(SERIALIZED_NAME_TASK_I_D) private Integer taskID; - public static final String SERIALIZED_NAME_DELETE_AT = "deleteAt"; + public static final String SERIALIZED_NAME_DELETED_AT = "deletedAt"; - @SerializedName(SERIALIZED_NAME_DELETE_AT) - private OffsetDateTime deleteAt; + @SerializedName(SERIALIZED_NAME_DELETED_AT) + private OffsetDateTime deletedAt; public DeleteIndexResponse taskID(Integer taskID) { this.taskID = taskID; @@ -38,24 +38,24 @@ public void setTaskID(Integer taskID) { this.taskID = taskID; } - public DeleteIndexResponse deleteAt(OffsetDateTime deleteAt) { - this.deleteAt = deleteAt; + public DeleteIndexResponse deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; return this; } /** * Date of deletion (ISO-8601 format). * - * @return deleteAt + * @return deletedAt */ @javax.annotation.Nullable @ApiModelProperty(value = "Date of deletion (ISO-8601 format).") - public OffsetDateTime getDeleteAt() { - return deleteAt; + public OffsetDateTime getDeletedAt() { + return deletedAt; } - public void setDeleteAt(OffsetDateTime deleteAt) { - this.deleteAt = deleteAt; + public void setDeletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; } @Override @@ -69,13 +69,13 @@ public boolean equals(Object o) { DeleteIndexResponse deleteIndexResponse = (DeleteIndexResponse) o; return ( Objects.equals(this.taskID, deleteIndexResponse.taskID) && - Objects.equals(this.deleteAt, deleteIndexResponse.deleteAt) + Objects.equals(this.deletedAt, deleteIndexResponse.deletedAt) ); } @Override public int hashCode() { - return Objects.hash(taskID, deleteAt); + return Objects.hash(taskID, deletedAt); } @Override @@ -83,7 +83,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DeleteIndexResponse {\n"); sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); - sb.append(" deleteAt: ").append(toIndentedString(deleteAt)).append("\n"); + sb + .append(" deletedAt: ") + .append(toIndentedString(deletedAt)) + .append("\n"); sb.append("}"); return sb.toString(); } diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/GetTopUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/GetTopUserIdsResponse.java new file mode 100644 index 00000000000..eb85a7a0f4f --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/GetTopUserIdsResponse.java @@ -0,0 +1,87 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Array of userIDs and clusters. */ +@ApiModel(description = "Array of userIDs and clusters.") +public class GetTopUserIdsResponse { + + public static final String SERIALIZED_NAME_TOP_USERS = "topUsers"; + + @SerializedName(SERIALIZED_NAME_TOP_USERS) + 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 + @ApiModelProperty( + required = true, + value = "Mapping of cluster names to top users." + ) + 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/HasPendingMappingsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/HasPendingMappingsResponse.java new file mode 100644 index 00000000000..fa849127169 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/HasPendingMappingsResponse.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** HasPendingMappingsResponse */ +public class HasPendingMappingsResponse { + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public HasPendingMappingsResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation (ISO-8601 format). + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of creation (ISO-8601 format)." + ) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasPendingMappingsResponse hasPendingMappingsResponse = (HasPendingMappingsResponse) o; + return Objects.equals(this.createdAt, hasPendingMappingsResponse.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasPendingMappingsResponse {\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/HighlightResult.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/HighlightResult.java index 7bb3d2dbbee..606dc0a201d 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/HighlightResult.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/HighlightResult.java @@ -5,13 +5,15 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Objects; -/** HighlightResult */ +/** Highlighted attributes. */ +@ApiModel(description = "Highlighted attributes.") public class HighlightResult { public static final String SERIALIZED_NAME_VALUE = "value"; diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/KeyObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/KeyObject.java new file mode 100644 index 00000000000..465c39dc574 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/KeyObject.java @@ -0,0 +1,449 @@ +package com.algolia.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** KeyObject */ +public class KeyObject { + + /** Gets or Sets acl */ + @JsonAdapter(AclEnum.Adapter.class) + public enum AclEnum { + ADDOBJECT("addObject"), + + ANALYTICS("analytics"), + + BROWSE("browse"), + + DELETEOBJECT("deleteObject"), + + DELETEINDEX("deleteIndex"), + + EDITSETTINGS("editSettings"), + + LISTINDEXES("listIndexes"), + + LOGS("logs"), + + PERSONALIZATION("personalization"), + + RECOMMENDATION("recommendation"), + + SEARCH("search"), + + SEEUNRETRIEVABLEATTRIBUTES("seeUnretrievableAttributes"), + + SETTINGS("settings"), + + USAGE("usage"); + + private String value; + + AclEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AclEnum fromValue(String value) { + for (AclEnum b : AclEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + + @Override + public void write(final JsonWriter jsonWriter, final AclEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AclEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AclEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACL = "acl"; + + @SerializedName(SERIALIZED_NAME_ACL) + private List acl = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description = ""; + + public static final String SERIALIZED_NAME_INDEXES = "indexes"; + + @SerializedName(SERIALIZED_NAME_INDEXES) + private List indexes = null; + + public static final String SERIALIZED_NAME_MAX_HITS_PER_QUERY = + "maxHitsPerQuery"; + + @SerializedName(SERIALIZED_NAME_MAX_HITS_PER_QUERY) + private Integer maxHitsPerQuery = 0; + + public static final String SERIALIZED_NAME_MAX_QUERIES_PER_I_P_PER_HOUR = + "maxQueriesPerIPPerHour"; + + @SerializedName(SERIALIZED_NAME_MAX_QUERIES_PER_I_P_PER_HOUR) + private Integer maxQueriesPerIPPerHour = 0; + + public static final String SERIALIZED_NAME_QUERY_PARAMETERS = + "queryParameters"; + + @SerializedName(SERIALIZED_NAME_QUERY_PARAMETERS) + private String queryParameters = ""; + + public static final String SERIALIZED_NAME_REFERERS = "referers"; + + @SerializedName(SERIALIZED_NAME_REFERERS) + private List referers = null; + + public static final String SERIALIZED_NAME_VALIDITY = "validity"; + + @SerializedName(SERIALIZED_NAME_VALIDITY) + private Integer validity = 0; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public KeyObject acl(List acl) { + this.acl = acl; + return this; + } + + public KeyObject addAclItem(AclEnum aclItem) { + this.acl.add(aclItem); + return this; + } + + /** + * Set of permissions associated with the key. + * + * @return acl + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Set of permissions associated with the key." + ) + public List getAcl() { + return acl; + } + + public void setAcl(List acl) { + this.acl = acl; + } + + public KeyObject 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 + @ApiModelProperty( + value = "A comment used to identify a key more easily in the dashboard. It is not interpreted by" + + " the API." + ) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public KeyObject indexes(List indexes) { + this.indexes = indexes; + return this; + } + + public KeyObject 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 + @ApiModelProperty( + value = "Restrict this new API key to a list of indices or index patterns. If the list is empty," + + " all indices are allowed." + ) + public List getIndexes() { + return indexes; + } + + public void setIndexes(List indexes) { + this.indexes = indexes; + } + + public KeyObject 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 + @ApiModelProperty( + value = "Maximum number of hits this API key can retrieve in one query. If zero, no limit is" + + " enforced." + ) + public Integer getMaxHitsPerQuery() { + return maxHitsPerQuery; + } + + public void setMaxHitsPerQuery(Integer maxHitsPerQuery) { + this.maxHitsPerQuery = maxHitsPerQuery; + } + + public KeyObject 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 + @ApiModelProperty( + value = "Maximum number of API calls per hour allowed from a given IP address or a user token." + ) + public Integer getMaxQueriesPerIPPerHour() { + return maxQueriesPerIPPerHour; + } + + public void setMaxQueriesPerIPPerHour(Integer maxQueriesPerIPPerHour) { + this.maxQueriesPerIPPerHour = maxQueriesPerIPPerHour; + } + + public KeyObject 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 + @ApiModelProperty( + value = "URL-encoded query string. Force some query parameters to be applied for each query made" + + " with this API key." + ) + public String getQueryParameters() { + return queryParameters; + } + + public void setQueryParameters(String queryParameters) { + this.queryParameters = queryParameters; + } + + public KeyObject referers(List referers) { + this.referers = referers; + return this; + } + + public KeyObject 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 + @ApiModelProperty( + value = "Restrict this new API key to specific referers. If empty or blank, defaults to all" + + " referers." + ) + public List getReferers() { + return referers; + } + + public void setReferers(List referers) { + this.referers = referers; + } + + public KeyObject 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 + @ApiModelProperty( + value = "Validity limit for this key in seconds. The key will automatically be removed after this" + + " period of time." + ) + public Integer getValidity() { + return validity; + } + + public void setValidity(Integer validity) { + this.validity = validity; + } + + public KeyObject createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation (ISO-8601 format). + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of creation (ISO-8601 format)." + ) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeyObject keyObject = (KeyObject) o; + return ( + Objects.equals(this.acl, keyObject.acl) && + Objects.equals(this.description, keyObject.description) && + Objects.equals(this.indexes, keyObject.indexes) && + Objects.equals(this.maxHitsPerQuery, keyObject.maxHitsPerQuery) && + Objects.equals( + this.maxQueriesPerIPPerHour, + keyObject.maxQueriesPerIPPerHour + ) && + Objects.equals(this.queryParameters, keyObject.queryParameters) && + Objects.equals(this.referers, keyObject.referers) && + Objects.equals(this.validity, keyObject.validity) && + Objects.equals(this.createdAt, keyObject.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 KeyObject {\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/ListApiKeysResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ListApiKeysResponse.java new file mode 100644 index 00000000000..c13fa9b9f20 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ListApiKeysResponse.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ListApiKeysResponse */ +public class ListApiKeysResponse { + + public static final String SERIALIZED_NAME_KEYS = "keys"; + + @SerializedName(SERIALIZED_NAME_KEYS) + private List keys = new ArrayList<>(); + + public ListApiKeysResponse keys(List keys) { + this.keys = keys; + return this; + } + + public ListApiKeysResponse addKeysItem(KeyObject keysItem) { + this.keys.add(keysItem); + return this; + } + + /** + * List of api keys. + * + * @return keys + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "List of api keys.") + 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/ListClustersResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ListClustersResponse.java new file mode 100644 index 00000000000..5794a2f7955 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ListClustersResponse.java @@ -0,0 +1,82 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Array of clusters. */ +@ApiModel(description = "Array of clusters.") +public class ListClustersResponse { + + public static final String SERIALIZED_NAME_TOP_USERS = "topUsers"; + + @SerializedName(SERIALIZED_NAME_TOP_USERS) + 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 + @ApiModelProperty( + required = true, + value = "Mapping of cluster names to top users." + ) + 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/ListUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ListUserIdsResponse.java new file mode 100644 index 00000000000..0ba70e52e29 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/ListUserIdsResponse.java @@ -0,0 +1,79 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** UserIDs data. */ +@ApiModel(description = "UserIDs data.") +public class ListUserIdsResponse { + + public static final String SERIALIZED_NAME_USER_I_DS = "userIDs"; + + @SerializedName(SERIALIZED_NAME_USER_I_DS) + 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 + @ApiModelProperty(required = true, value = "List of userIDs.") + 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/RemoveUserIdResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/RemoveUserIdResponse.java new file mode 100644 index 00000000000..ada941fafaa --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/RemoveUserIdResponse.java @@ -0,0 +1,77 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** RemoveUserIdResponse */ +public class RemoveUserIdResponse { + + public static final String SERIALIZED_NAME_DELETED_AT = "deletedAt"; + + @SerializedName(SERIALIZED_NAME_DELETED_AT) + private OffsetDateTime deletedAt; + + public RemoveUserIdResponse deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Date of deletion (ISO-8601 format). + * + * @return deletedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of deletion (ISO-8601 format)." + ) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime 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/SearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchResponse.java index 2bb7c74206c..a1437ac2707 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchResponse.java @@ -467,7 +467,7 @@ public SearchResponse nbHits(Integer nbHits) { } /** - * Number of hits that the search query matched + * Number of hits that the search query matched. * * @return nbHits */ @@ -475,7 +475,7 @@ public SearchResponse nbHits(Integer nbHits) { @ApiModelProperty( example = "20", required = true, - value = "Number of hits that the search query matched" + value = "Number of hits that the search query matched." ) public Integer getNbHits() { return nbHits; diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java index c4153d718d1..ea57089c759 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchSynonymsResponse.java @@ -51,7 +51,7 @@ public SearchSynonymsResponse nbHits(Integer nbHits) { } /** - * Number of hits that the search query matched + * Number of hits that the search query matched. * * @return nbHits */ @@ -59,7 +59,7 @@ public SearchSynonymsResponse nbHits(Integer nbHits) { @ApiModelProperty( example = "20", required = true, - value = "Number of hits that the search query matched" + value = "Number of hits that the search query matched." ) public Integer getNbHits() { return nbHits; diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsObject.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsObject.java new file mode 100644 index 00000000000..d093d293312 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsObject.java @@ -0,0 +1,166 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** OK */ +@ApiModel(description = "OK") +public class SearchUserIdsObject { + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; + + @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) + private String clusterName; + + public static final String SERIALIZED_NAME_PAGE = "page"; + + @SerializedName(SERIALIZED_NAME_PAGE) + private Integer page = 0; + + public static final String SERIALIZED_NAME_HITS_PER_PAGE = "hitsPerPage"; + + @SerializedName(SERIALIZED_NAME_HITS_PER_PAGE) + private Integer hitsPerPage = 20; + + public SearchUserIdsObject 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 + @ApiModelProperty( + required = true, + value = "Query to search. The search is a prefix search with typoTolerance. Use empty query to" + + " retrieve all users." + ) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public SearchUserIdsObject clusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Name of the cluster. + * + * @return clusterName + */ + @javax.annotation.Nullable + @ApiModelProperty(example = "c11-test", value = "Name of the cluster.") + public String getClusterName() { + return clusterName; + } + + public void setClusterName(String clusterName) { + this.clusterName = clusterName; + } + + public SearchUserIdsObject page(Integer page) { + this.page = page; + return this; + } + + /** + * Specify the page to retrieve. + * + * @return page + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify the page to retrieve.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public SearchUserIdsObject hitsPerPage(Integer hitsPerPage) { + this.hitsPerPage = hitsPerPage; + return this; + } + + /** + * Set the number of hits per page. + * + * @return hitsPerPage + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Set the number of hits per page.") + 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; + } + SearchUserIdsObject searchUserIdsObject = (SearchUserIdsObject) o; + return ( + Objects.equals(this.query, searchUserIdsObject.query) && + Objects.equals(this.clusterName, searchUserIdsObject.clusterName) && + Objects.equals(this.page, searchUserIdsObject.page) && + Objects.equals(this.hitsPerPage, searchUserIdsObject.hitsPerPage) + ); + } + + @Override + public int hashCode() { + return Objects.hash(query, clusterName, page, hitsPerPage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchUserIdsObject {\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/SearchUserIdsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsResponse.java new file mode 100644 index 00000000000..2d4535802b3 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsResponse.java @@ -0,0 +1,202 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** userIDs data. */ +@ApiModel(description = "userIDs data.") +public class SearchUserIdsResponse { + + public static final String SERIALIZED_NAME_HITS = "hits"; + + @SerializedName(SERIALIZED_NAME_HITS) + private List hits = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NB_HITS = "nbHits"; + + @SerializedName(SERIALIZED_NAME_NB_HITS) + private Object nbHits = null; + + public static final String SERIALIZED_NAME_PAGE = "page"; + + @SerializedName(SERIALIZED_NAME_PAGE) + private Integer page = 0; + + public static final String SERIALIZED_NAME_HITS_PER_PAGE = "hitsPerPage"; + + @SerializedName(SERIALIZED_NAME_HITS_PER_PAGE) + private Integer hitsPerPage = 20; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime 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 + @ApiModelProperty( + required = true, + value = "List of user object matching the query." + ) + public List getHits() { + return hits; + } + + public void setHits(List hits) { + this.hits = hits; + } + + public SearchUserIdsResponse nbHits(Object nbHits) { + this.nbHits = nbHits; + return this; + } + + /** + * Get nbHits + * + * @return nbHits + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Object getNbHits() { + return nbHits; + } + + public void setNbHits(Object nbHits) { + this.nbHits = nbHits; + } + + public SearchUserIdsResponse page(Integer page) { + this.page = page; + return this; + } + + /** + * Specify the page to retrieve. + * + * @return page + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Specify the page to retrieve.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public SearchUserIdsResponse hitsPerPage(Integer hitsPerPage) { + this.hitsPerPage = hitsPerPage; + return this; + } + + /** + * Set the number of hits per page. + * + * @return hitsPerPage + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Set the number of hits per page.") + public Integer getHitsPerPage() { + return hitsPerPage; + } + + public void setHitsPerPage(Integer hitsPerPage) { + this.hitsPerPage = hitsPerPage; + } + + public SearchUserIdsResponse updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update (ISO-8601 format). + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of last update (ISO-8601 format)." + ) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime 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/SearchUserIdsResponseHighlightResult.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHighlightResult.java new file mode 100644 index 00000000000..09651a2ea8f --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHighlightResult.java @@ -0,0 +1,110 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** SearchUserIdsResponseHighlightResult */ +public class SearchUserIdsResponseHighlightResult { + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + + @SerializedName(SERIALIZED_NAME_USER_I_D) + private HighlightResult userID; + + public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; + + @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) + private HighlightResult clusterName; + + public SearchUserIdsResponseHighlightResult userID(HighlightResult userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * + * @return userID + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + 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 + @ApiModelProperty(required = true, value = "") + 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/SearchUserIdsResponseHits.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHits.java new file mode 100644 index 00000000000..36d76eac7c7 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/SearchUserIdsResponseHits.java @@ -0,0 +1,246 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** SearchUserIdsResponseHits */ +public class SearchUserIdsResponseHits { + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + + @SerializedName(SERIALIZED_NAME_USER_I_D) + private UserId userID; + + public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; + + @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) + private String clusterName; + + public static final String SERIALIZED_NAME_NB_RECORDS = "nbRecords"; + + @SerializedName(SERIALIZED_NAME_NB_RECORDS) + private Integer nbRecords; + + public static final String SERIALIZED_NAME_DATA_SIZE = "dataSize"; + + @SerializedName(SERIALIZED_NAME_DATA_SIZE) + private Integer dataSize; + + public static final String SERIALIZED_NAME_OBJECT_I_D = "objectID"; + + @SerializedName(SERIALIZED_NAME_OBJECT_I_D) + private String objectID; + + public static final String SERIALIZED_NAME_HIGHLIGHT_RESULT = + "_highlightResult"; + + @SerializedName(SERIALIZED_NAME_HIGHLIGHT_RESULT) + private SearchUserIdsResponseHighlightResult highlightResult; + + public SearchUserIdsResponseHits userID(UserId userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * + * @return userID + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public UserId getUserID() { + return userID; + } + + public void setUserID(UserId userID) { + this.userID = userID; + } + + public SearchUserIdsResponseHits clusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Name of the cluster. + * + * @return clusterName + */ + @javax.annotation.Nonnull + @ApiModelProperty( + example = "c11-test", + required = true, + value = "Name of the cluster." + ) + 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 + @ApiModelProperty( + example = "3", + required = true, + value = "Number of records in the cluster." + ) + 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 + @ApiModelProperty( + example = "481", + required = true, + value = "Data size taken by all the users assigned to the cluster." + ) + 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 + @ApiModelProperty( + required = true, + value = "userID of the requested user. Same as userID." + ) + 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 + @ApiModelProperty(required = true, value = "") + 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/UpdateApiKeyResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/UpdateApiKeyResponse.java new file mode 100644 index 00000000000..2328d98f9a9 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/UpdateApiKeyResponse.java @@ -0,0 +1,106 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** UpdateApiKeyResponse */ +public class UpdateApiKeyResponse { + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public UpdateApiKeyResponse key(String key) { + this.key = key; + return this; + } + + /** + * Key string. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key string.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public UpdateApiKeyResponse updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update (ISO-8601 format). + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Date of last update (ISO-8601 format)." + ) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime 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/UserId.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/UserId.java new file mode 100644 index 00000000000..03a68bf6c30 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/UserId.java @@ -0,0 +1,177 @@ +package com.algolia.model; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** A userID. */ +@ApiModel(description = "A userID.") +public class UserId { + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; + + @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) + private String clusterName; + + public static final String SERIALIZED_NAME_NB_RECORDS = "nbRecords"; + + @SerializedName(SERIALIZED_NAME_NB_RECORDS) + private Integer nbRecords; + + public static final String SERIALIZED_NAME_DATA_SIZE = "dataSize"; + + @SerializedName(SERIALIZED_NAME_DATA_SIZE) + private Integer dataSize; + + public UserId userID(String userID) { + this.userID = userID; + return this; + } + + /** + * userID of the user. + * + * @return userID + */ + @javax.annotation.Nonnull + @ApiModelProperty( + example = "user1", + required = true, + value = "userID of the user." + ) + 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 + @ApiModelProperty( + example = "c1-test", + required = true, + value = "Cluster on which the user is assigned." + ) + 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 + @ApiModelProperty( + example = "42", + required = true, + value = "Number of records belonging to the user." + ) + 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 + @ApiModelProperty( + example = "0", + required = true, + value = "Data size used by the user." + ) + 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 index 25ba9dc07b9..1e797f5f822 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java @@ -5,27 +5,45 @@ import com.algolia.ApiException; import com.algolia.ApiResponse; import com.algolia.Pair; +import com.algolia.model.AddApiKeyResponse; +import com.algolia.model.ApiKey; +import com.algolia.model.AssignUserIdObject; +import com.algolia.model.AssignUserIdResponse; +import com.algolia.model.BatchAssignUserIdsObject; +import com.algolia.model.BatchAssignUserIdsResponse; import com.algolia.model.BatchObject; import com.algolia.model.BatchResponse; import com.algolia.model.ClearAllSynonymsResponse; +import com.algolia.model.DeleteApiKeyResponse; import com.algolia.model.DeleteIndexResponse; import com.algolia.model.DeleteSynonymResponse; import com.algolia.model.GetLogsResponse; import com.algolia.model.GetTaskResponse; +import com.algolia.model.GetTopUserIdsResponse; +import com.algolia.model.HasPendingMappingsResponse; import com.algolia.model.IndexSettings; +import com.algolia.model.KeyObject; +import com.algolia.model.ListApiKeysResponse; +import com.algolia.model.ListClustersResponse; import com.algolia.model.ListIndicesResponse; +import com.algolia.model.ListUserIdsResponse; import com.algolia.model.MultipleQueriesObject; import com.algolia.model.MultipleQueriesResponse; import com.algolia.model.OperationIndexObject; import com.algolia.model.OperationIndexResponse; +import com.algolia.model.RemoveUserIdResponse; import com.algolia.model.SaveObjectResponse; import com.algolia.model.SaveSynonymResponse; import com.algolia.model.SaveSynonymsResponse; import com.algolia.model.SearchParams; import com.algolia.model.SearchResponse; import com.algolia.model.SearchSynonymsResponse; +import com.algolia.model.SearchUserIdsObject; +import com.algolia.model.SearchUserIdsResponse; import com.algolia.model.SetSettingsResponse; import com.algolia.model.SynonymHit; +import com.algolia.model.UpdateApiKeyResponse; +import com.algolia.model.UserId; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; @@ -40,10 +58,9 @@ public SearchApi(String appId, String apiKey) { } /** - * Build call for batch + * Build call for addApiKey * - * @param indexName The index in which to perform the request. (required) - * @param batchObject (required) + * @param apiKey (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -57,19 +74,12 @@ public SearchApi(String appId, String apiKey) { * 404 Index not found. - * */ - public okhttp3.Call batchCall( - String indexName, - BatchObject batchObject, - final ApiCallback _callback - ) throws ApiException { - Object localVarPostBody = batchObject; + public okhttp3.Call addApiKeyCall(ApiKey apiKey, final ApiCallback _callback) + throws ApiException { + Object localVarPostBody = apiKey; // create path and map variables - String localVarPath = - "/1/indexes/{indexName}/batch".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); + String localVarPath = "/1/keys"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -104,35 +114,26 @@ public okhttp3.Call batchCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call batchValidateBeforeCall( - String indexName, - BatchObject batchObject, + private okhttp3.Call addApiKeyValidateBeforeCall( + ApiKey apiKey, final ApiCallback _callback ) throws ApiException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new ApiException( - "Missing the required parameter 'indexName' when calling batch(Async)" - ); - } - - // verify the required parameter 'batchObject' is set - if (batchObject == null) { + // verify the required parameter 'apiKey' is set + if (apiKey == null) { throw new ApiException( - "Missing the required parameter 'batchObject' when calling batch(Async)" + "Missing the required parameter 'apiKey' when calling addApiKey(Async)" ); } - okhttp3.Call localVarCall = batchCall(indexName, batchObject, _callback); + okhttp3.Call localVarCall = addApiKeyCall(apiKey, _callback); return localVarCall; } /** - * Performs multiple write operations in a single API call. + * Create a new API key. Add a new API Key with specific permissions/restrictions. * - * @param indexName The index in which to perform the request. (required) - * @param batchObject (required) - * @return BatchResponse + * @param apiKey (required) + * @return AddApiKeyResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -145,21 +146,16 @@ private okhttp3.Call batchValidateBeforeCall( * 404 Index not found. - * */ - public BatchResponse batch(String indexName, BatchObject batchObject) - throws ApiException { - ApiResponse localVarResp = batchWithHttpInfo( - indexName, - batchObject - ); + public AddApiKeyResponse addApiKey(ApiKey apiKey) throws ApiException { + ApiResponse localVarResp = addApiKeyWithHttpInfo(apiKey); return localVarResp.getData(); } /** - * Performs multiple write operations in a single API call. + * Create a new API key. Add a new API Key with specific permissions/restrictions. * - * @param indexName The index in which to perform the request. (required) - * @param batchObject (required) - * @return ApiResponse<BatchResponse> + * @param apiKey (required) + * @return ApiResponse<AddApiKeyResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -172,24 +168,18 @@ public BatchResponse batch(String indexName, BatchObject batchObject) * 404 Index not found. - * */ - public ApiResponse batchWithHttpInfo( - String indexName, - BatchObject batchObject - ) throws ApiException { - okhttp3.Call localVarCall = batchValidateBeforeCall( - indexName, - batchObject, - null - ); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse addApiKeyWithHttpInfo(ApiKey apiKey) + throws ApiException { + okhttp3.Call localVarCall = addApiKeyValidateBeforeCall(apiKey, null); + Type localVarReturnType = new TypeToken() {}.getType(); return this.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) Performs multiple write operations in a single API call. + * Create a new API key. (asynchronously) Add a new API Key with specific + * permissions/restrictions. * - * @param indexName The index in which to perform the request. (required) - * @param batchObject (required) + * @param apiKey (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -203,27 +193,21 @@ public ApiResponse batchWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call batchAsync( - String indexName, - BatchObject batchObject, - final ApiCallback _callback + public okhttp3.Call addApiKeyAsync( + ApiKey apiKey, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = batchValidateBeforeCall( - indexName, - batchObject, - _callback - ); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = addApiKeyValidateBeforeCall(apiKey, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for clearAllSynonyms + * Build call for assignUserId * - * @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 xAlgoliaUserID userID to assign. (required) + * @param assignUserIdObject (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -237,19 +221,15 @@ public okhttp3.Call batchAsync( * 404 Index not found. - * */ - public okhttp3.Call clearAllSynonymsCall( - String indexName, - Boolean forwardToReplicas, + public okhttp3.Call assignUserIdCall( + Object xAlgoliaUserID, + AssignUserIdObject assignUserIdObject, final ApiCallback _callback ) throws ApiException { - Object localVarPostBody = null; + Object localVarPostBody = assignUserIdObject; // create path and map variables - String localVarPath = - "/1/indexes/{indexName}/synonyms/clear".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); + String localVarPath = "/1/clusters/mapping"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -257,9 +237,9 @@ public okhttp3.Call clearAllSynonymsCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (forwardToReplicas != null) { + if (xAlgoliaUserID != null) { localVarQueryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) + this.parameterToPair("X-Algolia-User-ID", xAlgoliaUserID) ); } @@ -269,8 +249,7 @@ public okhttp3.Call clearAllSynonymsCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; - + final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = this.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -291,33 +270,42 @@ public okhttp3.Call clearAllSynonymsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call clearAllSynonymsValidateBeforeCall( - String indexName, - Boolean forwardToReplicas, + private okhttp3.Call assignUserIdValidateBeforeCall( + Object xAlgoliaUserID, + AssignUserIdObject assignUserIdObject, final ApiCallback _callback ) throws ApiException { - // verify the required parameter 'indexName' is set - if (indexName == null) { + // verify the required parameter 'xAlgoliaUserID' is set + if (xAlgoliaUserID == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling clearAllSynonyms(Async)" + "Missing the required parameter 'xAlgoliaUserID' when calling assignUserId(Async)" ); } - okhttp3.Call localVarCall = clearAllSynonymsCall( - indexName, - forwardToReplicas, + // verify the required parameter 'assignUserIdObject' is set + if (assignUserIdObject == null) { + throw new ApiException( + "Missing the required parameter 'assignUserIdObject' when calling assignUserId(Async)" + ); + } + + okhttp3.Call localVarCall = assignUserIdCall( + xAlgoliaUserID, + assignUserIdObject, _callback ); return localVarCall; } /** - * Clear all synonyms. Remove all synonyms from an index. + * Assign or Move userID 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 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 ClearAllSynonymsResponse + * @param xAlgoliaUserID userID to assign. (required) + * @param assignUserIdObject (required) + * @return AssignUserIdResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -330,24 +318,26 @@ private okhttp3.Call clearAllSynonymsValidateBeforeCall( * 404 Index not found. - * */ - public ClearAllSynonymsResponse clearAllSynonyms( - String indexName, - Boolean forwardToReplicas + public AssignUserIdResponse assignUserId( + Object xAlgoliaUserID, + AssignUserIdObject assignUserIdObject ) throws ApiException { - ApiResponse localVarResp = clearAllSynonymsWithHttpInfo( - indexName, - forwardToReplicas + ApiResponse localVarResp = assignUserIdWithHttpInfo( + xAlgoliaUserID, + assignUserIdObject ); return localVarResp.getData(); } /** - * Clear all synonyms. Remove all synonyms from an index. + * Assign or Move userID 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 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 ApiResponse<ClearAllSynonymsResponse> + * @param xAlgoliaUserID userID to assign. (required) + * @param assignUserIdObject (required) + * @return ApiResponse<AssignUserIdResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -360,26 +350,28 @@ public ClearAllSynonymsResponse clearAllSynonyms( * 404 Index not found. - * */ - public ApiResponse clearAllSynonymsWithHttpInfo( - String indexName, - Boolean forwardToReplicas + public ApiResponse assignUserIdWithHttpInfo( + Object xAlgoliaUserID, + AssignUserIdObject assignUserIdObject ) throws ApiException { - okhttp3.Call localVarCall = clearAllSynonymsValidateBeforeCall( - indexName, - forwardToReplicas, + okhttp3.Call localVarCall = assignUserIdValidateBeforeCall( + xAlgoliaUserID, + assignUserIdObject, null ); - Type localVarReturnType = new TypeToken() {} + Type localVarReturnType = new TypeToken() {} .getType(); return this.execute(localVarCall, localVarReturnType); } /** - * Clear all synonyms. (asynchronously) Remove all synonyms from an index. + * Assign or Move userID (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 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 xAlgoliaUserID userID to assign. (required) + * @param assignUserIdObject (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -393,26 +385,27 @@ public ApiResponse clearAllSynonymsWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call clearAllSynonymsAsync( - String indexName, - Boolean forwardToReplicas, - final ApiCallback _callback + public okhttp3.Call assignUserIdAsync( + Object xAlgoliaUserID, + AssignUserIdObject assignUserIdObject, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = clearAllSynonymsValidateBeforeCall( - indexName, - forwardToReplicas, + okhttp3.Call localVarCall = assignUserIdValidateBeforeCall( + xAlgoliaUserID, + assignUserIdObject, _callback ); - Type localVarReturnType = new TypeToken() {} + Type localVarReturnType = new TypeToken() {} .getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteIndex + * Build call for batch * * @param indexName The index in which to perform the request. (required) + * @param batchObject (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -426,15 +419,16 @@ public okhttp3.Call clearAllSynonymsAsync( * 404 Index not found. - * */ - public okhttp3.Call deleteIndexCall( + public okhttp3.Call batchCall( String indexName, + BatchObject batchObject, final ApiCallback _callback ) throws ApiException { - Object localVarPostBody = null; + Object localVarPostBody = batchObject; // create path and map variables String localVarPath = - "/1/indexes/{indexName}".replaceAll( + "/1/indexes/{indexName}/batch".replaceAll( "\\{" + "indexName" + "\\}", this.escapeString(indexName.toString()) ); @@ -451,8 +445,7 @@ public okhttp3.Call deleteIndexCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; - + final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = this.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -460,7 +453,7 @@ public okhttp3.Call deleteIndexCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "DELETE", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -473,26 +466,35 @@ public okhttp3.Call deleteIndexCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteIndexValidateBeforeCall( + private okhttp3.Call batchValidateBeforeCall( String indexName, + BatchObject batchObject, final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling deleteIndex(Async)" + "Missing the required parameter 'indexName' when calling batch(Async)" ); } - okhttp3.Call localVarCall = deleteIndexCall(indexName, _callback); + // verify the required parameter 'batchObject' is set + if (batchObject == null) { + throw new ApiException( + "Missing the required parameter 'batchObject' when calling batch(Async)" + ); + } + + okhttp3.Call localVarCall = batchCall(indexName, batchObject, _callback); return localVarCall; } /** - * Delete index. Delete an existing index. + * Performs multiple write operations in a single API call. * * @param indexName The index in which to perform the request. (required) - * @return DeleteIndexResponse + * @param batchObject (required) + * @return BatchResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -505,18 +507,21 @@ private okhttp3.Call deleteIndexValidateBeforeCall( * 404 Index not found. - * */ - public DeleteIndexResponse deleteIndex(String indexName) throws ApiException { - ApiResponse localVarResp = deleteIndexWithHttpInfo( - indexName + public BatchResponse batch(String indexName, BatchObject batchObject) + throws ApiException { + ApiResponse localVarResp = batchWithHttpInfo( + indexName, + batchObject ); return localVarResp.getData(); } /** - * Delete index. Delete an existing index. + * Performs multiple write operations in a single API call. * * @param indexName The index in which to perform the request. (required) - * @return ApiResponse<DeleteIndexResponse> + * @param batchObject (required) + * @return ApiResponse<BatchResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -529,18 +534,24 @@ public DeleteIndexResponse deleteIndex(String indexName) throws ApiException { * 404 Index not found. - * */ - public ApiResponse deleteIndexWithHttpInfo( - String indexName + public ApiResponse batchWithHttpInfo( + String indexName, + BatchObject batchObject ) throws ApiException { - okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = batchValidateBeforeCall( + indexName, + batchObject, + null + ); + Type localVarReturnType = new TypeToken() {}.getType(); return this.execute(localVarCall, localVarReturnType); } /** - * Delete index. (asynchronously) Delete an existing index. + * (asynchronously) Performs multiple write operations in a single API call. * * @param indexName The index in which to perform the request. (required) + * @param batchObject (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -554,26 +565,26 @@ public ApiResponse deleteIndexWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call deleteIndexAsync( + public okhttp3.Call batchAsync( String indexName, - final ApiCallback _callback + BatchObject batchObject, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = deleteIndexValidateBeforeCall( + okhttp3.Call localVarCall = batchValidateBeforeCall( indexName, + batchObject, _callback ); - Type localVarReturnType = new TypeToken() {}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteSynonym + * Build call for batchAssignUserIds * - * @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 xAlgoliaUserID userID to assign. (required) + * @param batchAssignUserIdsObject (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -587,24 +598,15 @@ public okhttp3.Call deleteIndexAsync( * 404 Index not found. - * */ - public okhttp3.Call deleteSynonymCall( - String indexName, - String objectID, - Boolean forwardToReplicas, + public okhttp3.Call batchAssignUserIdsCall( + Object xAlgoliaUserID, + BatchAssignUserIdsObject batchAssignUserIdsObject, final ApiCallback _callback ) throws ApiException { - Object localVarPostBody = null; + Object localVarPostBody = batchAssignUserIdsObject; // create path and map variables - String localVarPath = - "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + String localVarPath = "/1/clusters/mapping/batch"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -612,9 +614,9 @@ public okhttp3.Call deleteSynonymCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (forwardToReplicas != null) { + if (xAlgoliaUserID != null) { localVarQueryParams.addAll( - this.parameterToPair("forwardToReplicas", forwardToReplicas) + this.parameterToPair("X-Algolia-User-ID", xAlgoliaUserID) ); } @@ -624,8 +626,7 @@ public okhttp3.Call deleteSynonymCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; - + final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = this.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -633,7 +634,7 @@ public okhttp3.Call deleteSynonymCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "DELETE", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -646,43 +647,42 @@ public okhttp3.Call deleteSynonymCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSynonymValidateBeforeCall( - String indexName, - String objectID, - Boolean forwardToReplicas, + private okhttp3.Call batchAssignUserIdsValidateBeforeCall( + Object xAlgoliaUserID, + BatchAssignUserIdsObject batchAssignUserIdsObject, final ApiCallback _callback ) throws ApiException { - // verify the required parameter 'indexName' is set - if (indexName == null) { + // verify the required parameter 'xAlgoliaUserID' is set + if (xAlgoliaUserID == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling deleteSynonym(Async)" + "Missing the required parameter 'xAlgoliaUserID' when calling batchAssignUserIds(Async)" ); } - // verify the required parameter 'objectID' is set - if (objectID == null) { + // verify the required parameter 'batchAssignUserIdsObject' is set + if (batchAssignUserIdsObject == null) { throw new ApiException( - "Missing the required parameter 'objectID' when calling deleteSynonym(Async)" + "Missing the required parameter 'batchAssignUserIdsObject' when calling" + + " batchAssignUserIds(Async)" ); } - okhttp3.Call localVarCall = deleteSynonymCall( - indexName, - objectID, - forwardToReplicas, + okhttp3.Call localVarCall = batchAssignUserIdsCall( + xAlgoliaUserID, + batchAssignUserIdsObject, _callback ); return localVarCall; } /** - * Delete synonym. Delete a single synonyms set, identified by the given objectID. + * Batch assign userIDs 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 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 DeleteSynonymResponse + * @param xAlgoliaUserID userID to assign. (required) + * @param batchAssignUserIdsObject (required) + * @return BatchAssignUserIdsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -695,27 +695,25 @@ private okhttp3.Call deleteSynonymValidateBeforeCall( * 404 Index not found. - * */ - public DeleteSynonymResponse deleteSynonym( - String indexName, - String objectID, - Boolean forwardToReplicas + public BatchAssignUserIdsResponse batchAssignUserIds( + Object xAlgoliaUserID, + BatchAssignUserIdsObject batchAssignUserIdsObject ) throws ApiException { - ApiResponse localVarResp = deleteSynonymWithHttpInfo( - indexName, - objectID, - forwardToReplicas + ApiResponse localVarResp = batchAssignUserIdsWithHttpInfo( + xAlgoliaUserID, + batchAssignUserIdsObject ); return localVarResp.getData(); } /** - * Delete synonym. Delete a single synonyms set, identified by the given objectID. + * Batch assign userIDs 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 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 ApiResponse<DeleteSynonymResponse> + * @param xAlgoliaUserID userID to assign. (required) + * @param batchAssignUserIdsObject (required) + * @return ApiResponse<BatchAssignUserIdsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -728,30 +726,27 @@ public DeleteSynonymResponse deleteSynonym( * 404 Index not found. - * */ - public ApiResponse deleteSynonymWithHttpInfo( - String indexName, - String objectID, - Boolean forwardToReplicas + public ApiResponse batchAssignUserIdsWithHttpInfo( + Object xAlgoliaUserID, + BatchAssignUserIdsObject batchAssignUserIdsObject ) throws ApiException { - okhttp3.Call localVarCall = deleteSynonymValidateBeforeCall( - indexName, - objectID, - forwardToReplicas, + okhttp3.Call localVarCall = batchAssignUserIdsValidateBeforeCall( + xAlgoliaUserID, + batchAssignUserIdsObject, null ); - Type localVarReturnType = new TypeToken() {} + Type localVarReturnType = new TypeToken() {} .getType(); return this.execute(localVarCall, localVarReturnType); } /** - * Delete synonym. (asynchronously) Delete a single synonyms set, identified by the given - * objectID. + * Batch assign userIDs (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 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 xAlgoliaUserID userID to assign. (required) + * @param batchAssignUserIdsObject (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -765,35 +760,28 @@ public ApiResponse deleteSynonymWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call deleteSynonymAsync( - String indexName, - String objectID, - Boolean forwardToReplicas, - final ApiCallback _callback + public okhttp3.Call batchAssignUserIdsAsync( + Object xAlgoliaUserID, + BatchAssignUserIdsObject batchAssignUserIdsObject, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = deleteSynonymValidateBeforeCall( - indexName, - objectID, - forwardToReplicas, + okhttp3.Call localVarCall = batchAssignUserIdsValidateBeforeCall( + xAlgoliaUserID, + batchAssignUserIdsObject, _callback ); - Type localVarReturnType = new TypeToken() {} + Type localVarReturnType = new TypeToken() {} .getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getLogs + * Build call for clearAllSynonyms * - * @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 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 Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -807,17 +795,19 @@ public okhttp3.Call deleteSynonymAsync( * 404 Index not found. - * */ - public okhttp3.Call getLogsCall( - Integer offset, - Integer length, + public okhttp3.Call clearAllSynonymsCall( String indexName, - String type, + Boolean forwardToReplicas, final ApiCallback _callback ) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/1/logs"; + String localVarPath = + "/1/indexes/{indexName}/synonyms/clear".replaceAll( + "\\{" + "indexName" + "\\}", + this.escapeString(indexName.toString()) + ); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -825,20 +815,10 @@ public okhttp3.Call getLogsCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (offset != null) { - localVarQueryParams.addAll(this.parameterToPair("offset", offset)); - } - - if (length != null) { - localVarQueryParams.addAll(this.parameterToPair("length", length)); - } - - if (indexName != null) { - localVarQueryParams.addAll(this.parameterToPair("indexName", indexName)); - } - - if (type != null) { - localVarQueryParams.addAll(this.parameterToPair("type", type)); + if (forwardToReplicas != null) { + localVarQueryParams.addAll( + this.parameterToPair("forwardToReplicas", forwardToReplicas) + ); } final String[] localVarAccepts = { "application/json" }; @@ -856,7 +836,7 @@ public okhttp3.Call getLogsCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "GET", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -869,35 +849,33 @@ public okhttp3.Call getLogsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getLogsValidateBeforeCall( - Integer offset, - Integer length, + private okhttp3.Call clearAllSynonymsValidateBeforeCall( String indexName, - String type, + Boolean forwardToReplicas, final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = getLogsCall( - offset, - length, + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + "Missing the required parameter 'indexName' when calling clearAllSynonyms(Async)" + ); + } + + okhttp3.Call localVarCall = clearAllSynonymsCall( indexName, - type, + forwardToReplicas, _callback ); return localVarCall; } /** - * Return the lastest log entries. + * Clear all synonyms. Remove all synonyms from an index. * - * @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 + * @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 ClearAllSynonymsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -910,33 +888,24 @@ private okhttp3.Call getLogsValidateBeforeCall( * 404 Index not found. - * */ - public GetLogsResponse getLogs( - Integer offset, - Integer length, + public ClearAllSynonymsResponse clearAllSynonyms( String indexName, - String type + Boolean forwardToReplicas ) throws ApiException { - ApiResponse localVarResp = getLogsWithHttpInfo( - offset, - length, + ApiResponse localVarResp = clearAllSynonymsWithHttpInfo( indexName, - type + forwardToReplicas ); return localVarResp.getData(); } /** - * Return the lastest log entries. + * Clear all synonyms. Remove all synonyms from an index. * - * @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 ApiResponse<GetLogsResponse> + * @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 ApiResponse<ClearAllSynonymsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -949,34 +918,26 @@ public GetLogsResponse getLogs( * 404 Index not found. - * */ - public ApiResponse getLogsWithHttpInfo( - Integer offset, - Integer length, + public ApiResponse clearAllSynonymsWithHttpInfo( String indexName, - String type + Boolean forwardToReplicas ) throws ApiException { - okhttp3.Call localVarCall = getLogsValidateBeforeCall( - offset, - length, + okhttp3.Call localVarCall = clearAllSynonymsValidateBeforeCall( indexName, - type, + forwardToReplicas, null ); - Type localVarReturnType = new TypeToken() {}.getType(); + Type localVarReturnType = new TypeToken() {} + .getType(); return this.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) Return the lastest log entries. + * Clear all synonyms. (asynchronously) Remove all synonyms from an index. * - * @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 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 ApiException If fail to process the API call, e.g. serializing the request body object @@ -990,29 +951,26 @@ public ApiResponse getLogsWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call getLogsAsync( - Integer offset, - Integer length, + public okhttp3.Call clearAllSynonymsAsync( String indexName, - String type, - final ApiCallback _callback + Boolean forwardToReplicas, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = getLogsValidateBeforeCall( - offset, - length, + okhttp3.Call localVarCall = clearAllSynonymsValidateBeforeCall( indexName, - type, + forwardToReplicas, _callback ); - Type localVarReturnType = new TypeToken() {}.getType(); + Type localVarReturnType = new TypeToken() {} + .getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getSettings + * Build call for deleteApiKey * - * @param indexName The index in which to perform the request. (required) + * @param key API Key string. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1026,17 +984,15 @@ public okhttp3.Call getLogsAsync( * 404 Index not found. - * */ - public okhttp3.Call getSettingsCall( - String indexName, - final ApiCallback _callback - ) throws ApiException { + public okhttp3.Call deleteApiKeyCall(String key, final ApiCallback _callback) + throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = - "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) + "/1/keys/{key}".replaceAll( + "\\{" + "key" + "\\}", + this.escapeString(key.toString()) ); List localVarQueryParams = new ArrayList(); @@ -1060,7 +1016,7 @@ public okhttp3.Call getSettingsCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1073,26 +1029,26 @@ public okhttp3.Call getSettingsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingsValidateBeforeCall( - String indexName, + private okhttp3.Call deleteApiKeyValidateBeforeCall( + String key, final ApiCallback _callback ) throws ApiException { - // verify the required parameter 'indexName' is set - if (indexName == null) { + // verify the required parameter 'key' is set + if (key == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling getSettings(Async)" + "Missing the required parameter 'key' when calling deleteApiKey(Async)" ); } - okhttp3.Call localVarCall = getSettingsCall(indexName, _callback); + okhttp3.Call localVarCall = deleteApiKeyCall(key, _callback); return localVarCall; } /** - * Retrieve settings of a given indexName. + * Delete an API key. Delete an existing API Key. * - * @param indexName The index in which to perform the request. (required) - * @return IndexSettings + * @param key API Key string. (required) + * @return DeleteApiKeyResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1105,18 +1061,18 @@ private okhttp3.Call getSettingsValidateBeforeCall( * 404 Index not found. - * */ - public IndexSettings getSettings(String indexName) throws ApiException { - ApiResponse localVarResp = getSettingsWithHttpInfo( - indexName + public DeleteApiKeyResponse deleteApiKey(String key) throws ApiException { + ApiResponse localVarResp = deleteApiKeyWithHttpInfo( + key ); return localVarResp.getData(); } /** - * Retrieve settings of a given indexName. + * Delete an API key. Delete an existing API Key. * - * @param indexName The index in which to perform the request. (required) - * @return ApiResponse<IndexSettings> + * @param key API Key string. (required) + * @return ApiResponse<DeleteApiKeyResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1129,17 +1085,18 @@ public IndexSettings getSettings(String indexName) throws ApiException { * 404 Index not found. - * */ - public ApiResponse getSettingsWithHttpInfo(String indexName) + public ApiResponse deleteApiKeyWithHttpInfo(String key) throws ApiException { - okhttp3.Call localVarCall = getSettingsValidateBeforeCall(indexName, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(key, null); + Type localVarReturnType = new TypeToken() {} + .getType(); return this.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) Retrieve settings of a given indexName. + * Delete an API key. (asynchronously) Delete an existing API Key. * - * @param indexName The index in which to perform the request. (required) + * @param key API Key string. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1153,24 +1110,21 @@ public ApiResponse getSettingsWithHttpInfo(String indexName) * 404 Index not found. - * */ - public okhttp3.Call getSettingsAsync( - String indexName, - final ApiCallback _callback + public okhttp3.Call deleteApiKeyAsync( + String key, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = getSettingsValidateBeforeCall( - indexName, - _callback - ); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(key, _callback); + Type localVarReturnType = new TypeToken() {} + .getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getSynonym + * Build call for deleteIndex * * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1184,22 +1138,17 @@ public okhttp3.Call getSettingsAsync( * 404 Index not found. - * */ - public okhttp3.Call getSynonymCall( + public okhttp3.Call deleteIndexCall( String indexName, - String objectID, final ApiCallback _callback ) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = - "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( + "/1/indexes/{indexName}".replaceAll( "\\{" + "indexName" + "\\}", this.escapeString(indexName.toString()) - ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) ); List localVarQueryParams = new ArrayList(); @@ -1223,7 +1172,7 @@ public okhttp3.Call getSynonymCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1236,35 +1185,26 @@ public okhttp3.Call getSynonymCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSynonymValidateBeforeCall( + private okhttp3.Call deleteIndexValidateBeforeCall( String indexName, - String objectID, final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling getSynonym(Async)" - ); - } - - // verify the required parameter 'objectID' is set - if (objectID == null) { - throw new ApiException( - "Missing the required parameter 'objectID' when calling getSynonym(Async)" + "Missing the required parameter 'indexName' when calling deleteIndex(Async)" ); } - okhttp3.Call localVarCall = getSynonymCall(indexName, objectID, _callback); + okhttp3.Call localVarCall = deleteIndexCall(indexName, _callback); return localVarCall; } /** - * Get synonym. Fetch a synonym object identified by its objectID. + * Delete index. Delete an existing index. * * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @return SynonymHit + * @return DeleteIndexResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1277,21 +1217,18 @@ private okhttp3.Call getSynonymValidateBeforeCall( * 404 Index not found. - * */ - public SynonymHit getSynonym(String indexName, String objectID) - throws ApiException { - ApiResponse localVarResp = getSynonymWithHttpInfo( - indexName, - objectID + public DeleteIndexResponse deleteIndex(String indexName) throws ApiException { + ApiResponse localVarResp = deleteIndexWithHttpInfo( + indexName ); return localVarResp.getData(); } /** - * Get synonym. Fetch a synonym object identified by its objectID. + * Delete index. Delete an existing index. * * @param indexName The index in which to perform the request. (required) - * @param objectID Unique identifier of an object. (required) - * @return ApiResponse<SynonymHit> + * @return ApiResponse<DeleteIndexResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1304,24 +1241,18 @@ public SynonymHit getSynonym(String indexName, String objectID) * 404 Index not found. - * */ - public ApiResponse getSynonymWithHttpInfo( - String indexName, - String objectID + public ApiResponse deleteIndexWithHttpInfo( + String indexName ) throws ApiException { - okhttp3.Call localVarCall = getSynonymValidateBeforeCall( - indexName, - objectID, - null - ); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, null); + Type localVarReturnType = new TypeToken() {}.getType(); return this.execute(localVarCall, localVarReturnType); } /** - * Get synonym. (asynchronously) Fetch a synonym object identified by its objectID. + * Delete index. (asynchronously) Delete an existing index. * * @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 ApiException If fail to process the API call, e.g. serializing the request body object @@ -1335,26 +1266,26 @@ public ApiResponse getSynonymWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call getSynonymAsync( + public okhttp3.Call deleteIndexAsync( String indexName, - String objectID, - final ApiCallback _callback + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = getSynonymValidateBeforeCall( + okhttp3.Call localVarCall = deleteIndexValidateBeforeCall( indexName, - objectID, _callback ); - Type localVarReturnType = new TypeToken() {}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getTask + * Build call for deleteSynonym * * @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 objectID Unique identifier of an object. (required) + * @param forwardToReplicas When true, changes are also propagated to replicas of the given + * indexName. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1368,22 +1299,23 @@ public okhttp3.Call getSynonymAsync( * 404 Index not found. - * */ - public okhttp3.Call getTaskCall( + public okhttp3.Call deleteSynonymCall( String indexName, - Integer taskID, + String objectID, + Boolean forwardToReplicas, final ApiCallback _callback ) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = - "/1/indexes/{indexName}/task/{taskID}".replaceAll( + "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( "\\{" + "indexName" + "\\}", this.escapeString(indexName.toString()) ) .replaceAll( - "\\{" + "taskID" + "\\}", - this.escapeString(taskID.toString()) + "\\{" + "objectID" + "\\}", + this.escapeString(objectID.toString()) ); List localVarQueryParams = new ArrayList(); @@ -1392,6 +1324,12 @@ public okhttp3.Call getTaskCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (forwardToReplicas != null) { + localVarQueryParams.addAll( + this.parameterToPair("forwardToReplicas", forwardToReplicas) + ); + } + final String[] localVarAccepts = { "application/json" }; final String localVarAccept = this.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1407,7 +1345,7 @@ public okhttp3.Call getTaskCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1420,35 +1358,43 @@ public okhttp3.Call getTaskCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getTaskValidateBeforeCall( + private okhttp3.Call deleteSynonymValidateBeforeCall( String indexName, - Integer taskID, + String objectID, + Boolean forwardToReplicas, final ApiCallback _callback ) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling getTask(Async)" + "Missing the required parameter 'indexName' when calling deleteSynonym(Async)" ); } - // verify the required parameter 'taskID' is set - if (taskID == null) { + // verify the required parameter 'objectID' is set + if (objectID == null) { throw new ApiException( - "Missing the required parameter 'taskID' when calling getTask(Async)" + "Missing the required parameter 'objectID' when calling deleteSynonym(Async)" ); } - okhttp3.Call localVarCall = getTaskCall(indexName, taskID, _callback); + okhttp3.Call localVarCall = deleteSynonymCall( + indexName, + objectID, + forwardToReplicas, + _callback + ); return localVarCall; } /** - * Check the current status of a given task. + * Delete synonym. Delete a single synonyms set, identified by the given objectID. * * @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 + * @param objectID Unique identifier of an object. (required) + * @param forwardToReplicas When true, changes are also propagated to replicas of the given + * indexName. (optional) + * @return DeleteSynonymResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1461,21 +1407,27 @@ private okhttp3.Call getTaskValidateBeforeCall( * 404 Index not found. - * */ - public GetTaskResponse getTask(String indexName, Integer taskID) - throws ApiException { - ApiResponse localVarResp = getTaskWithHttpInfo( + public DeleteSynonymResponse deleteSynonym( + String indexName, + String objectID, + Boolean forwardToReplicas + ) throws ApiException { + ApiResponse localVarResp = deleteSynonymWithHttpInfo( indexName, - taskID + objectID, + forwardToReplicas ); return localVarResp.getData(); } /** - * Check the current status of a given task. + * Delete synonym. Delete a single synonyms set, identified by the given objectID. * * @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 ApiResponse<GetTaskResponse> + * @param objectID Unique identifier of an object. (required) + * @param forwardToReplicas When true, changes are also propagated to replicas of the given + * indexName. (optional) + * @return ApiResponse<DeleteSynonymResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1488,24 +1440,30 @@ public GetTaskResponse getTask(String indexName, Integer taskID) * 404 Index not found. - * */ - public ApiResponse getTaskWithHttpInfo( + public ApiResponse deleteSynonymWithHttpInfo( String indexName, - Integer taskID + String objectID, + Boolean forwardToReplicas ) throws ApiException { - okhttp3.Call localVarCall = getTaskValidateBeforeCall( + okhttp3.Call localVarCall = deleteSynonymValidateBeforeCall( indexName, - taskID, + objectID, + forwardToReplicas, null ); - Type localVarReturnType = new TypeToken() {}.getType(); + Type localVarReturnType = new TypeToken() {} + .getType(); return this.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) Check the current status of a given task. + * Delete synonym. (asynchronously) Delete a single synonyms set, identified by the given + * objectID. * * @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 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 ApiException If fail to process the API call, e.g. serializing the request body object @@ -1519,27 +1477,28 @@ public ApiResponse getTaskWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call getTaskAsync( + public okhttp3.Call deleteSynonymAsync( String indexName, - Integer taskID, - final ApiCallback _callback + String objectID, + Boolean forwardToReplicas, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = getTaskValidateBeforeCall( + okhttp3.Call localVarCall = deleteSynonymValidateBeforeCall( indexName, - taskID, + objectID, + forwardToReplicas, _callback ); - Type localVarReturnType = new TypeToken() {}.getType(); + Type localVarReturnType = new TypeToken() {} + .getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listIndices + * Build call for getApiKey * - * @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 key API Key string. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1553,14 +1512,16 @@ public okhttp3.Call getTaskAsync( * 404 Index not found. - * */ - public okhttp3.Call listIndicesCall( - Integer page, - final ApiCallback _callback - ) throws ApiException { + public okhttp3.Call getApiKeyCall(String key, final ApiCallback _callback) + throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/1/indexes"; + String localVarPath = + "/1/keys/{key}".replaceAll( + "\\{" + "key" + "\\}", + this.escapeString(key.toString()) + ); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1568,10 +1529,6 @@ public okhttp3.Call listIndicesCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (page != null) { - localVarQueryParams.addAll(this.parameterToPair("Page", page)); - } - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = this.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1600,21 +1557,26 @@ public okhttp3.Call listIndicesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listIndicesValidateBeforeCall( - Integer page, + private okhttp3.Call getApiKeyValidateBeforeCall( + String key, final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = listIndicesCall(page, _callback); + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException( + "Missing the required parameter 'key' when calling getApiKey(Async)" + ); + } + + okhttp3.Call localVarCall = getApiKeyCall(key, _callback); return localVarCall; } /** - * List existing indexes. List existing indexes from an application. + * Get an API key. Get the permissions of an API key. * - * @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 + * @param key API Key string. (required) + * @return KeyObject * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1627,20 +1589,16 @@ private okhttp3.Call listIndicesValidateBeforeCall( * 404 Index not found. - * */ - public ListIndicesResponse listIndices(Integer page) throws ApiException { - ApiResponse localVarResp = listIndicesWithHttpInfo( - page - ); + public KeyObject getApiKey(String key) throws ApiException { + ApiResponse localVarResp = getApiKeyWithHttpInfo(key); return localVarResp.getData(); } /** - * List existing indexes. List existing indexes from an application. + * Get an API key. Get the permissions of an API key. * - * @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 ApiResponse<ListIndicesResponse> + * @param key API Key string. (required) + * @return ApiResponse<KeyObject> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1653,19 +1611,17 @@ public ListIndicesResponse listIndices(Integer page) throws ApiException { * 404 Index not found. - * */ - public ApiResponse listIndicesWithHttpInfo(Integer page) + public ApiResponse getApiKeyWithHttpInfo(String key) throws ApiException { - okhttp3.Call localVarCall = listIndicesValidateBeforeCall(page, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getApiKeyValidateBeforeCall(key, null); + Type localVarReturnType = new TypeToken() {}.getType(); return this.execute(localVarCall, localVarReturnType); } /** - * List existing indexes. (asynchronously) List existing indexes from an application. + * Get an API key. (asynchronously) Get the permissions of an API key. * - * @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 key API Key string. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1679,20 +1635,27 @@ public ApiResponse listIndicesWithHttpInfo(Integer page) * 404 Index not found. - * */ - public okhttp3.Call listIndicesAsync( - Integer page, - final ApiCallback _callback + public okhttp3.Call getApiKeyAsync( + String key, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = listIndicesValidateBeforeCall(page, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getApiKeyValidateBeforeCall(key, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for multipleQueries + * Build call for getLogs * - * @param multipleQueriesObject (required) + * @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 Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1706,14 +1669,17 @@ public okhttp3.Call listIndicesAsync( * 404 Index not found. - * */ - public okhttp3.Call multipleQueriesCall( - MultipleQueriesObject multipleQueriesObject, + public okhttp3.Call getLogsCall( + Integer offset, + Integer length, + String indexName, + String type, final ApiCallback _callback ) throws ApiException { - Object localVarPostBody = multipleQueriesObject; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/1/indexes/*/queries"; + String localVarPath = "/1/logs"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1721,13 +1687,30 @@ public okhttp3.Call multipleQueriesCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (offset != null) { + localVarQueryParams.addAll(this.parameterToPair("offset", offset)); + } + + if (length != null) { + localVarQueryParams.addAll(this.parameterToPair("length", length)); + } + + if (indexName != null) { + localVarQueryParams.addAll(this.parameterToPair("indexName", indexName)); + } + + if (type != null) { + localVarQueryParams.addAll(this.parameterToPair("type", type)); + } + final String[] localVarAccepts = { "application/json" }; final String localVarAccept = this.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { "application/json" }; + final String[] localVarContentTypes = {}; + final String localVarContentType = this.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -1735,7 +1718,7 @@ public okhttp3.Call multipleQueriesCall( String[] localVarAuthNames = new String[] { "apiKey", "appId" }; return this.buildCall( localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1748,15 +1731,1829 @@ public okhttp3.Call multipleQueriesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call multipleQueriesValidateBeforeCall( - MultipleQueriesObject multipleQueriesObject, + private okhttp3.Call getLogsValidateBeforeCall( + Integer offset, + Integer length, + String indexName, + String type, final ApiCallback _callback ) throws ApiException { - // verify the required parameter 'multipleQueriesObject' is set - if (multipleQueriesObject == null) { - throw new ApiException( - "Missing the required parameter 'multipleQueriesObject' when calling" + - " multipleQueries(Async)" + okhttp3.Call localVarCall = getLogsCall( + offset, + length, + indexName, + type, + _callback + ); + return localVarCall; + } + + /** + * 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public GetLogsResponse getLogs( + Integer offset, + Integer length, + String indexName, + String type + ) throws ApiException { + ApiResponse localVarResp = getLogsWithHttpInfo( + offset, + length, + indexName, + type + ); + return localVarResp.getData(); + } + + /** + * 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 ApiResponse<GetLogsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse getLogsWithHttpInfo( + Integer offset, + Integer length, + String indexName, + String type + ) throws ApiException { + okhttp3.Call localVarCall = getLogsValidateBeforeCall( + offset, + length, + indexName, + type, + null + ); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getLogsAsync( + Integer offset, + Integer length, + String indexName, + String type, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getLogsValidateBeforeCall( + offset, + length, + indexName, + type, + _callback + ); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSettings + * + * @param indexName The index in which to perform the request. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getSettingsCall( + String indexName, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/indexes/{indexName}/settings".replaceAll( + "\\{" + "indexName" + "\\}", + this.escapeString(indexName.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingsValidateBeforeCall( + String indexName, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + "Missing the required parameter 'indexName' when calling getSettings(Async)" + ); + } + + okhttp3.Call localVarCall = getSettingsCall(indexName, _callback); + return localVarCall; + } + + /** + * Retrieve settings of a given indexName. + * + * @param indexName The index in which to perform the request. (required) + * @return IndexSettings + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public IndexSettings getSettings(String indexName) throws ApiException { + ApiResponse localVarResp = getSettingsWithHttpInfo( + indexName + ); + return localVarResp.getData(); + } + + /** + * Retrieve settings of a given indexName. + * + * @param indexName The index in which to perform the request. (required) + * @return ApiResponse<IndexSettings> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse getSettingsWithHttpInfo(String indexName) + throws ApiException { + okhttp3.Call localVarCall = getSettingsValidateBeforeCall(indexName, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getSettingsAsync( + String indexName, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getSettingsValidateBeforeCall( + indexName, + _callback + ); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSynonym + * + * @param indexName The index in which to perform the request. (required) + * @param objectID Unique identifier of an object. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getSynonymCall( + String indexName, + String objectID, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( + "\\{" + "indexName" + "\\}", + this.escapeString(indexName.toString()) + ) + .replaceAll( + "\\{" + "objectID" + "\\}", + this.escapeString(objectID.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSynonymValidateBeforeCall( + String indexName, + String objectID, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + "Missing the required parameter 'indexName' when calling getSynonym(Async)" + ); + } + + // verify the required parameter 'objectID' is set + if (objectID == null) { + throw new ApiException( + "Missing the required parameter 'objectID' when calling getSynonym(Async)" + ); + } + + okhttp3.Call localVarCall = getSynonymCall(indexName, objectID, _callback); + return localVarCall; + } + + /** + * Get synonym. 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public SynonymHit getSynonym(String indexName, String objectID) + throws ApiException { + ApiResponse localVarResp = getSynonymWithHttpInfo( + indexName, + objectID + ); + return localVarResp.getData(); + } + + /** + * Get synonym. 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 ApiResponse<SynonymHit> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse getSynonymWithHttpInfo( + String indexName, + String objectID + ) throws ApiException { + okhttp3.Call localVarCall = getSynonymValidateBeforeCall( + indexName, + objectID, + null + ); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Get synonym. (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getSynonymAsync( + String indexName, + String objectID, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getSynonymValidateBeforeCall( + indexName, + objectID, + _callback + ); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getTask + * + * @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 Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getTaskCall( + String indexName, + Integer taskID, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/indexes/{indexName}/task/{taskID}".replaceAll( + "\\{" + "indexName" + "\\}", + this.escapeString(indexName.toString()) + ) + .replaceAll( + "\\{" + "taskID" + "\\}", + this.escapeString(taskID.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTaskValidateBeforeCall( + String indexName, + Integer taskID, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + "Missing the required parameter 'indexName' when calling getTask(Async)" + ); + } + + // verify the required parameter 'taskID' is set + if (taskID == null) { + throw new ApiException( + "Missing the required parameter 'taskID' when calling getTask(Async)" + ); + } + + okhttp3.Call localVarCall = getTaskCall(indexName, taskID, _callback); + return localVarCall; + } + + /** + * 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public GetTaskResponse getTask(String indexName, Integer taskID) + throws ApiException { + ApiResponse localVarResp = getTaskWithHttpInfo( + indexName, + taskID + ); + return localVarResp.getData(); + } + + /** + * 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 ApiResponse<GetTaskResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse getTaskWithHttpInfo( + String indexName, + Integer taskID + ) throws ApiException { + okhttp3.Call localVarCall = getTaskValidateBeforeCall( + indexName, + taskID, + null + ); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getTaskAsync( + String indexName, + Integer taskID, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getTaskValidateBeforeCall( + indexName, + taskID, + _callback + ); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getTopUserIds + * + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getTopUserIdsCall(final ApiCallback _callback) + throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/1/clusters/mapping/top"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTopUserIdsValidateBeforeCall( + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getTopUserIdsCall(_callback); + return localVarCall; + } + + /** + * Get top userID 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public GetTopUserIdsResponse getTopUserIds() throws ApiException { + ApiResponse localVarResp = getTopUserIdsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get top userID 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 ApiResponse<GetTopUserIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse getTopUserIdsWithHttpInfo() + throws ApiException { + okhttp3.Call localVarCall = getTopUserIdsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken() {} + .getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Get top userID (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getTopUserIdsAsync( + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getTopUserIdsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUserId + * + * @param userID userID to assign. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getUserIdCall(Object userID, final ApiCallback _callback) + throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/clusters/mapping/{userID}".replaceAll( + "\\{" + "userID" + "\\}", + this.escapeString(userID.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserIdValidateBeforeCall( + Object userID, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException( + "Missing the required parameter 'userID' when calling getUserId(Async)" + ); + } + + okhttp3.Call localVarCall = getUserIdCall(userID, _callback); + return localVarCall; + } + + /** + * Get userID 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public UserId getUserId(Object userID) throws ApiException { + ApiResponse localVarResp = getUserIdWithHttpInfo(userID); + return localVarResp.getData(); + } + + /** + * Get userID 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 ApiResponse<UserId> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse getUserIdWithHttpInfo(Object userID) + throws ApiException { + okhttp3.Call localVarCall = getUserIdValidateBeforeCall(userID, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Get userID (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call getUserIdAsync( + Object userID, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = getUserIdValidateBeforeCall(userID, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for hasPendingMappings + * + * @param getClusters (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call hasPendingMappingsCall( + Boolean getClusters, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/1/clusters/mapping/pending"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (getClusters != null) { + localVarQueryParams.addAll( + this.parameterToPair("getClusters", getClusters) + ); + } + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasPendingMappingsValidateBeforeCall( + Boolean getClusters, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = hasPendingMappingsCall(getClusters, _callback); + return localVarCall; + } + + /** + * Has pending mappings 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 (optional) + * @return HasPendingMappingsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public HasPendingMappingsResponse hasPendingMappings(Boolean getClusters) + throws ApiException { + ApiResponse localVarResp = hasPendingMappingsWithHttpInfo( + getClusters + ); + return localVarResp.getData(); + } + + /** + * Has pending mappings 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 (optional) + * @return ApiResponse<HasPendingMappingsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse hasPendingMappingsWithHttpInfo( + Boolean getClusters + ) throws ApiException { + okhttp3.Call localVarCall = hasPendingMappingsValidateBeforeCall( + getClusters, + null + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Has pending mappings (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 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call hasPendingMappingsAsync( + Boolean getClusters, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = hasPendingMappingsValidateBeforeCall( + getClusters, + _callback + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listApiKeys + * + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listApiKeysCall(final ApiCallback _callback) + throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/1/keys"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listApiKeysValidateBeforeCall( + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listApiKeysCall(_callback); + return localVarCall; + } + + /** + * Get the full list of API Keys. List API keys, along with their associated rights. + * + * @return ListApiKeysResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ListApiKeysResponse listApiKeys() throws ApiException { + ApiResponse localVarResp = listApiKeysWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the full list of API Keys. List API keys, along with their associated rights. + * + * @return ApiResponse<ListApiKeysResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse listApiKeysWithHttpInfo() + throws ApiException { + okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(null); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Get the full list of API Keys. (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listApiKeysAsync( + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listClusters + * + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listClustersCall(final ApiCallback _callback) + throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/1/clusters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listClustersValidateBeforeCall( + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listClustersCall(_callback); + return localVarCall; + } + + /** + * List clusters 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ListClustersResponse listClusters() throws ApiException { + ApiResponse localVarResp = listClustersWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List clusters 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 ApiResponse<ListClustersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse listClustersWithHttpInfo() + throws ApiException { + okhttp3.Call localVarCall = listClustersValidateBeforeCall(null); + Type localVarReturnType = new TypeToken() {} + .getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * List clusters (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listClustersAsync( + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listClustersValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listIndices + * + * @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 Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listIndicesCall( + Integer page, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/1/indexes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(this.parameterToPair("Page", page)); + } + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listIndicesValidateBeforeCall( + Integer page, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listIndicesCall(page, _callback); + return localVarCall; + } + + /** + * List existing indexes. 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ListIndicesResponse listIndices(Integer page) throws ApiException { + ApiResponse localVarResp = listIndicesWithHttpInfo( + page + ); + return localVarResp.getData(); + } + + /** + * List existing indexes. 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 ApiResponse<ListIndicesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse listIndicesWithHttpInfo(Integer page) + throws ApiException { + okhttp3.Call localVarCall = listIndicesValidateBeforeCall(page, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * List existing indexes. (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listIndicesAsync( + Integer page, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listIndicesValidateBeforeCall(page, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listUserIds + * + * @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 Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listUserIdsCall( + Integer page, + Integer hitsPerPage, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/1/clusters/mapping"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(this.parameterToPair("Page", page)); + } + + if (hitsPerPage != null) { + localVarQueryParams.addAll( + this.parameterToPair("hitsPerPage", hitsPerPage) + ); + } + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUserIdsValidateBeforeCall( + Integer page, + Integer hitsPerPage, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listUserIdsCall(page, hitsPerPage, _callback); + return localVarCall; + } + + /** + * List userIDs 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ListUserIdsResponse listUserIds(Integer page, Integer hitsPerPage) + throws ApiException { + ApiResponse localVarResp = listUserIdsWithHttpInfo( + page, + hitsPerPage + ); + return localVarResp.getData(); + } + + /** + * List userIDs 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 ApiResponse<ListUserIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse listUserIdsWithHttpInfo( + Integer page, + Integer hitsPerPage + ) throws ApiException { + okhttp3.Call localVarCall = listUserIdsValidateBeforeCall( + page, + hitsPerPage, + null + ); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * List userIDs (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call listUserIdsAsync( + Integer page, + Integer hitsPerPage, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = listUserIdsValidateBeforeCall( + page, + hitsPerPage, + _callback + ); + Type localVarReturnType = new TypeToken() {}.getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for multipleQueries + * + * @param multipleQueriesObject (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call multipleQueriesCall( + MultipleQueriesObject multipleQueriesObject, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = multipleQueriesObject; + + // create path and map variables + String localVarPath = "/1/indexes/*/queries"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call multipleQueriesValidateBeforeCall( + MultipleQueriesObject multipleQueriesObject, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'multipleQueriesObject' is set + if (multipleQueriesObject == null) { + throw new ApiException( + "Missing the required parameter 'multipleQueriesObject' when calling" + + " multipleQueries(Async)" ); } @@ -2030,13 +3827,332 @@ public okhttp3.Call operationIndexAsync( OperationIndexObject operationIndexObject, final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = operationIndexValidateBeforeCall( - indexName, - operationIndexObject, - _callback - ); - Type localVarReturnType = new TypeToken() {} - .getType(); + okhttp3.Call localVarCall = operationIndexValidateBeforeCall( + indexName, + operationIndexObject, + _callback + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for removeUserId + * + * @param userID userID to assign. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call removeUserIdCall( + Object userID, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/clusters/mapping/{userID}".replaceAll( + "\\{" + "userID" + "\\}", + this.escapeString(userID.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeUserIdValidateBeforeCall( + Object userID, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException( + "Missing the required parameter 'userID' when calling removeUserId(Async)" + ); + } + + okhttp3.Call localVarCall = removeUserIdCall(userID, _callback); + return localVarCall; + } + + /** + * Remove userID 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public RemoveUserIdResponse removeUserId(Object userID) throws ApiException { + ApiResponse localVarResp = removeUserIdWithHttpInfo( + userID + ); + return localVarResp.getData(); + } + + /** + * Remove userID 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 ApiResponse<RemoveUserIdResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse removeUserIdWithHttpInfo( + Object userID + ) throws ApiException { + okhttp3.Call localVarCall = removeUserIdValidateBeforeCall(userID, null); + Type localVarReturnType = new TypeToken() {} + .getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Remove userID (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call removeUserIdAsync( + Object userID, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = removeUserIdValidateBeforeCall( + userID, + _callback + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for restoreApiKey + * + * @param key API Key string. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call restoreApiKeyCall( + String key, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/keys/{key}/restore".replaceAll( + "\\{" + "key" + "\\}", + this.escapeString(key.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call restoreApiKeyValidateBeforeCall( + String key, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException( + "Missing the required parameter 'key' when calling restoreApiKey(Async)" + ); + } + + okhttp3.Call localVarCall = restoreApiKeyCall(key, _callback); + return localVarCall; + } + + /** + * Restore an API key. Restore a deleted API key, along with its associated rights. + * + * @param key API Key string. (required) + * @return AddApiKeyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public AddApiKeyResponse restoreApiKey(String key) throws ApiException { + ApiResponse localVarResp = restoreApiKeyWithHttpInfo( + key + ); + return localVarResp.getData(); + } + + /** + * Restore an API key. Restore a deleted API key, along with its associated rights. + * + * @param key API Key string. (required) + * @return ApiResponse<AddApiKeyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse restoreApiKeyWithHttpInfo(String key) + throws ApiException { + okhttp3.Call localVarCall = restoreApiKeyValidateBeforeCall(key, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Restore an API key. (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call restoreApiKeyAsync( + String key, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = restoreApiKeyValidateBeforeCall(key, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -2877,15 +4993,258 @@ public okhttp3.Call searchAsync( } /** - * Build call for searchSynonyms + * Build call for searchSynonyms + * + * @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 Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call searchSynonymsCall( + String indexName, + String query, + String type, + Integer page, + Integer hitsPerPage, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/1/indexes/{indexName}/synonyms/search".replaceAll( + "\\{" + "indexName" + "\\}", + this.escapeString(indexName.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (query != null) { + localVarQueryParams.addAll(this.parameterToPair("query", query)); + } + + if (type != null) { + localVarQueryParams.addAll(this.parameterToPair("type", type)); + } + + if (page != null) { + localVarQueryParams.addAll(this.parameterToPair("Page", page)); + } + + if (hitsPerPage != null) { + localVarQueryParams.addAll( + this.parameterToPair("hitsPerPage", hitsPerPage) + ); + } + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call searchSynonymsValidateBeforeCall( + String indexName, + String query, + String type, + Integer page, + Integer hitsPerPage, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + "Missing the required parameter 'indexName' when calling searchSynonyms(Async)" + ); + } + + okhttp3.Call localVarCall = searchSynonymsCall( + indexName, + query, + type, + page, + hitsPerPage, + _callback + ); + return localVarCall; + } + + /** + * Get all synonyms that match a query. 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 ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public SearchSynonymsResponse searchSynonyms( + String indexName, + String query, + String type, + Integer page, + Integer hitsPerPage + ) throws ApiException { + ApiResponse localVarResp = searchSynonymsWithHttpInfo( + indexName, + query, + type, + page, + hitsPerPage + ); + return localVarResp.getData(); + } + + /** + * Get all synonyms that match a query. 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 ApiResponse<SearchSynonymsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse searchSynonymsWithHttpInfo( + String indexName, + String query, + String type, + Integer page, + Integer hitsPerPage + ) throws ApiException { + okhttp3.Call localVarCall = searchSynonymsValidateBeforeCall( + indexName, + query, + type, + page, + hitsPerPage, + null + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Get all synonyms that match a query. (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call searchSynonymsAsync( + String indexName, + String query, + String type, + Integer page, + Integer hitsPerPage, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = searchSynonymsValidateBeforeCall( + indexName, + query, + type, + page, + hitsPerPage, + _callback + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for searchUserIds * - * @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 searchUserIdsObject (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2899,22 +5258,14 @@ public okhttp3.Call searchAsync( * 404 Index not found. - * */ - public okhttp3.Call searchSynonymsCall( - String indexName, - String query, - String type, - Integer page, - Integer hitsPerPage, + public okhttp3.Call searchUserIdsCall( + SearchUserIdsObject searchUserIdsObject, final ApiCallback _callback ) throws ApiException { - Object localVarPostBody = null; + Object localVarPostBody = searchUserIdsObject; // create path and map variables - String localVarPath = - "/1/indexes/{indexName}/synonyms/search".replaceAll( - "\\{" + "indexName" + "\\}", - this.escapeString(indexName.toString()) - ); + String localVarPath = "/1/clusters/mapping/search"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2922,32 +5273,13 @@ public okhttp3.Call searchSynonymsCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (query != null) { - localVarQueryParams.addAll(this.parameterToPair("query", query)); - } - - if (type != null) { - localVarQueryParams.addAll(this.parameterToPair("type", type)); - } - - if (page != null) { - localVarQueryParams.addAll(this.parameterToPair("Page", page)); - } - - if (hitsPerPage != null) { - localVarQueryParams.addAll( - this.parameterToPair("hitsPerPage", hitsPerPage) - ); - } - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = this.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; - + final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = this.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -2968,44 +5300,35 @@ public okhttp3.Call searchSynonymsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call searchSynonymsValidateBeforeCall( - String indexName, - String query, - String type, - Integer page, - Integer hitsPerPage, + private okhttp3.Call searchUserIdsValidateBeforeCall( + SearchUserIdsObject searchUserIdsObject, final ApiCallback _callback ) throws ApiException { - // verify the required parameter 'indexName' is set - if (indexName == null) { + // verify the required parameter 'searchUserIdsObject' is set + if (searchUserIdsObject == null) { throw new ApiException( - "Missing the required parameter 'indexName' when calling searchSynonyms(Async)" + "Missing the required parameter 'searchUserIdsObject' when calling searchUserIds(Async)" ); } - okhttp3.Call localVarCall = searchSynonymsCall( - indexName, - query, - type, - page, - hitsPerPage, + okhttp3.Call localVarCall = searchUserIdsCall( + searchUserIdsObject, _callback ); return localVarCall; } /** - * Get all synonyms that match a query. Search or browse all synonyms, optionally filtering them - * by type. + * Search userID 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 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 + * @param searchUserIdsObject (required) + * @return SearchUserIdsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -3018,35 +5341,26 @@ private okhttp3.Call searchSynonymsValidateBeforeCall( * 404 Index not found. - * */ - public SearchSynonymsResponse searchSynonyms( - String indexName, - String query, - String type, - Integer page, - Integer hitsPerPage + public SearchUserIdsResponse searchUserIds( + SearchUserIdsObject searchUserIdsObject ) throws ApiException { - ApiResponse localVarResp = searchSynonymsWithHttpInfo( - indexName, - query, - type, - page, - hitsPerPage + ApiResponse localVarResp = searchUserIdsWithHttpInfo( + searchUserIdsObject ); return localVarResp.getData(); } /** - * Get all synonyms that match a query. Search or browse all synonyms, optionally filtering them - * by type. + * Search userID 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 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 ApiResponse<SearchSynonymsResponse> + * @param searchUserIdsObject (required) + * @return ApiResponse<SearchUserIdsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -3059,37 +5373,29 @@ public SearchSynonymsResponse searchSynonyms( * 404 Index not found. - * */ - public ApiResponse searchSynonymsWithHttpInfo( - String indexName, - String query, - String type, - Integer page, - Integer hitsPerPage + public ApiResponse searchUserIdsWithHttpInfo( + SearchUserIdsObject searchUserIdsObject ) throws ApiException { - okhttp3.Call localVarCall = searchSynonymsValidateBeforeCall( - indexName, - query, - type, - page, - hitsPerPage, + okhttp3.Call localVarCall = searchUserIdsValidateBeforeCall( + searchUserIdsObject, null ); - Type localVarReturnType = new TypeToken() {} + Type localVarReturnType = new TypeToken() {} .getType(); return this.execute(localVarCall, localVarReturnType); } /** - * Get all synonyms that match a query. (asynchronously) Search or browse all synonyms, optionally - * filtering them by type. + * Search userID (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 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 searchUserIdsObject (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -3103,23 +5409,15 @@ public ApiResponse searchSynonymsWithHttpInfo( * 404 Index not found. - * */ - public okhttp3.Call searchSynonymsAsync( - String indexName, - String query, - String type, - Integer page, - Integer hitsPerPage, - final ApiCallback _callback + public okhttp3.Call searchUserIdsAsync( + SearchUserIdsObject searchUserIdsObject, + final ApiCallback _callback ) throws ApiException { - okhttp3.Call localVarCall = searchSynonymsValidateBeforeCall( - indexName, - query, - type, - page, - hitsPerPage, + okhttp3.Call localVarCall = searchUserIdsValidateBeforeCall( + searchUserIdsObject, _callback ); - Type localVarReturnType = new TypeToken() {} + Type localVarReturnType = new TypeToken() {} .getType(); this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -3336,4 +5634,185 @@ public okhttp3.Call setSettingsAsync( this.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + + /** + * Build call for updateApiKey + * + * @param key API Key string. (required) + * @param apiKey (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call updateApiKeyCall( + String key, + ApiKey apiKey, + final ApiCallback _callback + ) throws ApiException { + Object localVarPostBody = apiKey; + + // create path and map variables + String localVarPath = + "/1/keys/{key}".replaceAll( + "\\{" + "key" + "\\}", + this.escapeString(key.toString()) + ); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = this.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = + this.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiKey", "appId" }; + return this.buildCall( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback + ); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateApiKeyValidateBeforeCall( + String key, + ApiKey apiKey, + final ApiCallback _callback + ) throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException( + "Missing the required parameter 'key' when calling updateApiKey(Async)" + ); + } + + // verify the required parameter 'apiKey' is set + if (apiKey == null) { + throw new ApiException( + "Missing the required parameter 'apiKey' when calling updateApiKey(Async)" + ); + } + + okhttp3.Call localVarCall = updateApiKeyCall(key, apiKey, _callback); + return localVarCall; + } + + /** + * Update an API key. Replace every permission of an existing API key. + * + * @param key API Key string. (required) + * @param apiKey (required) + * @return UpdateApiKeyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public UpdateApiKeyResponse updateApiKey(String key, ApiKey apiKey) + throws ApiException { + ApiResponse localVarResp = updateApiKeyWithHttpInfo( + key, + apiKey + ); + return localVarResp.getData(); + } + + /** + * Update an API key. Replace every permission of an existing API key. + * + * @param key API Key string. (required) + * @param apiKey (required) + * @return ApiResponse<UpdateApiKeyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public ApiResponse updateApiKeyWithHttpInfo( + String key, + ApiKey apiKey + ) throws ApiException { + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall( + key, + apiKey, + null + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + return this.execute(localVarCall, localVarReturnType); + } + + /** + * Update an API key. (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 ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
400 Bad request or request arguments. -
402 This feature is not enabled on your Algolia account. -
403 Method not allowed with this API key. -
404 Index not found. -
+ */ + public okhttp3.Call updateApiKeyAsync( + String key, + ApiKey apiKey, + final ApiCallback _callback + ) throws ApiException { + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall( + key, + apiKey, + _callback + ); + Type localVarReturnType = new TypeToken() {} + .getType(); + this.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/clients/algoliasearch-client-javascript/client-search/model/assignUserIdObject.ts b/clients/algoliasearch-client-javascript/client-search/model/assignUserIdObject.ts new file mode 100644 index 00000000000..e35c3cf793e --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/assignUserIdObject.ts @@ -0,0 +1,9 @@ +/** + * Assign userID object. + */ +export type AssignUserIdObject = { + /** + * Name of the cluster. + */ + cluster: string; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/assignUserIdResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/assignUserIdResponse.ts new file mode 100644 index 00000000000..9323e493963 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/assignUserIdResponse.ts @@ -0,0 +1,6 @@ +export type AssignUserIdResponse = { + /** + * Date of creation (ISO-8601 format). + */ + createdAt: Date; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/batchAssignUserIdsObject.ts b/clients/algoliasearch-client-javascript/client-search/model/batchAssignUserIdsObject.ts new file mode 100644 index 00000000000..c970da8ab51 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/batchAssignUserIdsObject.ts @@ -0,0 +1,13 @@ +/** + * Assign userID object. + */ +export type BatchAssignUserIdsObject = { + /** + * 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/client-search/model/batchAssignUserIdsResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/batchAssignUserIdsResponse.ts new file mode 100644 index 00000000000..a4e64bda6a9 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/batchAssignUserIdsResponse.ts @@ -0,0 +1,6 @@ +export type BatchAssignUserIdsResponse = { + /** + * Date of creation (ISO-8601 format). + */ + createdAt: Date; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/deleteIndexResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/deleteIndexResponse.ts index 4bc23f433f8..b03c54272b6 100644 --- a/clients/algoliasearch-client-javascript/client-search/model/deleteIndexResponse.ts +++ b/clients/algoliasearch-client-javascript/client-search/model/deleteIndexResponse.ts @@ -6,5 +6,5 @@ export type DeleteIndexResponse = { /** * Date of deletion (ISO-8601 format). */ - deleteAt?: Date; + deletedAt?: Date; }; diff --git a/clients/algoliasearch-client-javascript/client-search/model/getTopUserIdsResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/getTopUserIdsResponse.ts new file mode 100644 index 00000000000..58171c3bca3 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/getTopUserIdsResponse.ts @@ -0,0 +1,11 @@ +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/client-search/model/hasPendingMappingsResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/hasPendingMappingsResponse.ts new file mode 100644 index 00000000000..5384d3e8192 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/hasPendingMappingsResponse.ts @@ -0,0 +1,6 @@ +export type HasPendingMappingsResponse = { + /** + * Date of creation (ISO-8601 format). + */ + createdAt: Date; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/highlightResult.ts b/clients/algoliasearch-client-javascript/client-search/model/highlightResult.ts index 0946b038a96..e184f528caa 100644 --- a/clients/algoliasearch-client-javascript/client-search/model/highlightResult.ts +++ b/clients/algoliasearch-client-javascript/client-search/model/highlightResult.ts @@ -1,3 +1,6 @@ +/** + * Highlighted attributes. + */ export type HighlightResult = { /** * Markup text with occurrences highlighted. diff --git a/clients/algoliasearch-client-javascript/client-search/model/highlightedSynonym.ts b/clients/algoliasearch-client-javascript/client-search/model/highlightedSynonym.ts deleted file mode 100644 index 7b163e856bd..00000000000 --- a/clients/algoliasearch-client-javascript/client-search/model/highlightedSynonym.ts +++ /dev/null @@ -1,26 +0,0 @@ -export type HighlightedSynonym = { - /** - * Markup text with occurrences highlighted. - */ - value?: string; - /** - * Indicates how well the attribute matched the search query. - */ - matchLevel?: HighlightedSynonym.MatchLevelEnum; - /** - * List of words from the query that matched the object. - */ - matchedWords?: string[]; - /** - * Whether the entire attribute value is highlighted. - */ - fullyHighlighted?: boolean; -}; - -export namespace HighlightedSynonym { - export enum MatchLevelEnum { - None = 'none', - Partial = 'partial', - Full = 'full', - } -} diff --git a/clients/algoliasearch-client-javascript/client-search/model/listClustersResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/listClustersResponse.ts new file mode 100644 index 00000000000..245e8b9d00b --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/listClustersResponse.ts @@ -0,0 +1,9 @@ +/** + * Array of clusters. + */ +export type ListClustersResponse = { + /** + * Mapping of cluster names to top users. + */ + topUsers: string[]; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/listUserIdsResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/listUserIdsResponse.ts new file mode 100644 index 00000000000..c0d9d9c1a96 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/listUserIdsResponse.ts @@ -0,0 +1,11 @@ +import type { UserId } from './userId'; + +/** + * UserIDs data. + */ +export type ListUserIdsResponse = { + /** + * List of userIDs. + */ + userIDs: UserId[]; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/models.ts b/clients/algoliasearch-client-javascript/client-search/model/models.ts index 0f55a5fb4f5..e763aed2a72 100644 --- a/clients/algoliasearch-client-javascript/client-search/model/models.ts +++ b/clients/algoliasearch-client-javascript/client-search/model/models.ts @@ -3,10 +3,14 @@ import type { RequestOptions } from '../utils/types'; export * from './addApiKeyResponse'; export * from './apiKey'; +export * from './assignUserIdObject'; +export * from './assignUserIdResponse'; export * from './baseIndexSettings'; export * from './baseSearchParams'; export * from './baseSearchResponse'; export * from './baseSearchResponseFacetsStats'; +export * from './batchAssignUserIdsObject'; +export * from './batchAssignUserIdsResponse'; export * from './batchObject'; export * from './batchResponse'; export * from './clearAllSynonymsResponse'; @@ -19,13 +23,17 @@ export * from './getLogsResponse'; export * from './getLogsResponseInnerQueries'; export * from './getLogsResponseLogs'; export * from './getTaskResponse'; +export * from './getTopUserIdsResponse'; +export * from './hasPendingMappingsResponse'; export * from './highlightResult'; export * from './index'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; export * from './keyObject'; export * from './listApiKeysResponse'; +export * from './listClustersResponse'; export * from './listIndicesResponse'; +export * from './listUserIdsResponse'; export * from './multipleQueries'; export * from './multipleQueriesObject'; export * from './multipleQueriesResponse'; @@ -35,6 +43,7 @@ export * from './operationIndexResponse'; export * from './rankingInfo'; export * from './rankingInfoMatchedGeoLocation'; export * from './record'; +export * from './removeUserIdResponse'; export * from './saveObjectResponse'; export * from './saveSynonymResponse'; export * from './saveSynonymsResponse'; @@ -43,11 +52,16 @@ export * from './searchParams'; export * from './searchParamsAsString'; export * from './searchResponse'; export * from './searchSynonymsResponse'; +export * from './searchUserIdsObject'; +export * from './searchUserIdsResponse'; +export * from './searchUserIdsResponseHighlightResult'; +export * from './searchUserIdsResponseHits'; export * from './setSettingsResponse'; export * from './snippetResult'; export * from './synonymHit'; export * from './synonymHitHighlightResult'; export * from './updateApiKeyResponse'; +export * from './userId'; export interface Authentication { /** diff --git a/clients/algoliasearch-client-javascript/client-search/model/removeUserIdResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/removeUserIdResponse.ts new file mode 100644 index 00000000000..81ed3963d6e --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/removeUserIdResponse.ts @@ -0,0 +1,6 @@ +export type RemoveUserIdResponse = { + /** + * Date of deletion (ISO-8601 format). + */ + deletedAt: Date; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsObject.ts b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsObject.ts new file mode 100644 index 00000000000..c0f5a2c483f --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsObject.ts @@ -0,0 +1,21 @@ +/** + * OK. + */ +export type SearchUserIdsObject = { + /** + * 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/client-search/model/searchUserIdsResponse.ts b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponse.ts new file mode 100644 index 00000000000..521512b5f3e --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponse.ts @@ -0,0 +1,24 @@ +import type { SearchUserIdsResponseHits } from './searchUserIdsResponseHits'; + +/** + * UserIDs data. + */ +export type SearchUserIdsResponse = { + /** + * List of user object matching the query. + */ + hits: SearchUserIdsResponseHits[]; + nbHits: Record; + /** + * Specify the page to retrieve. + */ + page: number; + /** + * Set the number of hits per page. + */ + hitsPerPage: number; + /** + * Date of last update (ISO-8601 format). + */ + updatedAt: Date; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponseHighlightResult.ts b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponseHighlightResult.ts new file mode 100644 index 00000000000..6f575186dfd --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponseHighlightResult.ts @@ -0,0 +1,6 @@ +import type { HighlightResult } from './highlightResult'; + +export type SearchUserIdsResponseHighlightResult = { + userID: HighlightResult; + clusterName: HighlightResult; +}; diff --git a/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponseHits.ts b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponseHits.ts new file mode 100644 index 00000000000..e97dd8c0a68 --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/searchUserIdsResponseHits.ts @@ -0,0 +1,23 @@ +import type { SearchUserIdsResponseHighlightResult } from './searchUserIdsResponseHighlightResult'; +import type { UserId } from './userId'; + +export type SearchUserIdsResponseHits = { + userID: UserId; + /** + * 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/client-search/model/synonymType.ts b/clients/algoliasearch-client-javascript/client-search/model/synonymType.ts deleted file mode 100644 index f6c10b8ee4d..00000000000 --- a/clients/algoliasearch-client-javascript/client-search/model/synonymType.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Type of the synonym object. - */ -export enum SynonymType { - Synonym = 'synonym', - Onewaysynonym = 'onewaysynonym', - Altcorrection1 = 'altcorrection1', - Altcorrection2 = 'altcorrection2', - Placeholder = 'placeholder', -} diff --git a/clients/algoliasearch-client-javascript/client-search/model/userId.ts b/clients/algoliasearch-client-javascript/client-search/model/userId.ts new file mode 100644 index 00000000000..a79a52f2bdd --- /dev/null +++ b/clients/algoliasearch-client-javascript/client-search/model/userId.ts @@ -0,0 +1,21 @@ +/** + * 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/client-search/src/searchApi.ts b/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts index 87d4ff7eba8..1f53782079a 100644 --- a/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts +++ b/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts @@ -1,5 +1,9 @@ import type { AddApiKeyResponse } from '../model/addApiKeyResponse'; import type { ApiKey } from '../model/apiKey'; +import type { AssignUserIdObject } from '../model/assignUserIdObject'; +import type { AssignUserIdResponse } from '../model/assignUserIdResponse'; +import type { BatchAssignUserIdsObject } from '../model/batchAssignUserIdsObject'; +import type { BatchAssignUserIdsResponse } from '../model/batchAssignUserIdsResponse'; import type { BatchObject } from '../model/batchObject'; import type { BatchResponse } from '../model/batchResponse'; import type { ClearAllSynonymsResponse } from '../model/clearAllSynonymsResponse'; @@ -8,15 +12,20 @@ import type { DeleteIndexResponse } from '../model/deleteIndexResponse'; import type { DeleteSynonymResponse } from '../model/deleteSynonymResponse'; import type { GetLogsResponse } from '../model/getLogsResponse'; import type { GetTaskResponse } from '../model/getTaskResponse'; +import type { GetTopUserIdsResponse } from '../model/getTopUserIdsResponse'; +import type { HasPendingMappingsResponse } from '../model/hasPendingMappingsResponse'; import type { IndexSettings } from '../model/indexSettings'; import type { KeyObject } from '../model/keyObject'; 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 { ApiKeyAuth } from '../model/models'; import type { MultipleQueriesObject } from '../model/multipleQueriesObject'; import type { MultipleQueriesResponse } from '../model/multipleQueriesResponse'; import type { OperationIndexObject } from '../model/operationIndexObject'; import type { OperationIndexResponse } from '../model/operationIndexResponse'; +import type { RemoveUserIdResponse } from '../model/removeUserIdResponse'; import type { SaveObjectResponse } from '../model/saveObjectResponse'; import type { SaveSynonymResponse } from '../model/saveSynonymResponse'; import type { SaveSynonymsResponse } from '../model/saveSynonymsResponse'; @@ -24,9 +33,12 @@ import type { SearchParams } from '../model/searchParams'; import type { SearchParamsAsString } from '../model/searchParamsAsString'; import type { SearchResponse } from '../model/searchResponse'; import type { SearchSynonymsResponse } from '../model/searchSynonymsResponse'; +import type { SearchUserIdsObject } from '../model/searchUserIdsObject'; +import type { SearchUserIdsResponse } from '../model/searchUserIdsResponse'; import type { SetSettingsResponse } from '../model/setSettingsResponse'; import type { SynonymHit } from '../model/synonymHit'; import type { UpdateApiKeyResponse } from '../model/updateApiKeyResponse'; +import type { UserId } from '../model/userId'; import { Transporter } from '../utils/Transporter'; import { shuffle } from '../utils/helpers'; import type { Requester } from '../utils/requester/Requester'; @@ -152,6 +164,50 @@ export class SearchApi { return this.sendRequest(request, 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 xAlgoliaUserID - UserID to assign. + * @param assignUserIdObject - The assignUserIdObject. + */ + assignUserId( + xAlgoliaUserID: Record, + assignUserIdObject: AssignUserIdObject + ): Promise { + const path = '/1/clusters/mapping'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (xAlgoliaUserID === null || xAlgoliaUserID === undefined) { + throw new Error( + 'Required parameter xAlgoliaUserID was null or undefined when calling assignUserId.' + ); + } + + if (assignUserIdObject === null || assignUserIdObject === undefined) { + throw new Error( + 'Required parameter assignUserIdObject was null or undefined when calling assignUserId.' + ); + } + + if (xAlgoliaUserID !== undefined) { + queryParameters['X-Algolia-User-ID'] = xAlgoliaUserID.toString(); + } + + const request: Request = { + method: 'POST', + path, + data: assignUserIdObject, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, requestOptions); + } /** * Performs multiple write operations in a single API call. * @@ -191,6 +247,53 @@ export class SearchApi { return this.sendRequest(request, 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 xAlgoliaUserID - UserID to assign. + * @param batchAssignUserIdsObject - The batchAssignUserIdsObject. + */ + batchAssignUserIds( + xAlgoliaUserID: Record, + batchAssignUserIdsObject: BatchAssignUserIdsObject + ): Promise { + const path = '/1/clusters/mapping/batch'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (xAlgoliaUserID === null || xAlgoliaUserID === undefined) { + throw new Error( + 'Required parameter xAlgoliaUserID was null or undefined when calling batchAssignUserIds.' + ); + } + + if ( + batchAssignUserIdsObject === null || + batchAssignUserIdsObject === undefined + ) { + throw new Error( + 'Required parameter batchAssignUserIdsObject was null or undefined when calling batchAssignUserIds.' + ); + } + + if (xAlgoliaUserID !== undefined) { + queryParameters['X-Algolia-User-ID'] = xAlgoliaUserID.toString(); + } + + const request: Request = { + method: 'POST', + path, + data: batchAssignUserIdsObject, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, requestOptions); + } /** * Remove all synonyms from an index. * @@ -526,6 +629,89 @@ export class SearchApi { return this.sendRequest(request, 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(): Promise { + const path = '/1/clusters/mapping/top'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + const request: Request = { + method: 'GET', + path, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, 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 userID - UserID to assign. + */ + getUserId(userID: Record): Promise { + const path = '/1/clusters/mapping/{userID}'.replace( + '{userID}', + encodeURIComponent(String(userID)) + ); + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (userID === null || userID === undefined) { + throw new Error( + 'Required parameter userID was null or undefined when calling getUserId.' + ); + } + + const request: Request = { + method: 'GET', + path, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, 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 getClusters - The getClusters. + */ + hasPendingMappings( + getClusters?: boolean + ): Promise { + const path = '/1/clusters/mapping/pending'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (getClusters !== undefined) { + queryParameters.getClusters = getClusters.toString(); + } + + const request: Request = { + method: 'GET', + path, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, requestOptions); + } /** * List API keys, along with their associated rights. * @@ -548,6 +734,28 @@ export class SearchApi { return this.sendRequest(request, 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(): Promise { + const path = '/1/clusters'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + const request: Request = { + method: 'GET', + path, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, requestOptions); + } /** * List existing indexes from an application. * @@ -575,6 +783,41 @@ export class SearchApi { return this.sendRequest(request, 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 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 hitsPerPage - Maximum number of objects to retrieve. + */ + listUserIds( + page?: number, + hitsPerPage?: number + ): Promise { + const path = '/1/clusters/mapping'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (page !== undefined) { + queryParameters.Page = page.toString(); + } + + if (hitsPerPage !== undefined) { + queryParameters.hitsPerPage = hitsPerPage.toString(); + } + + const request: Request = { + method: 'GET', + path, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, requestOptions); + } /** * Get search results for the given requests. * @@ -649,6 +892,38 @@ export class SearchApi { return this.sendRequest(request, 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 userID - UserID to assign. + */ + removeUserId(userID: Record): Promise { + const path = '/1/clusters/mapping/{userID}'.replace( + '{userID}', + encodeURIComponent(String(userID)) + ); + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (userID === null || userID === undefined) { + throw new Error( + 'Required parameter userID was null or undefined when calling removeUserId.' + ); + } + + const request: Request = { + method: 'DELETE', + path, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, requestOptions); + } /** * Restore a deleted API key, along with its associated rights. * @@ -943,6 +1218,38 @@ export class SearchApi { return this.sendRequest(request, 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 searchUserIdsObject - The searchUserIdsObject. + */ + searchUserIds( + searchUserIdsObject: SearchUserIdsObject + ): Promise { + const path = '/1/clusters/mapping/search'; + const headers: Headers = { Accept: 'application/json' }; + const queryParameters: Record = {}; + + if (searchUserIdsObject === null || searchUserIdsObject === undefined) { + throw new Error( + 'Required parameter searchUserIdsObject was null or undefined when calling searchUserIds.' + ); + } + + const request: Request = { + method: 'POST', + path, + data: searchUserIdsObject, + }; + + const requestOptions: RequestOptions = { + headers, + queryParameters, + }; + + return this.sendRequest(request, 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. * diff --git a/clients/algoliasearch-client-javascript/recommend/model/highlightResult.ts b/clients/algoliasearch-client-javascript/recommend/model/highlightResult.ts index 0946b038a96..e184f528caa 100644 --- a/clients/algoliasearch-client-javascript/recommend/model/highlightResult.ts +++ b/clients/algoliasearch-client-javascript/recommend/model/highlightResult.ts @@ -1,3 +1,6 @@ +/** + * Highlighted attributes. + */ export type HighlightResult = { /** * Markup text with occurrences highlighted. diff --git a/specs/common/parameters.yml b/specs/common/parameters.yml index 7b4c9bffd9d..9f51a80c214 100644 --- a/specs/common/parameters.yml +++ b/specs/common/parameters.yml @@ -117,7 +117,7 @@ updatedAt: format: date-time description: Date of last update (ISO-8601 format). -deleteAt: +deletedAt: type: string format: date-time description: Date of deletion (ISO-8601 format). diff --git a/specs/search/common/parameters.yml b/specs/search/common/parameters.yml new file mode 100644 index 00000000000..6b5b614570c --- /dev/null +++ b/specs/search/common/parameters.yml @@ -0,0 +1,31 @@ +# query +HitsPerPage: + name: hitsPerPage + description: Number of users to retrieve per page. + in: query + schema: + type: integer + description: Number of hits per page. + default: 20 + +UserIDInQuery: + name: X-Algolia-User-ID + description: userID to assign. + in: query + required: true + schema: + $ref: '#/userID' + +# path +UserIDInPath: + name: userID + description: userID to assign. + in: path + required: true + schema: + $ref: '#/userID' + +# misc +userID: + type: string + pattern: '^[a-zA-Z0-9 \-*.]+$' diff --git a/specs/search/common/schemas/Cluster.yml b/specs/search/common/schemas/Cluster.yml new file mode 100644 index 00000000000..0b6dca28045 --- /dev/null +++ b/specs/search/common/schemas/Cluster.yml @@ -0,0 +1,25 @@ +cluster: + type: object + description: A cluster. + properties: + clusterName: + type: string + description: Name of the cluster. + example: 'c11-test' + nbRecords: + type: integer + description: Number of records in the cluster. + example: 3 + nbUserIDs: + type: integer + description: Number of users assigned to the cluster. + example: 19 + dataSize: + type: integer + description: Data size taken by all the users assigned to the cluster. + example: 481 + required: + - clusterName + - nbRecords + - nbUserIDs + - dataSize diff --git a/specs/search/common/schemas/Record.yml b/specs/search/common/schemas/Record.yml index f11c0eb5cf5..184b3f7adf7 100644 --- a/specs/search/common/schemas/Record.yml +++ b/specs/search/common/schemas/Record.yml @@ -19,6 +19,7 @@ record: # Props highlightResult: type: object + description: Highlighted attributes. additionalProperties: false properties: value: diff --git a/specs/search/common/schemas/SearchResponse.yml b/specs/search/common/schemas/SearchResponse.yml index c4d7756e62c..141c550947e 100644 --- a/specs/search/common/schemas/SearchResponse.yml +++ b/specs/search/common/schemas/SearchResponse.yml @@ -14,7 +14,7 @@ searchHits: nbHits: type: integer - description: Number of hits that the search query matched + description: Number of hits that the search query matched. example: 20 baseSearchResponse: diff --git a/specs/search/common/schemas/UserId.yml b/specs/search/common/schemas/UserId.yml new file mode 100644 index 00000000000..e8bae554d77 --- /dev/null +++ b/specs/search/common/schemas/UserId.yml @@ -0,0 +1,26 @@ +userId: + title: userID + type: object + description: A userID. + properties: + userID: + type: string + description: userID of the user. + example: 'user1' + clusterName: + type: string + description: Cluster on which the user is assigned. + example: 'c1-test' + nbRecords: + type: integer + description: Number of records belonging to the user. + example: 42 + dataSize: + type: integer + description: Data size used by the user. + example: 0 + required: + - userID + - clusterName + - nbRecords + - dataSize diff --git a/specs/search/paths/keys/key.yml b/specs/search/paths/keys/key.yml index fe08d06dcdf..d36c3968db1 100644 --- a/specs/search/paths/keys/key.yml +++ b/specs/search/paths/keys/key.yml @@ -83,7 +83,7 @@ delete: - deletedAt properties: deletedAt: - $ref: '../../../common/parameters.yml#/deleteAt' + $ref: '../../../common/parameters.yml#/deletedAt' '400': $ref: '../../../common/responses/BadRequest.yml' '402': diff --git a/specs/search/paths/multiclusters/batchAssignUserIds.yml b/specs/search/paths/multiclusters/batchAssignUserIds.yml index 6adb517bf4f..43fe29d1fdb 100644 --- a/specs/search/paths/multiclusters/batchAssignUserIds.yml +++ b/specs/search/paths/multiclusters/batchAssignUserIds.yml @@ -1 +1,55 @@ post: + tags: + - search + operationId: batchAssignUserIds + summary: Batch assign userIDs + description: > + 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. + parameters: + - $ref: '../../common/parameters.yml#/UserIDInQuery' + requestBody: + required: true + content: + application/json: + schema: + title: batchAssignUserIdsObject + type: object + description: Assign userID object. + additionalProperties: false + properties: + cluster: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/clusterName' + users: + type: array + description: userIDs to assign. Note you cannot move users with this method. + items: + type: string + required: + - cluster + - users + responses: + '200': + description: OK + content: + application/json: + schema: + title: batchAssignUserIdsResponse + type: object + additionalProperties: false + properties: + createdAt: + $ref: '../../../common/parameters.yml#/createdAt' + required: + - createdAt + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/multiclusters/getTopUserIds.yml b/specs/search/paths/multiclusters/getTopUserIds.yml index 3ddb9d7f54d..cfa13852575 100644 --- a/specs/search/paths/multiclusters/getTopUserIds.yml +++ b/specs/search/paths/multiclusters/getTopUserIds.yml @@ -1 +1,40 @@ get: + tags: + - search + operationId: getTopUserIds + summary: Get top userID + description: > + 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. + responses: + '200': + description: OK + content: + application/json: + schema: + title: getTopUserIdsResponse + type: object + description: Array of userIDs and clusters. + properties: + topUsers: + type: array + description: Mapping of cluster names to top users. + items: + type: object + additionalProperties: + type: array + items: + $ref: '../../common/schemas/UserId.yml#/userId' + required: + - topUsers + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/multiclusters/hasPendingMappings.yml b/specs/search/paths/multiclusters/hasPendingMappings.yml index 3ddb9d7f54d..2d9a727139b 100644 --- a/specs/search/paths/multiclusters/hasPendingMappings.yml +++ b/specs/search/paths/multiclusters/hasPendingMappings.yml @@ -1 +1,40 @@ get: + tags: + - search + operationId: hasPendingMappings + summary: Has pending mappings + description: > + 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. + parameters: + - in: query + name: getClusters + schema: + type: boolean + responses: + '200': + description: OK + content: + application/json: + schema: + title: hasPendingMappingsResponse + type: object + additionalProperties: false + properties: + createdAt: + $ref: '../../../common/parameters.yml#/createdAt' + required: + - createdAt + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/multiclusters/listClusters.yml b/specs/search/paths/multiclusters/listClusters.yml index 3ddb9d7f54d..7c3e4279075 100644 --- a/specs/search/paths/multiclusters/listClusters.yml +++ b/specs/search/paths/multiclusters/listClusters.yml @@ -1 +1,34 @@ get: + tags: + - search + operationId: listClusters + summary: List clusters + description: > + 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. + responses: + '200': + description: OK + content: + application/json: + schema: + title: listClustersResponse + type: object + description: Array of clusters. + properties: + topUsers: + type: array + description: Mapping of cluster names to top users. + items: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/clusterName' + required: + - topUsers + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/multiclusters/searchUserIds.yml b/specs/search/paths/multiclusters/searchUserIds.yml index 6adb517bf4f..ba8d8aab88d 100644 --- a/specs/search/paths/multiclusters/searchUserIds.yml +++ b/specs/search/paths/multiclusters/searchUserIds.yml @@ -1 +1,100 @@ post: + tags: + - search + operationId: searchUserIds + summary: Search userID + description: > + 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. + requestBody: + required: true + content: + application/json: + schema: + title: searchUserIdsObject + type: object + description: OK + additionalProperties: false + properties: + query: + type: string + description: Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. + clusterName: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/clusterName' + page: + $ref: '../../common/schemas/SearchParams.yml#/baseSearchParams/properties/page' + hitsPerPage: + $ref: '../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/hitsPerPage' + required: + - query + responses: + '200': + description: OK + content: + application/json: + schema: + title: searchUserIdsResponse + type: object + description: userIDs data. + properties: + hits: + type: array + description: List of user object matching the query. + items: + type: object + properties: + userID: + $ref: '../../common/schemas/UserId.yml#/userId/properties/userID' + clusterName: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/clusterName' + nbRecords: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/nbRecords' + dataSize: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/dataSize' + objectID: + type: string + description: userID of the requested user. Same as userID. + _highlightResult: + type: object + properties: + userID: + $ref: '../../common/schemas/Record.yml#/highlightResult' + clusterName: + $ref: '../../common/schemas/Record.yml#/highlightResult' + required: + - userID + - clusterName + required: + - userID + - clusterName + - nbRecords + - dataSize + - objectID + - _highlightResult + nbHits: + $ref: '../../common/schemas/SearchResponse.yml#/baseSearchResponse/properties/nbHits' + page: + $ref: '../../common/schemas/SearchResponse.yml#/baseSearchResponse/properties/page' + hitsPerPage: + $ref: '../../common/schemas/SearchResponse.yml#/baseSearchResponse/properties/hitsPerPage' + updatedAt: + $ref: '../../../common/parameters.yml#/updatedAt' + required: + - hits + - nbHits + - page + - hitsPerPage + - updatedAt + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/multiclusters/userId.yml b/specs/search/paths/multiclusters/userId.yml index 4a951176922..0decb9d217d 100644 --- a/specs/search/paths/multiclusters/userId.yml +++ b/specs/search/paths/multiclusters/userId.yml @@ -1,2 +1,62 @@ get: + tags: + - search + operationId: getUserId + summary: Get userID + description: > + 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. + parameters: + - $ref: '../../common/parameters.yml#/UserIDInPath' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../common/schemas/UserId.yml#/userId' + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' + delete: + tags: + - search + operationId: removeUserId + summary: Remove userID + description: > + 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. + parameters: + - $ref: '../../common/parameters.yml#/UserIDInPath' + responses: + '200': + description: OK + content: + application/json: + schema: + title: removeUserIdResponse + type: object + additionalProperties: false + properties: + deletedAt: + $ref: '../../../common/parameters.yml#/deletedAt' + required: + - deletedAt + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/multiclusters/userIds.yml b/specs/search/paths/multiclusters/userIds.yml index 9791372547a..676cda44fca 100644 --- a/specs/search/paths/multiclusters/userIds.yml +++ b/specs/search/paths/multiclusters/userIds.yml @@ -1,2 +1,91 @@ post: + tags: + - search + operationId: assignUserId + summary: Assign or Move userID + description: > + 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. + parameters: + - $ref: '../../common/parameters.yml#/UserIDInQuery' + requestBody: + required: true + content: + application/json: + schema: + title: assignUserIdObject + type: object + description: Assign userID object. + additionalProperties: false + properties: + cluster: + $ref: '../../common/schemas/Cluster.yml#/cluster/properties/clusterName' + required: + - cluster + responses: + '200': + description: OK + content: + application/json: + schema: + title: assignUserIdResponse + type: object + additionalProperties: false + properties: + createdAt: + $ref: '../../../common/parameters.yml#/createdAt' + required: + - createdAt + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' + get: + tags: + - search + operationId: listUserIds + summary: List userIDs + description: > + 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. + parameters: + - $ref: '../../../common/parameters.yml#/Page' + - $ref: '../../../common/parameters.yml#/HitsPerPage' + responses: + '200': + description: OK + content: + application/json: + schema: + title: listUserIdsResponse + type: object + description: UserIDs data. + properties: + userIDs: + type: array + description: List of userIDs. + items: + $ref: '../../common/schemas/UserId.yml#/userId' + required: + - userIDs + '400': + $ref: '../../../common/responses/BadRequest.yml' + '402': + $ref: '../../../common/responses/FeatureNotEnabled.yml' + '403': + $ref: '../../../common/responses/MethodNotAllowed.yml' + '404': + $ref: '../../../common/responses/IndexNotFound.yml' diff --git a/specs/search/paths/objects/objects.yml b/specs/search/paths/objects/objects.yml index 4058193b6c3..95f5cacd199 100644 --- a/specs/search/paths/objects/objects.yml +++ b/specs/search/paths/objects/objects.yml @@ -58,8 +58,8 @@ delete: properties: taskID: $ref: '../../../common/parameters.yml#/taskID' - deleteAt: - $ref: '../../../common/parameters.yml#/deleteAt' + deletedAt: + $ref: '../../../common/parameters.yml#/deletedAt' '400': $ref: '../../../common/responses/BadRequest.yml' '402': diff --git a/specs/search/paths/synonyms/synonym.yml b/specs/search/paths/synonyms/synonym.yml index 88401016761..bd5a48fd077 100644 --- a/specs/search/paths/synonyms/synonym.yml +++ b/specs/search/paths/synonyms/synonym.yml @@ -91,7 +91,7 @@ delete: taskID: $ref: '../../../common/parameters.yml#/taskID' deletedAt: - $ref: '../../../common/parameters.yml#/deleteAt' + $ref: '../../../common/parameters.yml#/deletedAt' required: - taskID - deletedAt diff --git a/specs/search/spec.yml b/specs/search/spec.yml index ccdc79e9f90..da2be73e2f3 100644 --- a/specs/search/spec.yml +++ b/specs/search/spec.yml @@ -102,20 +102,20 @@ paths: # ############################### # ### MultiClusters Endpoints ### # ############################### - # /1/clusters/mapping: - # $ref: './paths/multiclusters/userIds.yml' - # /1/clusters/mapping/batch: - # $ref: './paths/multiclusters/batchAssignUserIds.yml' - # /1/clusters/mapping/top: - # $ref: './paths/multiclusters/getTopUserIds.yml' - # /1/clusters/mapping/{userID}: - # $ref: './paths/multiclusters/userId.yml' - # /1/clusters: - # $ref: './paths/multiclusters/listClusters.yml' - # /1/clusters/mapping/search: - # $ref: './paths/multiclusters/searchUserIds.yml' - # /1/clusters/mapping/pending: - # $ref: './paths/multiclusters/hasPendingMappings.yml' + /1/clusters/mapping: + $ref: './paths/multiclusters/userIds.yml' + /1/clusters/mapping/batch: + $ref: './paths/multiclusters/batchAssignUserIds.yml' + /1/clusters/mapping/top: + $ref: './paths/multiclusters/getTopUserIds.yml' + /1/clusters/mapping/{userID}: + $ref: './paths/multiclusters/userId.yml' + /1/clusters: + $ref: './paths/multiclusters/listClusters.yml' + /1/clusters/mapping/search: + $ref: './paths/multiclusters/searchUserIds.yml' + /1/clusters/mapping/pending: + $ref: './paths/multiclusters/hasPendingMappings.yml' # ####################### # ### Vault Endpoints ###