Skip to content

Commit 3b0ddfc

Browse files
chore: generated code for commit 22bf1c3. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 22bf1c3 commit 3b0ddfc

File tree

13 files changed

+430
-52
lines changed

13 files changed

+430
-52
lines changed

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5551,12 +5551,12 @@ public CompletableFuture<SearchResponse> searchSingleIndexAsync(String indexName
55515551
* Search or browse all synonyms, optionally filtering them by type.
55525552
*
55535553
* @param indexName The index in which to perform the request. (required)
5554-
* @param query Search for specific synonyms matching this string. (optional, default to )
55555554
* @param type Only search for specific types of synonyms. (optional)
55565555
* @param page Requested page (zero-based). When specified, will retrieve a specific page; the
55575556
* page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
55585557
* (optional, default to 0)
55595558
* @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100)
5559+
* @param searchSynonymsParams The body of the the `searchSynonyms` method. (optional)
55605560
* @param requestOptions The requestOptions to send along with the query, they will be merged with
55615561
* the transporter requestOptions.
55625562
* @return SearchSynonymsResponse
@@ -5565,31 +5565,36 @@ public CompletableFuture<SearchResponse> searchSingleIndexAsync(String indexName
55655565
*/
55665566
public SearchSynonymsResponse searchSynonyms(
55675567
String indexName,
5568-
String query,
55695568
SynonymType type,
55705569
Integer page,
55715570
Integer hitsPerPage,
5571+
SearchSynonymsParams searchSynonymsParams,
55725572
RequestOptions requestOptions
55735573
) throws AlgoliaRuntimeException {
5574-
return LaunderThrowable.await(searchSynonymsAsync(indexName, query, type, page, hitsPerPage, requestOptions));
5574+
return LaunderThrowable.await(searchSynonymsAsync(indexName, type, page, hitsPerPage, searchSynonymsParams, requestOptions));
55755575
}
55765576

55775577
/**
55785578
* Search or browse all synonyms, optionally filtering them by type.
55795579
*
55805580
* @param indexName The index in which to perform the request. (required)
5581-
* @param query Search for specific synonyms matching this string. (optional, default to )
55825581
* @param type Only search for specific types of synonyms. (optional)
55835582
* @param page Requested page (zero-based). When specified, will retrieve a specific page; the
55845583
* page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
55855584
* (optional, default to 0)
55865585
* @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100)
5586+
* @param searchSynonymsParams The body of the the `searchSynonyms` method. (optional)
55875587
* @return SearchSynonymsResponse
55885588
* @throws AlgoliaRuntimeException If it fails to process the API call
55895589
*/
5590-
public SearchSynonymsResponse searchSynonyms(String indexName, String query, SynonymType type, Integer page, Integer hitsPerPage)
5591-
throws AlgoliaRuntimeException {
5592-
return this.searchSynonyms(indexName, query, type, page, hitsPerPage, null);
5590+
public SearchSynonymsResponse searchSynonyms(
5591+
String indexName,
5592+
SynonymType type,
5593+
Integer page,
5594+
Integer hitsPerPage,
5595+
SearchSynonymsParams searchSynonymsParams
5596+
) throws AlgoliaRuntimeException {
5597+
return this.searchSynonyms(indexName, type, page, hitsPerPage, searchSynonymsParams, null);
55935598
}
55945599

55955600
/**
@@ -5620,41 +5625,37 @@ public SearchSynonymsResponse searchSynonyms(String indexName) throws AlgoliaRun
56205625
* (asynchronously) Search or browse all synonyms, optionally filtering them by type.
56215626
*
56225627
* @param indexName The index in which to perform the request. (required)
5623-
* @param query Search for specific synonyms matching this string. (optional, default to )
56245628
* @param type Only search for specific types of synonyms. (optional)
56255629
* @param page Requested page (zero-based). When specified, will retrieve a specific page; the
56265630
* page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
56275631
* (optional, default to 0)
56285632
* @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100)
5633+
* @param searchSynonymsParams The body of the the `searchSynonyms` method. (optional)
56295634
* @param requestOptions The requestOptions to send along with the query, they will be merged with
56305635
* the transporter requestOptions.
56315636
* @return CompletableFuture<SearchSynonymsResponse> The awaitable future
56325637
* @throws AlgoliaRuntimeException If it fails to process the API call
56335638
*/
56345639
public CompletableFuture<SearchSynonymsResponse> searchSynonymsAsync(
56355640
String indexName,
5636-
String query,
56375641
SynonymType type,
56385642
Integer page,
56395643
Integer hitsPerPage,
5644+
SearchSynonymsParams searchSynonymsParams,
56405645
RequestOptions requestOptions
56415646
) throws AlgoliaRuntimeException {
56425647
if (indexName == null) {
56435648
throw new AlgoliaRuntimeException("Parameter `indexName` is required when calling `searchSynonyms`.");
56445649
}
56455650

5646-
Object bodyObj = null;
5651+
Object bodyObj = searchSynonymsParams;
56475652

56485653
// create path and map variables
56495654
String requestPath = "/1/indexes/{indexName}/synonyms/search".replaceAll("\\{indexName\\}", this.escapeString(indexName.toString()));
56505655

56515656
Map<String, Object> queryParameters = new HashMap<String, Object>();
56525657
Map<String, String> headers = new HashMap<String, String>();
56535658

5654-
if (query != null) {
5655-
queryParameters.put("query", parameterToString(query));
5656-
}
5657-
56585659
if (type != null) {
56595660
queryParameters.put("type", parameterToString(type));
56605661
}
@@ -5675,23 +5676,23 @@ public CompletableFuture<SearchSynonymsResponse> searchSynonymsAsync(
56755676
* (asynchronously) Search or browse all synonyms, optionally filtering them by type.
56765677
*
56775678
* @param indexName The index in which to perform the request. (required)
5678-
* @param query Search for specific synonyms matching this string. (optional, default to )
56795679
* @param type Only search for specific types of synonyms. (optional)
56805680
* @param page Requested page (zero-based). When specified, will retrieve a specific page; the
56815681
* page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
56825682
* (optional, default to 0)
56835683
* @param hitsPerPage Maximum number of objects to retrieve. (optional, default to 100)
5684+
* @param searchSynonymsParams The body of the the `searchSynonyms` method. (optional)
56845685
* @return CompletableFuture<SearchSynonymsResponse> The awaitable future
56855686
* @throws AlgoliaRuntimeException If it fails to process the API call
56865687
*/
56875688
public CompletableFuture<SearchSynonymsResponse> searchSynonymsAsync(
56885689
String indexName,
5689-
String query,
56905690
SynonymType type,
56915691
Integer page,
5692-
Integer hitsPerPage
5692+
Integer hitsPerPage,
5693+
SearchSynonymsParams searchSynonymsParams
56935694
) throws AlgoliaRuntimeException {
5694-
return this.searchSynonymsAsync(indexName, query, type, page, hitsPerPage, null);
5695+
return this.searchSynonymsAsync(indexName, type, page, hitsPerPage, searchSynonymsParams, null);
56955696
}
56965697

56975698
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// This file is generated, manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation.
3+
4+
package com.algolia.model.search;
5+
6+
import com.fasterxml.jackson.annotation.*;
7+
import java.util.Objects;
8+
9+
/** SearchSynonymsParams */
10+
public class SearchSynonymsParams {
11+
12+
@JsonProperty("query")
13+
private String query;
14+
15+
public SearchSynonymsParams setQuery(String query) {
16+
this.query = query;
17+
return this;
18+
}
19+
20+
/**
21+
* The text to search in the index.
22+
*
23+
* @return query
24+
*/
25+
@javax.annotation.Nullable
26+
public String getQuery() {
27+
return query;
28+
}
29+
30+
@Override
31+
public boolean equals(Object o) {
32+
if (this == o) {
33+
return true;
34+
}
35+
if (o == null || getClass() != o.getClass()) {
36+
return false;
37+
}
38+
SearchSynonymsParams searchSynonymsParams = (SearchSynonymsParams) o;
39+
return Objects.equals(this.query, searchSynonymsParams.query);
40+
}
41+
42+
@Override
43+
public int hashCode() {
44+
return Objects.hash(query);
45+
}
46+
47+
@Override
48+
public String toString() {
49+
StringBuilder sb = new StringBuilder();
50+
sb.append("class SearchSynonymsParams {\n");
51+
sb.append(" query: ").append(toIndentedString(query)).append("\n");
52+
sb.append("}");
53+
return sb.toString();
54+
}
55+
56+
/**
57+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
58+
*/
59+
private String toIndentedString(Object o) {
60+
if (o == null) {
61+
return "null";
62+
}
63+
return o.toString().replace("\n", "\n ");
64+
}
65+
}

clients/algoliasearch-client-javascript/packages/client-search/model/clientMethodProps.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import type { SearchForHitsOptions } from './searchForHitsOptions';
2323
import type { SearchParams } from './searchParams';
2424
import type { SearchParamsObject } from './searchParamsObject';
2525
import type { SearchRulesParams } from './searchRulesParams';
26+
import type { SearchSynonymsParams } from './searchSynonymsParams';
2627
import type { Source } from './source';
2728
import type { SynonymHit } from './synonymHit';
2829
import type { SynonymType } from './synonymType';
@@ -682,10 +683,6 @@ export type SearchSynonymsProps = {
682683
* The index in which to perform the request.
683684
*/
684685
indexName: string;
685-
/**
686-
* Search for specific synonyms matching this string.
687-
*/
688-
query?: string;
689686
/**
690687
* Only search for specific types of synonyms.
691688
*/
@@ -698,6 +695,10 @@ export type SearchSynonymsProps = {
698695
* Maximum number of objects to retrieve.
699696
*/
700697
hitsPerPage?: number;
698+
/**
699+
* The body of the the `searchSynonyms` method.
700+
*/
701+
searchSynonymsParams?: SearchSynonymsParams;
701702
};
702703

703704
/**

clients/algoliasearch-client-javascript/packages/client-search/model/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export * from './searchResponses';
124124
export * from './searchRulesParams';
125125
export * from './searchRulesResponse';
126126
export * from './searchStrategy';
127+
export * from './searchSynonymsParams';
127128
export * from './searchSynonymsResponse';
128129
export * from './searchTypeDefault';
129130
export * from './searchTypeFacet';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type SearchSynonymsParams = {
4+
/**
5+
* The text to search in the index.
6+
*/
7+
query?: string;
8+
};

clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,14 +2534,20 @@ export function createSearchClient({
25342534
* @summary Search synonyms.
25352535
* @param searchSynonyms - The searchSynonyms object.
25362536
* @param searchSynonyms.indexName - The index in which to perform the request.
2537-
* @param searchSynonyms.query - Search for specific synonyms matching this string.
25382537
* @param searchSynonyms.type - Only search for specific types of synonyms.
25392538
* @param searchSynonyms.page - Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
25402539
* @param searchSynonyms.hitsPerPage - Maximum number of objects to retrieve.
2540+
* @param searchSynonyms.searchSynonymsParams - The body of the the `searchSynonyms` method.
25412541
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
25422542
*/
25432543
searchSynonyms(
2544-
{ indexName, query, type, page, hitsPerPage }: SearchSynonymsProps,
2544+
{
2545+
indexName,
2546+
type,
2547+
page,
2548+
hitsPerPage,
2549+
searchSynonymsParams,
2550+
}: SearchSynonymsProps,
25452551
requestOptions?: RequestOptions
25462552
): Promise<SearchSynonymsResponse> {
25472553
if (!indexName) {
@@ -2557,10 +2563,6 @@ export function createSearchClient({
25572563
const headers: Headers = {};
25582564
const queryParameters: QueryParameters = {};
25592565

2560-
if (query !== undefined) {
2561-
queryParameters.query = query.toString();
2562-
}
2563-
25642566
if (type !== undefined) {
25652567
queryParameters.type = type.toString();
25662568
}
@@ -2578,6 +2580,7 @@ export function createSearchClient({
25782580
path: requestPath,
25792581
queryParameters,
25802582
headers,
2583+
data: searchSynonymsParams,
25812584
useReadTransporter: true,
25822585
cacheable: true,
25832586
};

clients/algoliasearch-client-php/lib/Api/SearchClient.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,20 +2922,24 @@ public function searchSingleIndex(
29222922
* Search synonyms.
29232923
*
29242924
* @param string $indexName The index in which to perform the request. (required)
2925-
* @param string $query Search for specific synonyms matching this string. (optional, default to '')
29262925
* @param array $type Only search for specific types of synonyms. (optional)
29272926
* @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional, default to 0)
29282927
* @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100)
2928+
* @param array $searchSynonymsParams The body of the the &#x60;searchSynonyms&#x60; method. (optional)
2929+
* - $searchSynonymsParams['query'] => (string) The text to search in the index. (required)
2930+
*
2931+
* @see \Algolia\AlgoliaSearch\Model\Search\SearchSynonymsParams
2932+
*
29292933
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
29302934
*
29312935
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Search\SearchSynonymsResponse
29322936
*/
29332937
public function searchSynonyms(
29342938
$indexName,
2935-
$query = null,
29362939
$type = null,
29372940
$page = null,
29382941
$hitsPerPage = null,
2942+
$searchSynonymsParams = null,
29392943
$requestOptions = []
29402944
) {
29412945
// verify the required parameter 'indexName' is set
@@ -2950,10 +2954,6 @@ public function searchSynonyms(
29502954
$headers = [];
29512955
$httpBody = [];
29522956

2953-
if ($query !== null) {
2954-
$queryParameters['query'] = $query;
2955-
}
2956-
29572957
if ($type !== null) {
29582958
$queryParameters['type'] = $type;
29592959
}
@@ -2975,6 +2975,10 @@ public function searchSynonyms(
29752975
);
29762976
}
29772977

2978+
if (isset($searchSynonymsParams)) {
2979+
$httpBody = $searchSynonymsParams;
2980+
}
2981+
29782982
return $this->sendRequest(
29792983
'POST',
29802984
$resourcePath,

0 commit comments

Comments
 (0)