Skip to content

Commit 7b96d39

Browse files
chore: generated code for commit 6bdc94f. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 6bdc94f commit 7b96d39

File tree

30 files changed

+167
-121
lines changed

30 files changed

+167
-121
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5443,7 +5443,7 @@ public CompletableFuture<SearchRulesResponse> searchRulesAsync(String indexName,
54435443
* Perform a search operation targeting one specific index.
54445444
*
54455445
* @param indexName The index in which to perform the request. (required)
5446-
* @param searchParams (required)
5446+
* @param searchParams (optional)
54475447
* @param innerType The class held by the index, could be your custom class or {@link Object}
54485448
* @param requestOptions The requestOptions to send along with the query, they will be merged with
54495449
* the transporter requestOptions.
@@ -5463,7 +5463,7 @@ public <T> SearchResponse<T> searchSingleIndex(
54635463
* Perform a search operation targeting one specific index.
54645464
*
54655465
* @param indexName The index in which to perform the request. (required)
5466-
* @param searchParams (required)
5466+
* @param searchParams (optional)
54675467
* @param innerType The class held by the index, could be your custom class or {@link Object}
54685468
* @return <T> SearchResponse<T>
54695469
* @throws AlgoliaRuntimeException If it fails to process the API call
@@ -5473,11 +5473,38 @@ public <T> SearchResponse<T> searchSingleIndex(String indexName, SearchParams se
54735473
return this.searchSingleIndex(indexName, searchParams, innerType, null);
54745474
}
54755475

5476+
/**
5477+
* Perform a search operation targeting one specific index.
5478+
*
5479+
* @param indexName The index in which to perform the request. (required)
5480+
* @param innerType The class held by the index, could be your custom class or {@link Object}
5481+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
5482+
* the transporter requestOptions.
5483+
* @return <T> SearchResponse<T>
5484+
* @throws AlgoliaRuntimeException If it fails to process the API call
5485+
*/
5486+
public <T> SearchResponse<T> searchSingleIndex(String indexName, Class<T> innerType, RequestOptions requestOptions)
5487+
throws AlgoliaRuntimeException {
5488+
return this.searchSingleIndex(indexName, null, innerType, requestOptions);
5489+
}
5490+
5491+
/**
5492+
* Perform a search operation targeting one specific index.
5493+
*
5494+
* @param indexName The index in which to perform the request. (required)
5495+
* @param innerType The class held by the index, could be your custom class or {@link Object}
5496+
* @return <T> SearchResponse<T>
5497+
* @throws AlgoliaRuntimeException If it fails to process the API call
5498+
*/
5499+
public <T> SearchResponse<T> searchSingleIndex(String indexName, Class<T> innerType) throws AlgoliaRuntimeException {
5500+
return this.searchSingleIndex(indexName, null, innerType, null);
5501+
}
5502+
54765503
/**
54775504
* (asynchronously) Perform a search operation targeting one specific index.
54785505
*
54795506
* @param indexName The index in which to perform the request. (required)
5480-
* @param searchParams (required)
5507+
* @param searchParams (optional)
54815508
* @param innerType The class held by the index, could be your custom class or {@link Object}
54825509
* @param requestOptions The requestOptions to send along with the query, they will be merged with
54835510
* the transporter requestOptions.
@@ -5494,11 +5521,7 @@ public <T> CompletableFuture<SearchResponse<T>> searchSingleIndexAsync(
54945521
throw new AlgoliaRuntimeException("Parameter `indexName` is required when calling `searchSingleIndex`.");
54955522
}
54965523

5497-
if (searchParams == null) {
5498-
throw new AlgoliaRuntimeException("Parameter `searchParams` is required when calling `searchSingleIndex`.");
5499-
}
5500-
5501-
Object bodyObj = searchParams;
5524+
Object bodyObj = searchParams != null ? searchParams : new Object();
55025525

55035526
// create path and map variables
55045527
String requestPath = "/1/indexes/{indexName}/query".replaceAll("\\{indexName\\}", this.escapeString(indexName.toString()));
@@ -5514,7 +5537,7 @@ public <T> CompletableFuture<SearchResponse<T>> searchSingleIndexAsync(
55145537
* (asynchronously) Perform a search operation targeting one specific index.
55155538
*
55165539
* @param indexName The index in which to perform the request. (required)
5517-
* @param searchParams (required)
5540+
* @param searchParams (optional)
55185541
* @param innerType The class held by the index, could be your custom class or {@link Object}
55195542
* @return <T> CompletableFuture<SearchResponse<T>> The awaitable future
55205543
* @throws AlgoliaRuntimeException If it fails to process the API call
@@ -5524,6 +5547,37 @@ public <T> CompletableFuture<SearchResponse<T>> searchSingleIndexAsync(String in
55245547
return this.searchSingleIndexAsync(indexName, searchParams, innerType, null);
55255548
}
55265549

5550+
/**
5551+
* (asynchronously) Perform a search operation targeting one specific index.
5552+
*
5553+
* @param indexName The index in which to perform the request. (required)
5554+
* @param innerType The class held by the index, could be your custom class or {@link Object}
5555+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
5556+
* the transporter requestOptions.
5557+
* @return <T> CompletableFuture<SearchResponse<T>> The awaitable future
5558+
* @throws AlgoliaRuntimeException If it fails to process the API call
5559+
*/
5560+
public <T> CompletableFuture<SearchResponse<T>> searchSingleIndexAsync(
5561+
String indexName,
5562+
Class<T> innerType,
5563+
RequestOptions requestOptions
5564+
) throws AlgoliaRuntimeException {
5565+
return this.searchSingleIndexAsync(indexName, null, innerType, requestOptions);
5566+
}
5567+
5568+
/**
5569+
* (asynchronously) Perform a search operation targeting one specific index.
5570+
*
5571+
* @param indexName The index in which to perform the request. (required)
5572+
* @param innerType The class held by the index, could be your custom class or {@link Object}
5573+
* @return <T> CompletableFuture<SearchResponse<T>> The awaitable future
5574+
* @throws AlgoliaRuntimeException If it fails to process the API call
5575+
*/
5576+
public <T> CompletableFuture<SearchResponse<T>> searchSingleIndexAsync(String indexName, Class<T> innerType)
5577+
throws AlgoliaRuntimeException {
5578+
return this.searchSingleIndexAsync(indexName, null, innerType, null);
5579+
}
5580+
55275581
/**
55285582
* Search or browse all synonyms, optionally filtering them by type.
55295583
*

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/BaseSearchResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class BaseSearchResponse {
3333
private Boolean exhaustiveTypo;
3434

3535
@JsonProperty("facets")
36-
private Map<String, Map<String, String>> facets;
36+
private Map<String, Map<String, Integer>> facets;
3737

3838
@JsonProperty("facets_stats")
3939
private Map<String, FacetsStats> facetsStats;
@@ -109,7 +109,7 @@ public BaseSearchResponse setAbTestVariantID(Integer abTestVariantID) {
109109

110110
/**
111111
* If a search encounters an index that is being A/B tested, abTestVariantID reports the variant
112-
* ID of the index used.
112+
* ID of the index used (starting at 1).
113113
*
114114
* @return abTestVariantID
115115
*/
@@ -195,12 +195,12 @@ public Boolean getExhaustiveTypo() {
195195
return exhaustiveTypo;
196196
}
197197

198-
public BaseSearchResponse setFacets(Map<String, Map<String, String>> facets) {
198+
public BaseSearchResponse setFacets(Map<String, Map<String, Integer>> facets) {
199199
this.facets = facets;
200200
return this;
201201
}
202202

203-
public BaseSearchResponse putFacets(String key, Map<String, String> facetsItem) {
203+
public BaseSearchResponse putFacets(String key, Map<String, Integer> facetsItem) {
204204
if (this.facets == null) {
205205
this.facets = new HashMap<>();
206206
}
@@ -214,7 +214,7 @@ public BaseSearchResponse putFacets(String key, Map<String, String> facetsItem)
214214
* @return facets
215215
*/
216216
@javax.annotation.Nullable
217-
public Map<String, Map<String, String>> getFacets() {
217+
public Map<String, Map<String, Integer>> getFacets() {
218218
return facets;
219219
}
220220

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/RecommendHits.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@
1212
public class RecommendHits {
1313

1414
@JsonProperty("hits")
15-
private List<RecommendHit> hits;
15+
private List<RecommendHit> hits = new ArrayList<>();
1616

1717
public RecommendHits setHits(List<RecommendHit> hits) {
1818
this.hits = hits;
1919
return this;
2020
}
2121

2222
public RecommendHits addHits(RecommendHit hitsItem) {
23-
if (this.hits == null) {
24-
this.hits = new ArrayList<>();
25-
}
2623
this.hits.add(hitsItem);
2724
return this;
2825
}
@@ -32,7 +29,7 @@ public RecommendHits addHits(RecommendHit hitsItem) {
3229
*
3330
* @return hits
3431
*/
35-
@javax.annotation.Nullable
32+
@javax.annotation.Nonnull
3633
public List<RecommendHit> getHits() {
3734
return hits;
3835
}

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/RecommendationsResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class RecommendationsResponse {
3535
private Boolean exhaustiveTypo;
3636

3737
@JsonProperty("facets")
38-
private Map<String, Map<String, String>> facets;
38+
private Map<String, Map<String, Integer>> facets;
3939

4040
@JsonProperty("facets_stats")
4141
private Map<String, FacetsStats> facetsStats;
@@ -114,7 +114,7 @@ public RecommendationsResponse setAbTestVariantID(Integer abTestVariantID) {
114114

115115
/**
116116
* If a search encounters an index that is being A/B tested, abTestVariantID reports the variant
117-
* ID of the index used.
117+
* ID of the index used (starting at 1).
118118
*
119119
* @return abTestVariantID
120120
*/
@@ -200,12 +200,12 @@ public Boolean getExhaustiveTypo() {
200200
return exhaustiveTypo;
201201
}
202202

203-
public RecommendationsResponse setFacets(Map<String, Map<String, String>> facets) {
203+
public RecommendationsResponse setFacets(Map<String, Map<String, Integer>> facets) {
204204
this.facets = facets;
205205
return this;
206206
}
207207

208-
public RecommendationsResponse putFacets(String key, Map<String, String> facetsItem) {
208+
public RecommendationsResponse putFacets(String key, Map<String, Integer> facetsItem) {
209209
if (this.facets == null) {
210210
this.facets = new HashMap<>();
211211
}
@@ -219,7 +219,7 @@ public RecommendationsResponse putFacets(String key, Map<String, String> facetsI
219219
* @return facets
220220
*/
221221
@javax.annotation.Nullable
222-
public Map<String, Map<String, String>> getFacets() {
222+
public Map<String, Map<String, Integer>> getFacets() {
223223
return facets;
224224
}
225225

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BaseSearchResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class BaseSearchResponse {
3333
private Boolean exhaustiveTypo;
3434

3535
@JsonProperty("facets")
36-
private Map<String, Map<String, String>> facets;
36+
private Map<String, Map<String, Integer>> facets;
3737

3838
@JsonProperty("facets_stats")
3939
private Map<String, FacetsStats> facetsStats;
@@ -109,7 +109,7 @@ public BaseSearchResponse setAbTestVariantID(Integer abTestVariantID) {
109109

110110
/**
111111
* If a search encounters an index that is being A/B tested, abTestVariantID reports the variant
112-
* ID of the index used.
112+
* ID of the index used (starting at 1).
113113
*
114114
* @return abTestVariantID
115115
*/
@@ -195,12 +195,12 @@ public Boolean getExhaustiveTypo() {
195195
return exhaustiveTypo;
196196
}
197197

198-
public BaseSearchResponse setFacets(Map<String, Map<String, String>> facets) {
198+
public BaseSearchResponse setFacets(Map<String, Map<String, Integer>> facets) {
199199
this.facets = facets;
200200
return this;
201201
}
202202

203-
public BaseSearchResponse putFacets(String key, Map<String, String> facetsItem) {
203+
public BaseSearchResponse putFacets(String key, Map<String, Integer> facetsItem) {
204204
if (this.facets == null) {
205205
this.facets = new HashMap<>();
206206
}
@@ -214,7 +214,7 @@ public BaseSearchResponse putFacets(String key, Map<String, String> facetsItem)
214214
* @return facets
215215
*/
216216
@javax.annotation.Nullable
217-
public Map<String, Map<String, String>> getFacets() {
217+
public Map<String, Map<String, Integer>> getFacets() {
218218
return facets;
219219
}
220220

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BrowseResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class BrowseResponse<T> {
3535
private Boolean exhaustiveTypo;
3636

3737
@JsonProperty("facets")
38-
private Map<String, Map<String, String>> facets;
38+
private Map<String, Map<String, Integer>> facets;
3939

4040
@JsonProperty("facets_stats")
4141
private Map<String, FacetsStats> facetsStats;
@@ -117,7 +117,7 @@ public BrowseResponse setAbTestVariantID(Integer abTestVariantID) {
117117

118118
/**
119119
* If a search encounters an index that is being A/B tested, abTestVariantID reports the variant
120-
* ID of the index used.
120+
* ID of the index used (starting at 1).
121121
*
122122
* @return abTestVariantID
123123
*/
@@ -203,12 +203,12 @@ public Boolean getExhaustiveTypo() {
203203
return exhaustiveTypo;
204204
}
205205

206-
public BrowseResponse setFacets(Map<String, Map<String, String>> facets) {
206+
public BrowseResponse setFacets(Map<String, Map<String, Integer>> facets) {
207207
this.facets = facets;
208208
return this;
209209
}
210210

211-
public BrowseResponse putFacets(String key, Map<String, String> facetsItem) {
211+
public BrowseResponse putFacets(String key, Map<String, Integer> facetsItem) {
212212
if (this.facets == null) {
213213
this.facets = new HashMap<>();
214214
}
@@ -222,7 +222,7 @@ public BrowseResponse putFacets(String key, Map<String, String> facetsItem) {
222222
* @return facets
223223
*/
224224
@javax.annotation.Nullable
225-
public Map<String, Map<String, String>> getFacets() {
225+
public Map<String, Map<String, Integer>> getFacets() {
226226
return facets;
227227
}
228228

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchHits.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@
1212
public class SearchHits<T> {
1313

1414
@JsonProperty("hits")
15-
private List<T> hits;
15+
private List<T> hits = new ArrayList<>();
1616

1717
public SearchHits setHits(List<T> hits) {
1818
this.hits = hits;
1919
return this;
2020
}
2121

2222
public SearchHits addHits(T hitsItem) {
23-
if (this.hits == null) {
24-
this.hits = new ArrayList<>();
25-
}
2623
this.hits.add(hitsItem);
2724
return this;
2825
}
@@ -32,7 +29,7 @@ public SearchHits addHits(T hitsItem) {
3229
*
3330
* @return hits
3431
*/
35-
@javax.annotation.Nullable
32+
@javax.annotation.Nonnull
3633
public List<T> getHits() {
3734
return hits;
3835
}

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class SearchResponse<T> {
3535
private Boolean exhaustiveTypo;
3636

3737
@JsonProperty("facets")
38-
private Map<String, Map<String, String>> facets;
38+
private Map<String, Map<String, Integer>> facets;
3939

4040
@JsonProperty("facets_stats")
4141
private Map<String, FacetsStats> facetsStats;
@@ -114,7 +114,7 @@ public SearchResponse setAbTestVariantID(Integer abTestVariantID) {
114114

115115
/**
116116
* If a search encounters an index that is being A/B tested, abTestVariantID reports the variant
117-
* ID of the index used.
117+
* ID of the index used (starting at 1).
118118
*
119119
* @return abTestVariantID
120120
*/
@@ -200,12 +200,12 @@ public Boolean getExhaustiveTypo() {
200200
return exhaustiveTypo;
201201
}
202202

203-
public SearchResponse setFacets(Map<String, Map<String, String>> facets) {
203+
public SearchResponse setFacets(Map<String, Map<String, Integer>> facets) {
204204
this.facets = facets;
205205
return this;
206206
}
207207

208-
public SearchResponse putFacets(String key, Map<String, String> facetsItem) {
208+
public SearchResponse putFacets(String key, Map<String, Integer> facetsItem) {
209209
if (this.facets == null) {
210210
this.facets = new HashMap<>();
211211
}
@@ -219,7 +219,7 @@ public SearchResponse putFacets(String key, Map<String, String> facetsItem) {
219219
* @return facets
220220
*/
221221
@javax.annotation.Nullable
222-
public Map<String, Map<String, String>> getFacets() {
222+
public Map<String, Map<String, Integer>> getFacets() {
223223
return facets;
224224
}
225225

0 commit comments

Comments
 (0)