From 2d9c15744b086391b23b5673bc624473c106c5b5 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Thu, 19 May 2022 12:12:12 +0000 Subject: [PATCH] chore: generated code for commit 3b3d7067ef32fbd36cae4ff4bf2ffbc2ae488aac. [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Haroen Viaene Co-authored-by: Clément Vannicatte --- .../algolia/api/QuerySuggestionsClient.java | 40 +- .../java/com/algolia/api/SearchClient.java | 4 +- .../model/abtesting/AbTestsVariant.java | 2 +- .../abtesting/AbTestsVariantSearchParams.java | 2 +- .../com/algolia/model/abtesting/Variant.java | 2 +- .../QuerySuggestionsIndex.java | 8 +- .../SourceIndexWithReplicas.java | 250 ++++++++ .../querySuggestions/SuccessResponse.java | 84 +++ .../model/recommend/BaseSearchResponse.java | 2 +- .../recommend/RecommendationsResponse.java | 2 +- .../model/search/BaseSearchResponse.java | 2 +- .../algolia/model/search/BrowseResponse.java | 2 +- .../algolia/model/search/FetchedIndex.java | 306 ++++++++++ .../model/search/GetLogsResponseLogs.java | 4 +- .../model/search/ListIndicesResponse.java | 8 +- .../algolia/model/search/SearchResponse.java | 2 +- .../model/baseSearchResponse.ts | 2 +- .../algoliasearch-lite/model/fetchedIndex.ts | 46 ++ .../algoliasearch-lite/model/index.ts | 2 +- .../model/listIndicesResponse.ts | 4 +- .../client-abtesting/model/abTestsVariant.ts | 2 +- .../client-abtesting/model/variant.ts | 2 +- .../client-query-suggestions/model/index.ts | 4 +- .../model/querySuggestionsIndex.ts | 4 +- .../model/sourceIndexWithReplicas.ts | 39 ++ .../model/successResponse.ts | 10 + .../src/querySuggestionsClient.ts | 10 +- .../client-search/model/baseSearchResponse.ts | 2 +- .../client-search/model/fetchedIndex.ts | 46 ++ .../model/getLogsResponseLogs.ts | 4 +- .../packages/client-search/model/index.ts | 2 +- .../model/listIndicesResponse.ts | 4 +- .../client-search/src/searchClient.ts | 2 +- .../recommend/model/baseSearchResponse.ts | 2 +- .../lib/Api/QuerySuggestionsClient.php | 6 +- .../lib/Model/Abtesting/AbTestsVariant.php | 2 +- .../Abtesting/AbTestsVariantSearchParams.php | 2 +- .../lib/Model/Abtesting/AddABTestsVariant.php | 2 +- .../lib/Model/Abtesting/Variant.php | 2 +- .../QuerySuggestionsIndex.php | 6 +- .../SourceIndexWithReplicas.php | 477 +++++++++++++++ .../QuerySuggestions/SuccessResponse.php | 253 ++++++++ .../Model/Recommend/BaseSearchResponse.php | 2 +- .../Recommend/RecommendationsResponse.php | 2 +- .../lib/Model/Search/BaseSearchResponse.php | 2 +- .../lib/Model/Search/BrowseResponse.php | 2 +- .../lib/Model/Search/FetchedIndex.php | 569 ++++++++++++++++++ .../lib/Model/Search/GetLogsResponseLogs.php | 4 +- .../lib/Model/Search/ListIndicesResponse.php | 6 +- .../lib/Model/Search/SearchResponse.php | 2 +- specs/bundled/abtesting.yml | 2 +- specs/bundled/algoliasearch-lite.yml | 12 +- specs/bundled/query-suggestions.yml | 12 +- specs/bundled/recommend.yml | 2 +- specs/bundled/search.yml | 18 +- 55 files changed, 2186 insertions(+), 106 deletions(-) create mode 100644 clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SourceIndexWithReplicas.java create mode 100644 clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SuccessResponse.java create mode 100644 clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/FetchedIndex.java create mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/fetchedIndex.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexWithReplicas.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/successResponse.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-search/model/fetchedIndex.ts create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexWithReplicas.php create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SuccessResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Search/FetchedIndex.php diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java index f416e7de81..8ce50dc34c 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/QuerySuggestionsClient.java @@ -73,11 +73,11 @@ private static List getDefaultHosts(String region) { * @param querySuggestionsIndexWithIndexParam (required) * @param requestOptions The requestOptions to send along with the query, they will be merged with * the transporter requestOptions. - * @return SucessResponse + * @return SuccessResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ - public SucessResponse createConfig( + public SuccessResponse createConfig( QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam, RequestOptions requestOptions ) throws AlgoliaRuntimeException { @@ -86,7 +86,7 @@ public SucessResponse createConfig( ); } - public SucessResponse createConfig( + public SuccessResponse createConfig( QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam ) throws AlgoliaRuntimeException { return this.createConfig(querySuggestionsIndexWithIndexParam, null); @@ -103,7 +103,7 @@ public SucessResponse createConfig( * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture createConfigAsync( + public CompletableFuture createConfigAsync( QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam, RequestOptions requestOptions ) throws AlgoliaRuntimeException { @@ -131,11 +131,11 @@ public CompletableFuture createConfigAsync( headers, requestOptions ); - Type returnType = new TypeToken() {}.getType(); + Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } - public CompletableFuture createConfigAsync( + public CompletableFuture createConfigAsync( QuerySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam ) throws AlgoliaRuntimeException { return this.createConfigAsync(querySuggestionsIndexWithIndexParam, null); @@ -248,32 +248,32 @@ public CompletableFuture delAsync(String path) } /** - * Delete a configuration of a Query Suggestion's index. By deleting a configuraton, you stop all + * Delete a configuration of a Query Suggestion's index. By deleting a configuration, you stop all * updates to the underlying query suggestion index. Note that when doing this, the underlying * index does not change - existing suggestions remain untouched. * * @param indexName The index in which to perform the request. (required) * @param requestOptions The requestOptions to send along with the query, they will be merged with * the transporter requestOptions. - * @return SucessResponse + * @return SuccessResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ - public SucessResponse deleteConfig( + public SuccessResponse deleteConfig( String indexName, RequestOptions requestOptions ) throws AlgoliaRuntimeException { return LaunderThrowable.await(deleteConfigAsync(indexName, requestOptions)); } - public SucessResponse deleteConfig(String indexName) + public SuccessResponse deleteConfig(String indexName) throws AlgoliaRuntimeException { return this.deleteConfig(indexName, null); } /** * (asynchronously) Delete a configuration of a Query Suggestion's index. By deleting a - * configuraton, you stop all updates to the underlying query suggestion index. Note that when + * configuration, you stop all updates to the underlying query suggestion index. Note that when * doing this, the underlying index does not change - existing suggestions remain untouched. * * @param indexName The index in which to perform the request. (required) @@ -283,7 +283,7 @@ public SucessResponse deleteConfig(String indexName) * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture deleteConfigAsync( + public CompletableFuture deleteConfigAsync( String indexName, RequestOptions requestOptions ) throws AlgoliaRuntimeException { @@ -314,11 +314,11 @@ public CompletableFuture deleteConfigAsync( headers, requestOptions ); - Type returnType = new TypeToken() {}.getType(); + Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } - public CompletableFuture deleteConfigAsync(String indexName) + public CompletableFuture deleteConfigAsync(String indexName) throws AlgoliaRuntimeException { return this.deleteConfigAsync(indexName, null); } @@ -944,11 +944,11 @@ public CompletableFuture putAsync(String path) * @param querySuggestionsIndexParam (required) * @param requestOptions The requestOptions to send along with the query, they will be merged with * the transporter requestOptions. - * @return SucessResponse + * @return SuccessResponse * @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot * deserialize the response body */ - public SucessResponse updateConfig( + public SuccessResponse updateConfig( String indexName, QuerySuggestionsIndexParam querySuggestionsIndexParam, RequestOptions requestOptions @@ -958,7 +958,7 @@ public SucessResponse updateConfig( ); } - public SucessResponse updateConfig( + public SuccessResponse updateConfig( String indexName, QuerySuggestionsIndexParam querySuggestionsIndexParam ) throws AlgoliaRuntimeException { @@ -976,7 +976,7 @@ public SucessResponse updateConfig( * @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request * body object */ - public CompletableFuture updateConfigAsync( + public CompletableFuture updateConfigAsync( String indexName, QuerySuggestionsIndexParam querySuggestionsIndexParam, RequestOptions requestOptions @@ -1015,11 +1015,11 @@ public CompletableFuture updateConfigAsync( headers, requestOptions ); - Type returnType = new TypeToken() {}.getType(); + Type returnType = new TypeToken() {}.getType(); return this.executeAsync(call, returnType); } - public CompletableFuture updateConfigAsync( + public CompletableFuture updateConfigAsync( String indexName, QuerySuggestionsIndexParam querySuggestionsIndexParam ) throws AlgoliaRuntimeException { diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java index 48edbf7b2f..d5d5e1affe 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java @@ -3791,7 +3791,7 @@ public CompletableFuture multipleQueriesAsync( } /** - * Peforms a copy or a move operation on a index. + * Performs a copy or a move operation on a index. * * @param indexName The index in which to perform the request. (required) * @param operationIndexParams (required) @@ -3819,7 +3819,7 @@ public UpdatedAtResponse operationIndex( } /** - * (asynchronously) Peforms a copy or a move operation on a index. + * (asynchronously) Performs a copy or a move operation on a index. * * @param indexName The index in which to perform the request. (required) * @param operationIndexParams (required) diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariant.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariant.java index 85477d06df..d6ebff3dd6 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariant.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariant.java @@ -36,7 +36,7 @@ public AbTestsVariant setTrafficPercentage(Integer trafficPercentage) { } /** - * The traffic perfecentage for the A/B test. + * The traffic percentage for the A/B test. * * @return trafficPercentage */ diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariantSearchParams.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariantSearchParams.java index 47703e1a91..8efcfd668a 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariantSearchParams.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/AbTestsVariantSearchParams.java @@ -41,7 +41,7 @@ public AbTestsVariantSearchParams setTrafficPercentage( } /** - * The traffic perfecentage for the A/B test. + * The traffic percentage for the A/B test. * * @return trafficPercentage */ diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/Variant.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/Variant.java index bbd035f488..d94a26698e 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/Variant.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/abtesting/Variant.java @@ -198,7 +198,7 @@ public Variant setTrafficPercentage(Integer trafficPercentage) { } /** - * The traffic perfecentage for the A/B test. + * The traffic percentage for the A/B test. * * @return trafficPercentage */ diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/QuerySuggestionsIndex.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/QuerySuggestionsIndex.java index 0116ef22b4..6531a40413 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/QuerySuggestionsIndex.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/QuerySuggestionsIndex.java @@ -12,7 +12,7 @@ public class QuerySuggestionsIndex { private String indexName; @SerializedName("sourceIndices") - private List sourceIndices = new ArrayList<>(); + private List sourceIndices = new ArrayList<>(); @SerializedName("languages") private List languages = new ArrayList<>(); @@ -36,14 +36,14 @@ public String getIndexName() { } public QuerySuggestionsIndex setSourceIndices( - List sourceIndices + List sourceIndices ) { this.sourceIndices = sourceIndices; return this; } public QuerySuggestionsIndex addSourceIndices( - SourceIndiceWithReplicas sourceIndicesItem + SourceIndexWithReplicas sourceIndicesItem ) { this.sourceIndices.add(sourceIndicesItem); return this; @@ -55,7 +55,7 @@ public QuerySuggestionsIndex addSourceIndices( * @return sourceIndices */ @javax.annotation.Nonnull - public List getSourceIndices() { + public List getSourceIndices() { return sourceIndices; } diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SourceIndexWithReplicas.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SourceIndexWithReplicas.java new file mode 100644 index 0000000000..8ffa2e998c --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SourceIndexWithReplicas.java @@ -0,0 +1,250 @@ +package com.algolia.model.querySuggestions; + +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Source index with replicas used to generate a Query Suggestions index. */ +public class SourceIndexWithReplicas { + + @SerializedName("replicas") + private Boolean replicas; + + @SerializedName("indexName") + private String indexName; + + @SerializedName("analyticsTags") + private List analyticsTags = new ArrayList<>(); + + @SerializedName("facets") + private List facets = new ArrayList<>(); + + @SerializedName("minHits") + private Integer minHits; + + @SerializedName("minLetters") + private Integer minLetters; + + @SerializedName("generate") + private List> generate = new ArrayList<>(); + + @SerializedName("external") + private List external = new ArrayList<>(); + + public SourceIndexWithReplicas setReplicas(Boolean replicas) { + this.replicas = replicas; + return this; + } + + /** + * true if the Query Suggestions index is a replicas. + * + * @return replicas + */ + @javax.annotation.Nonnull + public Boolean getReplicas() { + return replicas; + } + + public SourceIndexWithReplicas setIndexName(String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Source index name. + * + * @return indexName + */ + @javax.annotation.Nonnull + public String getIndexName() { + return indexName; + } + + public SourceIndexWithReplicas setAnalyticsTags(List analyticsTags) { + this.analyticsTags = analyticsTags; + return this; + } + + public SourceIndexWithReplicas addAnalyticsTags(String analyticsTagsItem) { + this.analyticsTags.add(analyticsTagsItem); + return this; + } + + /** + * List of analytics tags to filter the popular searches per tag. + * + * @return analyticsTags + */ + @javax.annotation.Nonnull + public List getAnalyticsTags() { + return analyticsTags; + } + + public SourceIndexWithReplicas setFacets(List facets) { + this.facets = facets; + return this; + } + + public SourceIndexWithReplicas addFacets(Object facetsItem) { + this.facets.add(facetsItem); + return this; + } + + /** + * List of facets to define as categories for the query suggestions. + * + * @return facets + */ + @javax.annotation.Nonnull + public List getFacets() { + return facets; + } + + public SourceIndexWithReplicas setMinHits(Integer minHits) { + this.minHits = minHits; + return this; + } + + /** + * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. + * + * @return minHits + */ + @javax.annotation.Nonnull + public Integer getMinHits() { + return minHits; + } + + public SourceIndexWithReplicas setMinLetters(Integer minLetters) { + this.minLetters = minLetters; + return this; + } + + /** + * Minimum number of required letters for a suggestion to remain. + * + * @return minLetters + */ + @javax.annotation.Nonnull + public Integer getMinLetters() { + return minLetters; + } + + public SourceIndexWithReplicas setGenerate(List> generate) { + this.generate = generate; + return this; + } + + public SourceIndexWithReplicas addGenerate(List generateItem) { + this.generate.add(generateItem); + return this; + } + + /** + * List of facet attributes used to generate Query Suggestions. The resulting suggestions are + * every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). + * + * @return generate + */ + @javax.annotation.Nonnull + public List> getGenerate() { + return generate; + } + + public SourceIndexWithReplicas setExternal( + List external + ) { + this.external = external; + return this; + } + + public SourceIndexWithReplicas addExternal(SourceIndexExternal externalItem) { + this.external.add(externalItem); + return this; + } + + /** + * List of external indices to use to generate custom Query Suggestions. + * + * @return external + */ + @javax.annotation.Nonnull + public List getExternal() { + return external; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SourceIndexWithReplicas sourceIndexWithReplicas = (SourceIndexWithReplicas) o; + return ( + Objects.equals(this.replicas, sourceIndexWithReplicas.replicas) && + Objects.equals(this.indexName, sourceIndexWithReplicas.indexName) && + Objects.equals( + this.analyticsTags, + sourceIndexWithReplicas.analyticsTags + ) && + Objects.equals(this.facets, sourceIndexWithReplicas.facets) && + Objects.equals(this.minHits, sourceIndexWithReplicas.minHits) && + Objects.equals(this.minLetters, sourceIndexWithReplicas.minLetters) && + Objects.equals(this.generate, sourceIndexWithReplicas.generate) && + Objects.equals(this.external, sourceIndexWithReplicas.external) + ); + } + + @Override + public int hashCode() { + return Objects.hash( + replicas, + indexName, + analyticsTags, + facets, + minHits, + minLetters, + generate, + external + ); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SourceIndexWithReplicas {\n"); + sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); + sb + .append(" indexName: ") + .append(toIndentedString(indexName)) + .append("\n"); + sb + .append(" analyticsTags: ") + .append(toIndentedString(analyticsTags)) + .append("\n"); + sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); + sb.append(" minHits: ").append(toIndentedString(minHits)).append("\n"); + sb + .append(" minLetters: ") + .append(toIndentedString(minLetters)) + .append("\n"); + sb.append(" generate: ").append(toIndentedString(generate)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).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/src/main/java/com/algolia/model/querySuggestions/SuccessResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SuccessResponse.java new file mode 100644 index 0000000000..d4406d6fe6 --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/querySuggestions/SuccessResponse.java @@ -0,0 +1,84 @@ +package com.algolia.model.querySuggestions; + +import com.google.gson.annotations.SerializedName; +import java.util.Objects; + +/** SuccessResponse */ +public class SuccessResponse { + + @SerializedName("status") + private Integer status; + + @SerializedName("message") + private String message; + + public SuccessResponse setStatus(Integer status) { + this.status = status; + return this; + } + + /** + * The status code. + * + * @return status + */ + @javax.annotation.Nonnull + public Integer getStatus() { + return status; + } + + public SuccessResponse setMessage(String message) { + this.message = message; + return this; + } + + /** + * Message of the response. + * + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SuccessResponse successResponse = (SuccessResponse) o; + return ( + Objects.equals(this.status, successResponse.status) && + Objects.equals(this.message, successResponse.message) + ); + } + + @Override + public int hashCode() { + return Objects.hash(status, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SuccessResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/BaseSearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/BaseSearchResponse.java index a4b0a5f102..0f3c1cc2e9 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/BaseSearchResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/BaseSearchResponse.java @@ -181,7 +181,7 @@ public BaseSearchResponse setExhaustiveTypo(Boolean exhaustiveTypo) { } /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when * typo-tolerance is enabled). * * @return exhaustiveTypo diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/RecommendationsResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/RecommendationsResponse.java index 514c885c98..db79ec3ea4 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/RecommendationsResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/RecommendationsResponse.java @@ -186,7 +186,7 @@ public RecommendationsResponse setExhaustiveTypo(Boolean exhaustiveTypo) { } /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when * typo-tolerance is enabled). * * @return exhaustiveTypo diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BaseSearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BaseSearchResponse.java index a412593cea..21ac3d3387 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BaseSearchResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BaseSearchResponse.java @@ -181,7 +181,7 @@ public BaseSearchResponse setExhaustiveTypo(Boolean exhaustiveTypo) { } /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when * typo-tolerance is enabled). * * @return exhaustiveTypo diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BrowseResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BrowseResponse.java index 90777e165a..7413bda8e3 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BrowseResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BrowseResponse.java @@ -189,7 +189,7 @@ public BrowseResponse setExhaustiveTypo(Boolean exhaustiveTypo) { } /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when * typo-tolerance is enabled). * * @return exhaustiveTypo diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/FetchedIndex.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/FetchedIndex.java new file mode 100644 index 0000000000..ed7229881f --- /dev/null +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/FetchedIndex.java @@ -0,0 +1,306 @@ +package com.algolia.model.search; + +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** FetchedIndex */ +public class FetchedIndex { + + @SerializedName("name") + private String name; + + @SerializedName("createdAt") + private String createdAt; + + @SerializedName("updatedAt") + private String updatedAt; + + @SerializedName("entries") + private Integer entries; + + @SerializedName("dataSize") + private Integer dataSize; + + @SerializedName("fileSize") + private Integer fileSize; + + @SerializedName("lastBuildTimeS") + private Integer lastBuildTimeS; + + @SerializedName("numberOfPendingTask") + private Integer numberOfPendingTask; + + @SerializedName("pendingTask") + private Boolean pendingTask; + + @SerializedName("primary") + private String primary; + + @SerializedName("replicas") + private List replicas = null; + + public FetchedIndex setName(String name) { + this.name = name; + return this; + } + + /** + * Index name. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public FetchedIndex setCreatedAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Index creation date. An empty string means that the index has no records. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public FetchedIndex setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update (ISO-8601 format). + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public FetchedIndex setEntries(Integer entries) { + this.entries = entries; + return this; + } + + /** + * Number of records contained in the index. + * + * @return entries + */ + @javax.annotation.Nonnull + public Integer getEntries() { + return entries; + } + + public FetchedIndex setDataSize(Integer dataSize) { + this.dataSize = dataSize; + return this; + } + + /** + * Number of bytes of the index in minified format. + * + * @return dataSize + */ + @javax.annotation.Nonnull + public Integer getDataSize() { + return dataSize; + } + + public FetchedIndex setFileSize(Integer fileSize) { + this.fileSize = fileSize; + return this; + } + + /** + * Number of bytes of the index binary file. + * + * @return fileSize + */ + @javax.annotation.Nonnull + public Integer getFileSize() { + return fileSize; + } + + public FetchedIndex setLastBuildTimeS(Integer lastBuildTimeS) { + this.lastBuildTimeS = lastBuildTimeS; + return this; + } + + /** + * Last build time. + * + * @return lastBuildTimeS + */ + @javax.annotation.Nonnull + public Integer getLastBuildTimeS() { + return lastBuildTimeS; + } + + public FetchedIndex setNumberOfPendingTask(Integer numberOfPendingTask) { + this.numberOfPendingTask = numberOfPendingTask; + return this; + } + + /** + * Number of pending indexing operations. This value is deprecated and should not be used. + * + * @return numberOfPendingTask + */ + @javax.annotation.Nullable + public Integer getNumberOfPendingTask() { + return numberOfPendingTask; + } + + public FetchedIndex setPendingTask(Boolean pendingTask) { + this.pendingTask = pendingTask; + return this; + } + + /** + * A boolean which says whether the index has pending tasks. This value is deprecated and should + * not be used. + * + * @return pendingTask + */ + @javax.annotation.Nonnull + public Boolean getPendingTask() { + return pendingTask; + } + + public FetchedIndex setPrimary(String primary) { + this.primary = primary; + return this; + } + + /** + * Only present if the index is a replica. Contains the name of the related primary index. + * + * @return primary + */ + @javax.annotation.Nullable + public String getPrimary() { + return primary; + } + + public FetchedIndex setReplicas(List replicas) { + this.replicas = replicas; + return this; + } + + public FetchedIndex addReplicas(String replicasItem) { + if (this.replicas == null) { + this.replicas = new ArrayList<>(); + } + this.replicas.add(replicasItem); + return this; + } + + /** + * Only present if the index is a primary index with replicas. Contains the names of all linked + * replicas. + * + * @return replicas + */ + @javax.annotation.Nullable + public List getReplicas() { + return replicas; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FetchedIndex fetchedIndex = (FetchedIndex) o; + return ( + Objects.equals(this.name, fetchedIndex.name) && + Objects.equals(this.createdAt, fetchedIndex.createdAt) && + Objects.equals(this.updatedAt, fetchedIndex.updatedAt) && + Objects.equals(this.entries, fetchedIndex.entries) && + Objects.equals(this.dataSize, fetchedIndex.dataSize) && + Objects.equals(this.fileSize, fetchedIndex.fileSize) && + Objects.equals(this.lastBuildTimeS, fetchedIndex.lastBuildTimeS) && + Objects.equals( + this.numberOfPendingTask, + fetchedIndex.numberOfPendingTask + ) && + Objects.equals(this.pendingTask, fetchedIndex.pendingTask) && + Objects.equals(this.primary, fetchedIndex.primary) && + Objects.equals(this.replicas, fetchedIndex.replicas) + ); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + createdAt, + updatedAt, + entries, + dataSize, + fileSize, + lastBuildTimeS, + numberOfPendingTask, + pendingTask, + primary, + replicas + ); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchedIndex {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb + .append(" createdAt: ") + .append(toIndentedString(createdAt)) + .append("\n"); + sb + .append(" updatedAt: ") + .append(toIndentedString(updatedAt)) + .append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" dataSize: ").append(toIndentedString(dataSize)).append("\n"); + sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n"); + sb + .append(" lastBuildTimeS: ") + .append(toIndentedString(lastBuildTimeS)) + .append("\n"); + sb + .append(" numberOfPendingTask: ") + .append(toIndentedString(numberOfPendingTask)) + .append("\n"); + sb + .append(" pendingTask: ") + .append(toIndentedString(pendingTask)) + .append("\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/GetLogsResponseLogs.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/GetLogsResponseLogs.java index eaaa706a5c..2def92c743 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/GetLogsResponseLogs.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/GetLogsResponseLogs.java @@ -74,7 +74,7 @@ public GetLogsResponseLogs setMethod(String method) { } /** - * HTTP method of the perfomed request. + * HTTP method of the performed request. * * @return method */ @@ -149,7 +149,7 @@ public GetLogsResponseLogs setIp(String ip) { } /** - * IP of the client which perfomed the request. + * IP of the client which performed the request. * * @return ip */ diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/ListIndicesResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/ListIndicesResponse.java index cb0a7f5e7d..65eacf9ae7 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/ListIndicesResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/ListIndicesResponse.java @@ -9,17 +9,17 @@ public class ListIndicesResponse { @SerializedName("items") - private List items = null; + private List items = null; @SerializedName("nbPages") private Integer nbPages; - public ListIndicesResponse setItems(List items) { + public ListIndicesResponse setItems(List items) { this.items = items; return this; } - public ListIndicesResponse addItems(Indice itemsItem) { + public ListIndicesResponse addItems(FetchedIndex itemsItem) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -33,7 +33,7 @@ public ListIndicesResponse addItems(Indice itemsItem) { * @return items */ @javax.annotation.Nullable - public List getItems() { + public List getItems() { return items; } diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchResponse.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchResponse.java index 3d7b40bae2..b7f7e1fa84 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchResponse.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchResponse.java @@ -186,7 +186,7 @@ public SearchResponse setExhaustiveTypo(Boolean exhaustiveTypo) { } /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when * typo-tolerance is enabled). * * @return exhaustiveTypo diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/baseSearchResponse.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/baseSearchResponse.ts index 358556c692..f20f0f5aed 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/baseSearchResponse.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/baseSearchResponse.ts @@ -26,7 +26,7 @@ export type BaseSearchResponse = { */ exhaustiveNbHits: boolean; /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled). + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled). */ exhaustiveTypo: boolean; /** diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/fetchedIndex.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/fetchedIndex.ts new file mode 100644 index 0000000000..07a3eb779c --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/fetchedIndex.ts @@ -0,0 +1,46 @@ +export type FetchedIndex = { + /** + * Index name. + */ + name: string; + /** + * Index creation date. An empty string means that the index has no records. + */ + createdAt: string; + /** + * Date of last update (ISO-8601 format). + */ + updatedAt: string; + /** + * Number of records contained in the index. + */ + entries: number; + /** + * Number of bytes of the index in minified format. + */ + dataSize: number; + /** + * Number of bytes of the index binary file. + */ + fileSize: number; + /** + * Last build time. + */ + lastBuildTimeS: number; + /** + * Number of pending indexing operations. This value is deprecated and should not be used. + */ + numberOfPendingTask?: number; + /** + * A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. + */ + pendingTask: boolean; + /** + * Only present if the index is a replica. Contains the name of the related primary index. + */ + primary?: string; + /** + * Only present if the index is a primary index with replicas. Contains the names of all linked replicas. + */ + replicas?: string[]; +}; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/index.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/index.ts index a89f2f216d..942b52d54e 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/index.ts @@ -30,11 +30,11 @@ export * from './dictionaryType'; export * from './errorBase'; export * from './exactOnSingleWordQuery'; export * from './facetFilters'; +export * from './fetchedIndex'; export * from './highlightResult'; export * from './hit'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; -export * from './indice'; export * from './key'; export * from './languages'; export * from './listIndicesResponse'; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/listIndicesResponse.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/listIndicesResponse.ts index c89d4922ff..68c673c97c 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/listIndicesResponse.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/listIndicesResponse.ts @@ -1,10 +1,10 @@ -import type { Indice } from './indice'; +import type { FetchedIndex } from './fetchedIndex'; export type ListIndicesResponse = { /** * List of the fetched indices. */ - items?: Indice[]; + items?: FetchedIndex[]; /** * Number of pages. */ diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts index 5100fec263..c38ac95b45 100644 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts +++ b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/abTestsVariant.ts @@ -4,7 +4,7 @@ export type AbTestsVariant = { */ index: string; /** - * The traffic perfecentage for the A/B test. + * The traffic percentage for the A/B test. */ trafficPercentage: number; /** diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts index 3328858f2b..056decec21 100644 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts +++ b/clients/algoliasearch-client-javascript/packages/client-abtesting/model/variant.ts @@ -40,7 +40,7 @@ export type Variant = { */ trackedSearchCount: number; /** - * The traffic perfecentage for the A/B test. + * The traffic percentage for the A/B test. */ trafficPercentage: number; /** diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/index.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/index.ts index 4887f5e58e..3693285ad4 100644 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/index.ts @@ -7,6 +7,6 @@ export * from './querySuggestionsIndexParam'; export * from './querySuggestionsIndexWithIndexParam'; export * from './sourceIndex'; export * from './sourceIndexExternal'; -export * from './sourceIndiceWithReplicas'; +export * from './sourceIndexWithReplicas'; export * from './status'; -export * from './sucessResponse'; +export * from './successResponse'; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts index 74ce2d5475..7169be6b83 100644 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/querySuggestionsIndex.ts @@ -1,4 +1,4 @@ -import type { SourceIndiceWithReplicas } from './sourceIndiceWithReplicas'; +import type { SourceIndexWithReplicas } from './sourceIndexWithReplicas'; export type QuerySuggestionsIndex = { /** @@ -8,7 +8,7 @@ export type QuerySuggestionsIndex = { /** * List of source indices used to generate a Query Suggestions index. */ - sourceIndices: SourceIndiceWithReplicas[]; + sourceIndices: SourceIndexWithReplicas[]; /** * De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. */ diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexWithReplicas.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexWithReplicas.ts new file mode 100644 index 0000000000..b5336c97f3 --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndexWithReplicas.ts @@ -0,0 +1,39 @@ +import type { SourceIndexExternal } from './sourceIndexExternal'; + +/** + * Source index with replicas used to generate a Query Suggestions index. + */ +export type SourceIndexWithReplicas = { + /** + * True if the Query Suggestions index is a replicas. + */ + replicas: boolean; + /** + * Source index name. + */ + indexName: string; + /** + * List of analytics tags to filter the popular searches per tag. + */ + analyticsTags: string[]; + /** + * List of facets to define as categories for the query suggestions. + */ + facets: Array>; + /** + * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. + */ + minHits: number; + /** + * Minimum number of required letters for a suggestion to remain. + */ + minLetters: number; + /** + * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). + */ + generate: string[][]; + /** + * List of external indices to use to generate custom Query Suggestions. + */ + external: SourceIndexExternal[]; +}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/successResponse.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/successResponse.ts new file mode 100644 index 0000000000..cc3386b3f1 --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/successResponse.ts @@ -0,0 +1,10 @@ +export type SuccessResponse = { + /** + * The status code. + */ + status: number; + /** + * Message of the response. + */ + message: string; +}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts index 644d8ea905..9ed433e5c0 100644 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts @@ -17,7 +17,7 @@ import type { QuerySuggestionsIndex } from '../model/querySuggestionsIndex'; import type { QuerySuggestionsIndexParam } from '../model/querySuggestionsIndexParam'; import type { QuerySuggestionsIndexWithIndexParam } from '../model/querySuggestionsIndexWithIndexParam'; import type { Status } from '../model/status'; -import type { SucessResponse } from '../model/sucessResponse'; +import type { SuccessResponse } from '../model/successResponse'; export * from '../model'; export const apiClientVersion = '0.2.0'; @@ -73,7 +73,7 @@ export function createQuerySuggestionsClient( createConfig( querySuggestionsIndexWithIndexParam: QuerySuggestionsIndexWithIndexParam, requestOptions?: RequestOptions - ): Promise { + ): Promise { if (!querySuggestionsIndexWithIndexParam) { throw new Error( 'Parameter `querySuggestionsIndexWithIndexParam` is required when calling `createConfig`.' @@ -137,7 +137,7 @@ export function createQuerySuggestionsClient( }, /** - * Delete a configuration of a Query Suggestion\'s index. By deleting a configuraton, you stop all updates to the underlying query suggestion index. Note that when doing this, the underlying index does not change - existing suggestions remain untouched. + * Delete a configuration of a Query Suggestion\'s index. By deleting a configuration, you stop all updates to the underlying query suggestion index. Note that when doing this, the underlying index does not change - existing suggestions remain untouched. * * @summary Delete a configuration. * @param deleteConfig - The deleteConfig object. @@ -147,7 +147,7 @@ export function createQuerySuggestionsClient( deleteConfig( { indexName }: DeleteConfigProps, requestOptions?: RequestOptions - ): Promise { + ): Promise { if (!indexName) { throw new Error( 'Parameter `indexName` is required when calling `deleteConfig`.' @@ -448,7 +448,7 @@ export function createQuerySuggestionsClient( updateConfig( { indexName, querySuggestionsIndexParam }: UpdateConfigProps, requestOptions?: RequestOptions - ): Promise { + ): Promise { if (!indexName) { throw new Error( 'Parameter `indexName` is required when calling `updateConfig`.' diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts index 358556c692..f20f0f5aed 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts @@ -26,7 +26,7 @@ export type BaseSearchResponse = { */ exhaustiveNbHits: boolean; /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled). + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled). */ exhaustiveTypo: boolean; /** diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/fetchedIndex.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/fetchedIndex.ts new file mode 100644 index 0000000000..07a3eb779c --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/fetchedIndex.ts @@ -0,0 +1,46 @@ +export type FetchedIndex = { + /** + * Index name. + */ + name: string; + /** + * Index creation date. An empty string means that the index has no records. + */ + createdAt: string; + /** + * Date of last update (ISO-8601 format). + */ + updatedAt: string; + /** + * Number of records contained in the index. + */ + entries: number; + /** + * Number of bytes of the index in minified format. + */ + dataSize: number; + /** + * Number of bytes of the index binary file. + */ + fileSize: number; + /** + * Last build time. + */ + lastBuildTimeS: number; + /** + * Number of pending indexing operations. This value is deprecated and should not be used. + */ + numberOfPendingTask?: number; + /** + * A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. + */ + pendingTask: boolean; + /** + * Only present if the index is a replica. Contains the name of the related primary index. + */ + primary?: string; + /** + * Only present if the index is a primary index with replicas. Contains the names of all linked replicas. + */ + replicas?: string[]; +}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts index 67ec3593a7..14f0c93eb0 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/getLogsResponseLogs.ts @@ -6,7 +6,7 @@ export type GetLogsResponseLogs = { */ timestamp: string; /** - * HTTP method of the perfomed request. + * HTTP method of the performed request. */ method: string; /** @@ -26,7 +26,7 @@ export type GetLogsResponseLogs = { */ url: string; /** - * IP of the client which perfomed the request. + * IP of the client which performed the request. */ ip: string; /** diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts index 5f77472e90..b24160123e 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts @@ -44,6 +44,7 @@ export * from './dictionaryType'; export * from './errorBase'; export * from './exactOnSingleWordQuery'; export * from './facetFilters'; +export * from './fetchedIndex'; export * from './getDictionarySettingsResponse'; export * from './getLogsResponse'; export * from './getLogsResponseInnerQueries'; @@ -56,7 +57,6 @@ export * from './highlightResult'; export * from './hit'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; -export * from './indice'; export * from './key'; export * from './languages'; export * from './listApiKeysResponse'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts index c89d4922ff..68c673c97c 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/listIndicesResponse.ts @@ -1,10 +1,10 @@ -import type { Indice } from './indice'; +import type { FetchedIndex } from './fetchedIndex'; export type ListIndicesResponse = { /** * List of the fetched indices. */ - items?: Indice[]; + items?: FetchedIndex[]; /** * Number of pages. */ diff --git a/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts b/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts index f1bc045582..f1cc635401 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts @@ -1866,7 +1866,7 @@ export function createSearchClient(options: CreateClientOptions) { }, /** - * Peforms a copy or a move operation on a index. + * Performs a copy or a move operation on a index. * * @summary Copy/move index. * @param operationIndex - The operationIndex object. diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts index 358556c692..f20f0f5aed 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/baseSearchResponse.ts @@ -26,7 +26,7 @@ export type BaseSearchResponse = { */ exhaustiveNbHits: boolean; /** - * Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled). + * Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled). */ exhaustiveTypo: boolean; /** diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php index 05dd21507a..d5d9d2231a 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php @@ -107,7 +107,7 @@ public function getClientConfig() * * @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions * - * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SuccessResponse */ public function createConfig( $querySuggestionsIndexWithIndexParam, @@ -191,7 +191,7 @@ public function del($path, $parameters = null, $requestOptions = []) * @param string $indexName The index in which to perform the request. (required) * @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions * - * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SuccessResponse */ public function deleteConfig($indexName, $requestOptions = []) { @@ -542,7 +542,7 @@ public function put( * * @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions * - * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SuccessResponse */ public function updateConfig( $indexName, diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php index e93783b7ce..addb47a627 100644 --- a/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php @@ -195,7 +195,7 @@ public function getTrafficPercentage() /** * Sets trafficPercentage * - * @param int $trafficPercentage the traffic perfecentage for the A/B test + * @param int $trafficPercentage the traffic percentage for the A/B test * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php index b0e9591e2e..0a3498ed89 100644 --- a/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php @@ -209,7 +209,7 @@ public function getTrafficPercentage() /** * Sets trafficPercentage * - * @param int $trafficPercentage the traffic perfecentage for the A/B test + * @param int $trafficPercentage the traffic percentage for the A/B test * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php index 11092c3251..201f2d3f2d 100644 --- a/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php @@ -209,7 +209,7 @@ public function getTrafficPercentage() /** * Sets trafficPercentage * - * @param int $trafficPercentage the traffic perfecentage for the A/B test + * @param int $trafficPercentage the traffic percentage for the A/B test * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/Variant.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/Variant.php index bcf3ea44d4..492b7880a3 100644 --- a/clients/algoliasearch-client-php/lib/Model/Abtesting/Variant.php +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/Variant.php @@ -536,7 +536,7 @@ public function getTrafficPercentage() /** * Sets trafficPercentage * - * @param int $trafficPercentage the traffic perfecentage for the A/B test + * @param int $trafficPercentage the traffic percentage for the A/B test * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndex.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndex.php index 269ad6e719..764d9a39bc 100644 --- a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndex.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndex.php @@ -20,7 +20,7 @@ class QuerySuggestionsIndex extends \Algolia\AlgoliaSearch\Model\AbstractModel i */ protected static $modelTypes = [ 'indexName' => 'string', - 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[]', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexWithReplicas[]', 'languages' => 'string[]', 'exclude' => 'string[]', ]; @@ -204,7 +204,7 @@ public function setIndexName($indexName) /** * Gets sourceIndices * - * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[] + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexWithReplicas[] */ public function getSourceIndices() { @@ -214,7 +214,7 @@ public function getSourceIndices() /** * Sets sourceIndices * - * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexWithReplicas.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexWithReplicas.php new file mode 100644 index 0000000000..f539340fd1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexWithReplicas.php @@ -0,0 +1,477 @@ + 'bool', + 'indexName' => 'string', + 'analyticsTags' => 'string[]', + 'facets' => 'object[]', + 'minHits' => 'int', + 'minLetters' => 'int', + 'generate' => 'string[][]', + 'external' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'replicas' => null, + 'indexName' => null, + 'analyticsTags' => null, + 'facets' => null, + 'minHits' => null, + 'minLetters' => null, + 'generate' => null, + 'external' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'replicas' => 'setReplicas', + 'indexName' => 'setIndexName', + 'analyticsTags' => 'setAnalyticsTags', + 'facets' => 'setFacets', + 'minHits' => 'setMinHits', + 'minLetters' => 'setMinLetters', + 'generate' => 'setGenerate', + 'external' => 'setExternal', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'replicas' => 'getReplicas', + 'indexName' => 'getIndexName', + 'analyticsTags' => 'getAnalyticsTags', + 'facets' => 'getFacets', + 'minHits' => 'getMinHits', + 'minLetters' => 'getMinLetters', + 'generate' => 'getGenerate', + 'external' => 'getExternal', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['replicas'])) { + $this->container['replicas'] = $data['replicas']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['analyticsTags'])) { + $this->container['analyticsTags'] = $data['analyticsTags']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['minHits'])) { + $this->container['minHits'] = $data['minHits']; + } + if (isset($data['minLetters'])) { + $this->container['minLetters'] = $data['minLetters']; + } + if (isset($data['generate'])) { + $this->container['generate'] = $data['generate']; + } + if (isset($data['external'])) { + $this->container['external'] = $data['external']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ( + !isset($this->container['replicas']) || + $this->container['replicas'] === null + ) { + $invalidProperties[] = "'replicas' can't be null"; + } + if ( + !isset($this->container['indexName']) || + $this->container['indexName'] === null + ) { + $invalidProperties[] = "'indexName' can't be null"; + } + if ( + !isset($this->container['analyticsTags']) || + $this->container['analyticsTags'] === null + ) { + $invalidProperties[] = "'analyticsTags' can't be null"; + } + if ( + !isset($this->container['facets']) || + $this->container['facets'] === null + ) { + $invalidProperties[] = "'facets' can't be null"; + } + if ( + !isset($this->container['minHits']) || + $this->container['minHits'] === null + ) { + $invalidProperties[] = "'minHits' can't be null"; + } + if ( + !isset($this->container['minLetters']) || + $this->container['minLetters'] === null + ) { + $invalidProperties[] = "'minLetters' can't be null"; + } + if ( + !isset($this->container['generate']) || + $this->container['generate'] === null + ) { + $invalidProperties[] = "'generate' can't be null"; + } + if ( + !isset($this->container['external']) || + $this->container['external'] === null + ) { + $invalidProperties[] = "'external' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets replicas + * + * @return bool + */ + public function getReplicas() + { + return $this->container['replicas'] ?? null; + } + + /** + * Sets replicas + * + * @param bool $replicas true if the Query Suggestions index is a replicas + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName source index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[] + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[] $analyticsTags list of analytics tags to filter the popular searches per tag + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets facets + * + * @return object[] + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param object[] $facets list of facets to define as categories for the query suggestions + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets minHits + * + * @return int + */ + public function getMinHits() + { + return $this->container['minHits'] ?? null; + } + + /** + * Sets minHits + * + * @param int $minHits Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. + * + * @return self + */ + public function setMinHits($minHits) + { + $this->container['minHits'] = $minHits; + + return $this; + } + + /** + * Gets minLetters + * + * @return int + */ + public function getMinLetters() + { + return $this->container['minLetters'] ?? null; + } + + /** + * Sets minLetters + * + * @param int $minLetters minimum number of required letters for a suggestion to remain + * + * @return self + */ + public function setMinLetters($minLetters) + { + $this->container['minLetters'] = $minLetters; + + return $this; + } + + /** + * Gets generate + * + * @return string[][] + */ + public function getGenerate() + { + return $this->container['generate'] ?? null; + } + + /** + * Sets generate + * + * @param string[][] $generate List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). + * + * @return self + */ + public function setGenerate($generate) + { + $this->container['generate'] = $generate; + + return $this; + } + + /** + * Gets external + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] + */ + public function getExternal() + { + return $this->container['external'] ?? null; + } + + /** + * Sets external + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] $external list of external indices to use to generate custom Query Suggestions + * + * @return self + */ + public function setExternal($external) + { + $this->container['external'] = $external; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SuccessResponse.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SuccessResponse.php new file mode 100644 index 0000000000..ed9bcc306c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SuccessResponse.php @@ -0,0 +1,253 @@ + 'int', + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'status' => null, + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['status'])) { + $this->container['status'] = $data['status']; + } + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ( + !isset($this->container['status']) || + $this->container['status'] === null + ) { + $invalidProperties[] = "'status' can't be null"; + } + if ( + !isset($this->container['message']) || + $this->container['message'] === null + ) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status'] ?? null; + } + + /** + * Sets status + * + * @param int $status the status code + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string $message message of the response + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php index 2c53abfb6f..04292513a4 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php @@ -528,7 +528,7 @@ public function getExhaustiveTypo() /** * Sets exhaustiveTypo * - * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * @param bool $exhaustiveTypo indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php index ec5302c6b3..ca4a3197cd 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php @@ -541,7 +541,7 @@ public function getExhaustiveTypo() /** * Sets exhaustiveTypo * - * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * @param bool $exhaustiveTypo indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php index ab33c037c7..66ccbd278a 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php @@ -528,7 +528,7 @@ public function getExhaustiveTypo() /** * Sets exhaustiveTypo * - * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * @param bool $exhaustiveTypo indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php index 8ba660bad1..f84dedb158 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php @@ -554,7 +554,7 @@ public function getExhaustiveTypo() /** * Sets exhaustiveTypo * - * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * @param bool $exhaustiveTypo indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/FetchedIndex.php b/clients/algoliasearch-client-php/lib/Model/Search/FetchedIndex.php new file mode 100644 index 0000000000..f8b2089be3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/FetchedIndex.php @@ -0,0 +1,569 @@ + 'string', + 'createdAt' => 'string', + 'updatedAt' => 'string', + 'entries' => 'int', + 'dataSize' => 'int', + 'fileSize' => 'int', + 'lastBuildTimeS' => 'int', + 'numberOfPendingTask' => 'int', + 'pendingTask' => 'bool', + 'primary' => 'string', + 'replicas' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'name' => null, + 'createdAt' => null, + 'updatedAt' => null, + 'entries' => null, + 'dataSize' => null, + 'fileSize' => null, + 'lastBuildTimeS' => null, + 'numberOfPendingTask' => null, + 'pendingTask' => null, + 'primary' => null, + 'replicas' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'createdAt' => 'setCreatedAt', + 'updatedAt' => 'setUpdatedAt', + 'entries' => 'setEntries', + 'dataSize' => 'setDataSize', + 'fileSize' => 'setFileSize', + 'lastBuildTimeS' => 'setLastBuildTimeS', + 'numberOfPendingTask' => 'setNumberOfPendingTask', + 'pendingTask' => 'setPendingTask', + 'primary' => 'setPrimary', + 'replicas' => 'setReplicas', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'createdAt' => 'getCreatedAt', + 'updatedAt' => 'getUpdatedAt', + 'entries' => 'getEntries', + 'dataSize' => 'getDataSize', + 'fileSize' => 'getFileSize', + 'lastBuildTimeS' => 'getLastBuildTimeS', + 'numberOfPendingTask' => 'getNumberOfPendingTask', + 'pendingTask' => 'getPendingTask', + 'primary' => 'getPrimary', + 'replicas' => 'getReplicas', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['name'])) { + $this->container['name'] = $data['name']; + } + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + if (isset($data['entries'])) { + $this->container['entries'] = $data['entries']; + } + if (isset($data['dataSize'])) { + $this->container['dataSize'] = $data['dataSize']; + } + if (isset($data['fileSize'])) { + $this->container['fileSize'] = $data['fileSize']; + } + if (isset($data['lastBuildTimeS'])) { + $this->container['lastBuildTimeS'] = $data['lastBuildTimeS']; + } + if (isset($data['numberOfPendingTask'])) { + $this->container['numberOfPendingTask'] = + $data['numberOfPendingTask']; + } + if (isset($data['pendingTask'])) { + $this->container['pendingTask'] = $data['pendingTask']; + } + if (isset($data['primary'])) { + $this->container['primary'] = $data['primary']; + } + if (isset($data['replicas'])) { + $this->container['replicas'] = $data['replicas']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ( + !isset($this->container['name']) || + $this->container['name'] === null + ) { + $invalidProperties[] = "'name' can't be null"; + } + if ( + !isset($this->container['createdAt']) || + $this->container['createdAt'] === null + ) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ( + !isset($this->container['updatedAt']) || + $this->container['updatedAt'] === null + ) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if ( + !isset($this->container['entries']) || + $this->container['entries'] === null + ) { + $invalidProperties[] = "'entries' can't be null"; + } + if ( + !isset($this->container['dataSize']) || + $this->container['dataSize'] === null + ) { + $invalidProperties[] = "'dataSize' can't be null"; + } + if ( + !isset($this->container['fileSize']) || + $this->container['fileSize'] === null + ) { + $invalidProperties[] = "'fileSize' can't be null"; + } + if ( + !isset($this->container['lastBuildTimeS']) || + $this->container['lastBuildTimeS'] === null + ) { + $invalidProperties[] = "'lastBuildTimeS' can't be null"; + } + if ( + !isset($this->container['pendingTask']) || + $this->container['pendingTask'] === null + ) { + $invalidProperties[] = "'pendingTask' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name'] ?? null; + } + + /** + * Sets name + * + * @param string $name index name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt Index creation date. An empty string means that the index has no records. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets entries + * + * @return int + */ + public function getEntries() + { + return $this->container['entries'] ?? null; + } + + /** + * Sets entries + * + * @param int $entries number of records contained in the index + * + * @return self + */ + public function setEntries($entries) + { + $this->container['entries'] = $entries; + + return $this; + } + + /** + * Gets dataSize + * + * @return int + */ + public function getDataSize() + { + return $this->container['dataSize'] ?? null; + } + + /** + * Sets dataSize + * + * @param int $dataSize number of bytes of the index in minified format + * + * @return self + */ + public function setDataSize($dataSize) + { + $this->container['dataSize'] = $dataSize; + + return $this; + } + + /** + * Gets fileSize + * + * @return int + */ + public function getFileSize() + { + return $this->container['fileSize'] ?? null; + } + + /** + * Sets fileSize + * + * @param int $fileSize number of bytes of the index binary file + * + * @return self + */ + public function setFileSize($fileSize) + { + $this->container['fileSize'] = $fileSize; + + return $this; + } + + /** + * Gets lastBuildTimeS + * + * @return int + */ + public function getLastBuildTimeS() + { + return $this->container['lastBuildTimeS'] ?? null; + } + + /** + * Sets lastBuildTimeS + * + * @param int $lastBuildTimeS last build time + * + * @return self + */ + public function setLastBuildTimeS($lastBuildTimeS) + { + $this->container['lastBuildTimeS'] = $lastBuildTimeS; + + return $this; + } + + /** + * Gets numberOfPendingTask + * + * @return int|null + */ + public function getNumberOfPendingTask() + { + return $this->container['numberOfPendingTask'] ?? null; + } + + /** + * Sets numberOfPendingTask + * + * @param int|null $numberOfPendingTask Number of pending indexing operations. This value is deprecated and should not be used. + * + * @return self + */ + public function setNumberOfPendingTask($numberOfPendingTask) + { + $this->container['numberOfPendingTask'] = $numberOfPendingTask; + + return $this; + } + + /** + * Gets pendingTask + * + * @return bool + */ + public function getPendingTask() + { + return $this->container['pendingTask'] ?? null; + } + + /** + * Sets pendingTask + * + * @param bool $pendingTask A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. + * + * @return self + */ + public function setPendingTask($pendingTask) + { + $this->container['pendingTask'] = $pendingTask; + + return $this; + } + + /** + * Gets primary + * + * @return string|null + */ + public function getPrimary() + { + return $this->container['primary'] ?? null; + } + + /** + * Sets primary + * + * @param string|null $primary Only present if the index is a replica. Contains the name of the related primary index. + * + * @return self + */ + public function setPrimary($primary) + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets replicas + * + * @return string[]|null + */ + public function getReplicas() + { + return $this->container['replicas'] ?? null; + } + + /** + * Sets replicas + * + * @param string[]|null $replicas Only present if the index is a primary index with replicas. Contains the names of all linked replicas. + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php index 421006a916..afd0b0a718 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php @@ -330,7 +330,7 @@ public function getMethod() /** * Sets method * - * @param string $method HTTP method of the perfomed request + * @param string $method HTTP method of the performed request * * @return self */ @@ -450,7 +450,7 @@ public function getIp() /** * Sets ip * - * @param string $ip IP of the client which perfomed the request + * @param string $ip IP of the client which performed the request * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php index 86c779a777..7fbd18e201 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php @@ -19,7 +19,7 @@ class ListIndicesResponse extends \Algolia\AlgoliaSearch\Model\AbstractModel imp * @var string[] */ protected static $modelTypes = [ - 'items' => '\Algolia\AlgoliaSearch\Model\Search\Indice[]', + 'items' => '\Algolia\AlgoliaSearch\Model\Search\FetchedIndex[]', 'nbPages' => 'int', ]; @@ -141,7 +141,7 @@ public function valid() /** * Gets items * - * @return \Algolia\AlgoliaSearch\Model\Search\Indice[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\FetchedIndex[]|null */ public function getItems() { @@ -151,7 +151,7 @@ public function getItems() /** * Sets items * - * @param \Algolia\AlgoliaSearch\Model\Search\Indice[]|null $items list of the fetched indices + * @param \Algolia\AlgoliaSearch\Model\Search\FetchedIndex[]|null $items list of the fetched indices * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php index 9d1cd4362d..a5cec95047 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php @@ -541,7 +541,7 @@ public function getExhaustiveTypo() /** * Sets exhaustiveTypo * - * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * @param bool $exhaustiveTypo indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled) * * @return self */ diff --git a/specs/bundled/abtesting.yml b/specs/bundled/abtesting.yml index b4fdcbedb9..3ac673b88d 100644 --- a/specs/bundled/abtesting.yml +++ b/specs/bundled/abtesting.yml @@ -87,7 +87,7 @@ components: description: The number of tracked search click. trafficPercentage: type: integer - description: The traffic perfecentage for the A/B test. + description: The traffic percentage for the A/B test. variant: type: object additionalProperties: false diff --git a/specs/bundled/algoliasearch-lite.yml b/specs/bundled/algoliasearch-lite.yml index 76a1331944..e4223ed7b4 100644 --- a/specs/bundled/algoliasearch-lite.yml +++ b/specs/bundled/algoliasearch-lite.yml @@ -771,7 +771,7 @@ components: exhaustiveTypo: type: boolean description: >- - Indicate if the typo-tolerence search was exhaustive or approximate + Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled). facets: type: object @@ -1760,7 +1760,7 @@ components: - settings - synonyms - rules - indice: + fetchedIndex: type: object additionalProperties: false properties: @@ -1825,7 +1825,7 @@ components: type: array description: List of the fetched indices. items: - $ref: '#/components/schemas/indice' + $ref: '#/components/schemas/fetchedIndex' nbPages: type: integer description: Number of pages. @@ -1952,8 +1952,8 @@ tags: description: Manage your Api Keys. - name: Clusters description: Clusters operations. - - name: Dictionnaries - description: Dictionnaries operations. + - name: Dictionaries + description: Dictionaries operations. - name: Indices description: Manage indices. - name: Records @@ -1980,7 +1980,7 @@ x-tagGroups: tags: - Rules - Synonyms - - Dictionnaries + - Dictionaries - name: Others tags: - Api Keys diff --git a/specs/bundled/query-suggestions.yml b/specs/bundled/query-suggestions.yml index 7b788469bf..322e924c10 100644 --- a/specs/bundled/query-suggestions.yml +++ b/specs/bundled/query-suggestions.yml @@ -101,10 +101,10 @@ components: items: $ref: '#/components/schemas/SourceIndexExternal' description: List of external indices to use to generate custom Query Suggestions. - SourceIndiceWithReplicas: + SourceIndexWithReplicas: type: object additionalProperties: false - description: Source indice with replicas used to generate a Query Suggestions index. + description: Source index with replicas used to generate a Query Suggestions index. required: - replicas - indexName @@ -136,7 +136,7 @@ components: type: array description: List of source indices used to generate a Query Suggestions index. items: - $ref: '#/components/schemas/SourceIndiceWithReplicas' + $ref: '#/components/schemas/SourceIndexWithReplicas' QuerySuggestionsIndex: type: object additionalProperties: false @@ -286,7 +286,7 @@ components: application/json: schema: type: object - title: SucessResponse + title: SuccessResponse additionalProperties: false required: - status @@ -545,8 +545,8 @@ paths: description: > Delete a configuration of a Query Suggestion's index. - By deleting a configuraton, you stop all updates to the underlying query - suggestion index. + By deleting a configuration, you stop all updates to the underlying + query suggestion index. Note that when doing this, the underlying index does not change - existing suggestions remain untouched. diff --git a/specs/bundled/recommend.yml b/specs/bundled/recommend.yml index 34a50f2028..10328a1c3f 100644 --- a/specs/bundled/recommend.yml +++ b/specs/bundled/recommend.yml @@ -723,7 +723,7 @@ components: exhaustiveTypo: type: boolean description: >- - Indicate if the typo-tolerence search was exhaustive or approximate + Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled). facets: type: object diff --git a/specs/bundled/search.yml b/specs/bundled/search.yml index 2053eb4ce4..27278c1c6f 100644 --- a/specs/bundled/search.yml +++ b/specs/bundled/search.yml @@ -771,7 +771,7 @@ components: exhaustiveTypo: type: boolean description: >- - Indicate if the typo-tolerence search was exhaustive or approximate + Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled). facets: type: object @@ -1760,7 +1760,7 @@ components: - settings - synonyms - rules - indice: + fetchedIndex: type: object additionalProperties: false properties: @@ -1825,7 +1825,7 @@ components: type: array description: List of the fetched indices. items: - $ref: '#/components/schemas/indice' + $ref: '#/components/schemas/fetchedIndex' nbPages: type: integer description: Number of pages. @@ -1952,8 +1952,8 @@ tags: description: Manage your Api Keys. - name: Clusters description: Clusters operations. - - name: Dictionnaries - description: Dictionnaries operations. + - name: Dictionaries + description: Dictionaries operations. - name: Indices description: Manage indices. - name: Records @@ -1980,7 +1980,7 @@ x-tagGroups: tags: - Rules - Synonyms - - Dictionnaries + - Dictionaries - name: Others tags: - Api Keys @@ -4150,7 +4150,7 @@ paths: description: Timestamp in ISO-8601 format. method: type: string - description: HTTP method of the perfomed request. + description: HTTP method of the performed request. answer_code: type: string description: HTTP response code. @@ -4165,7 +4165,7 @@ paths: description: Request URL. ip: type: string - description: IP of the client which perfomed the request. + description: IP of the client which performed the request. query_headers: type: string description: Request Headers (API Key is obfuscated). @@ -4271,7 +4271,7 @@ paths: - search operationId: operationIndex summary: Copy/move index. - description: Peforms a copy or a move operation on a index. + description: Performs a copy or a move operation on a index. parameters: - $ref: '#/components/parameters/IndexName' requestBody: