Skip to content

Commit ec2d896

Browse files
authored
Merge branch 'main' into benk/compositions/rest-api-endpoints
2 parents d7a1da4 + 92ebb0f commit ec2d896

File tree

85 files changed

+470
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+470
-168
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Clients/SearchClient.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ Rule GetRule(
12351235
/// Required API Key ACLs:
12361236
/// - settings
12371237
/// <param name="indexName">Name of the index on which to perform the operation.</param>
1238+
/// <param name="getVersion">When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. (optional, default to 1)</param>
12381239
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
12391240
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
12401241
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1243,6 +1244,7 @@ Rule GetRule(
12431244
/// <returns>Task of SettingsResponse</returns>
12441245
Task<SettingsResponse> GetSettingsAsync(
12451246
string indexName,
1247+
int? getVersion = default,
12461248
RequestOptions options = null,
12471249
CancellationToken cancellationToken = default
12481250
);
@@ -1254,6 +1256,7 @@ Task<SettingsResponse> GetSettingsAsync(
12541256
/// Required API Key ACLs:
12551257
/// - settings
12561258
/// <param name="indexName">Name of the index on which to perform the operation.</param>
1259+
/// <param name="getVersion">When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. (optional, default to 1)</param>
12571260
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
12581261
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
12591262
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1262,6 +1265,7 @@ Task<SettingsResponse> GetSettingsAsync(
12621265
/// <returns>SettingsResponse</returns>
12631266
SettingsResponse GetSettings(
12641267
string indexName,
1268+
int? getVersion = default,
12651269
RequestOptions options = null,
12661270
CancellationToken cancellationToken = default
12671271
);
@@ -3731,6 +3735,7 @@ public Rule GetRule(
37313735
/// <inheritdoc />
37323736
public async Task<SettingsResponse> GetSettingsAsync(
37333737
string indexName,
3738+
int? getVersion = default,
37343739
RequestOptions options = null,
37353740
CancellationToken cancellationToken = default
37363741
)
@@ -3742,6 +3747,7 @@ public async Task<SettingsResponse> GetSettingsAsync(
37423747

37433748
requestOptions.PathParameters.Add("indexName", QueryStringHelper.ParameterToString(indexName));
37443749

3750+
requestOptions.AddQueryParameter("getVersion", getVersion);
37453751
return await _transport
37463752
.ExecuteRequestAsync<SettingsResponse>(
37473753
new HttpMethod("GET"),
@@ -3755,9 +3761,11 @@ public async Task<SettingsResponse> GetSettingsAsync(
37553761
/// <inheritdoc />
37563762
public SettingsResponse GetSettings(
37573763
string indexName,
3764+
int? getVersion = default,
37583765
RequestOptions options = null,
37593766
CancellationToken cancellationToken = default
3760-
) => AsyncHelper.RunSync(() => GetSettingsAsync(indexName, options, cancellationToken));
3767+
) =>
3768+
AsyncHelper.RunSync(() => GetSettingsAsync(indexName, getVersion, options, cancellationToken));
37613769

37623770
/// <inheritdoc />
37633771
public async Task<List<Source>> GetSourcesAsync(

clients/algoliasearch-client-csharp/algoliasearch/Utils/SearchClientExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ public async Task<bool> IndexExistsAsync(
11571157
{
11581158
try
11591159
{
1160-
await GetSettingsAsync(indexName, null, cancellationToken);
1160+
await GetSettingsAsync(indexName, null, null, cancellationToken);
11611161
}
11621162
catch (AlgoliaApiException ex) when (ex.HttpErrorCode == 404)
11631163
{

clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,9 +1168,11 @@ final class SearchClient implements ApiClient {
11681168
///
11691169
/// Parameters:
11701170
/// * [indexName] Name of the index on which to perform the operation.
1171+
/// * [getVersion] When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility.
11711172
/// * [requestOptions] additional request configuration.
11721173
Future<SettingsResponse> getSettings({
11731174
required String indexName,
1175+
int? getVersion,
11741176
RequestOptions? requestOptions,
11751177
}) async {
11761178
assert(
@@ -1181,6 +1183,9 @@ final class SearchClient implements ApiClient {
11811183
method: RequestMethod.get,
11821184
path: r'/1/indexes/{indexName}/settings'.replaceAll(
11831185
'{' r'indexName' '}', Uri.encodeComponent(indexName.toString())),
1186+
queryParams: {
1187+
if (getVersion != null) 'getVersion': getVersion,
1188+
},
11841189
);
11851190
final response = await _retryStrategy.execute(
11861191
request: request,

clients/algoliasearch-client-go/algolia/search/api_search.go

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,6 +2745,33 @@ public CompletableFuture<Rule> getRuleAsync(@Nonnull String indexName, @Nonnull
27452745
return this.getRuleAsync(indexName, objectID, null);
27462746
}
27472747

2748+
/**
2749+
* Retrieves an object with non-null index settings.
2750+
*
2751+
* @param indexName Name of the index on which to perform the operation. (required)
2752+
* @param getVersion When set to 2, the endpoint will not include `synonyms` in the response. This
2753+
* parameter is here for backward compatibility. (optional, default to 1)
2754+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
2755+
* the transporter requestOptions.
2756+
* @throws AlgoliaRuntimeException If it fails to process the API call
2757+
*/
2758+
public SettingsResponse getSettings(@Nonnull String indexName, Integer getVersion, @Nullable RequestOptions requestOptions)
2759+
throws AlgoliaRuntimeException {
2760+
return LaunderThrowable.await(getSettingsAsync(indexName, getVersion, requestOptions));
2761+
}
2762+
2763+
/**
2764+
* Retrieves an object with non-null index settings.
2765+
*
2766+
* @param indexName Name of the index on which to perform the operation. (required)
2767+
* @param getVersion When set to 2, the endpoint will not include `synonyms` in the response. This
2768+
* parameter is here for backward compatibility. (optional, default to 1)
2769+
* @throws AlgoliaRuntimeException If it fails to process the API call
2770+
*/
2771+
public SettingsResponse getSettings(@Nonnull String indexName, Integer getVersion) throws AlgoliaRuntimeException {
2772+
return this.getSettings(indexName, getVersion, null);
2773+
}
2774+
27482775
/**
27492776
* Retrieves an object with non-null index settings.
27502777
*
@@ -2754,7 +2781,7 @@ public CompletableFuture<Rule> getRuleAsync(@Nonnull String indexName, @Nonnull
27542781
* @throws AlgoliaRuntimeException If it fails to process the API call
27552782
*/
27562783
public SettingsResponse getSettings(@Nonnull String indexName, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
2757-
return LaunderThrowable.await(getSettingsAsync(indexName, requestOptions));
2784+
return this.getSettings(indexName, null, requestOptions);
27582785
}
27592786

27602787
/**
@@ -2764,33 +2791,68 @@ public SettingsResponse getSettings(@Nonnull String indexName, @Nullable Request
27642791
* @throws AlgoliaRuntimeException If it fails to process the API call
27652792
*/
27662793
public SettingsResponse getSettings(@Nonnull String indexName) throws AlgoliaRuntimeException {
2767-
return this.getSettings(indexName, null);
2794+
return this.getSettings(indexName, null, null);
27682795
}
27692796

27702797
/**
27712798
* (asynchronously) Retrieves an object with non-null index settings.
27722799
*
27732800
* @param indexName Name of the index on which to perform the operation. (required)
2801+
* @param getVersion When set to 2, the endpoint will not include `synonyms` in the response. This
2802+
* parameter is here for backward compatibility. (optional, default to 1)
27742803
* @param requestOptions The requestOptions to send along with the query, they will be merged with
27752804
* the transporter requestOptions.
27762805
* @throws AlgoliaRuntimeException If it fails to process the API call
27772806
*/
2778-
public CompletableFuture<SettingsResponse> getSettingsAsync(@Nonnull String indexName, @Nullable RequestOptions requestOptions)
2779-
throws AlgoliaRuntimeException {
2807+
public CompletableFuture<SettingsResponse> getSettingsAsync(
2808+
@Nonnull String indexName,
2809+
Integer getVersion,
2810+
@Nullable RequestOptions requestOptions
2811+
) throws AlgoliaRuntimeException {
27802812
Parameters.requireNonNull(indexName, "Parameter `indexName` is required when calling `getSettings`.");
27812813

2782-
HttpRequest request = HttpRequest.builder().setPath("/1/indexes/{indexName}/settings", indexName).setMethod("GET").build();
2814+
HttpRequest request = HttpRequest.builder()
2815+
.setPath("/1/indexes/{indexName}/settings", indexName)
2816+
.setMethod("GET")
2817+
.addQueryParameter("getVersion", getVersion)
2818+
.build();
27832819
return executeAsync(request, requestOptions, new TypeReference<SettingsResponse>() {});
27842820
}
27852821

2822+
/**
2823+
* (asynchronously) Retrieves an object with non-null index settings.
2824+
*
2825+
* @param indexName Name of the index on which to perform the operation. (required)
2826+
* @param getVersion When set to 2, the endpoint will not include `synonyms` in the response. This
2827+
* parameter is here for backward compatibility. (optional, default to 1)
2828+
* @throws AlgoliaRuntimeException If it fails to process the API call
2829+
*/
2830+
public CompletableFuture<SettingsResponse> getSettingsAsync(@Nonnull String indexName, Integer getVersion)
2831+
throws AlgoliaRuntimeException {
2832+
return this.getSettingsAsync(indexName, getVersion, null);
2833+
}
2834+
2835+
/**
2836+
* (asynchronously) Retrieves an object with non-null index settings.
2837+
*
2838+
* @param indexName Name of the index on which to perform the operation. (required)
2839+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
2840+
* the transporter requestOptions.
2841+
* @throws AlgoliaRuntimeException If it fails to process the API call
2842+
*/
2843+
public CompletableFuture<SettingsResponse> getSettingsAsync(@Nonnull String indexName, @Nullable RequestOptions requestOptions)
2844+
throws AlgoliaRuntimeException {
2845+
return this.getSettingsAsync(indexName, null, requestOptions);
2846+
}
2847+
27862848
/**
27872849
* (asynchronously) Retrieves an object with non-null index settings.
27882850
*
27892851
* @param indexName Name of the index on which to perform the operation. (required)
27902852
* @throws AlgoliaRuntimeException If it fails to process the API call
27912853
*/
27922854
public CompletableFuture<SettingsResponse> getSettingsAsync(@Nonnull String indexName) throws AlgoliaRuntimeException {
2793-
return this.getSettingsAsync(indexName, null);
2855+
return this.getSettingsAsync(indexName, null, null);
27942856
}
27952857

27962858
/**

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ export type GetSettingsProps = {
393393
* Name of the index on which to perform the operation.
394394
*/
395395
indexName: string;
396+
/**
397+
* When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility.
398+
*/
399+
getVersion?: number | undefined;
396400
};
397401

398402
/**

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1792,9 +1792,13 @@ export function createSearchClient({
17921792
* - settings
17931793
* @param getSettings - The getSettings object.
17941794
* @param getSettings.indexName - Name of the index on which to perform the operation.
1795+
* @param getSettings.getVersion - When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility.
17951796
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
17961797
*/
1797-
getSettings({ indexName }: GetSettingsProps, requestOptions?: RequestOptions): Promise<SettingsResponse> {
1798+
getSettings(
1799+
{ indexName, getVersion }: GetSettingsProps,
1800+
requestOptions?: RequestOptions,
1801+
): Promise<SettingsResponse> {
17981802
if (!indexName) {
17991803
throw new Error('Parameter `indexName` is required when calling `getSettings`.');
18001804
}
@@ -1803,6 +1807,10 @@ export function createSearchClient({
18031807
const headers: Headers = {};
18041808
const queryParameters: QueryParameters = {};
18051809

1810+
if (getVersion !== undefined) {
1811+
queryParameters['getVersion'] = getVersion.toString();
1812+
}
1813+
18061814
const request: Request = {
18071815
method: 'GET',
18081816
path: requestPath,

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/SearchClient.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,17 @@ public class SearchClient(
699699
* Required API Key ACLs:
700700
* - settings
701701
* @param indexName Name of the index on which to perform the operation.
702+
* @param getVersion When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. (default to 1)
702703
* @param requestOptions additional request configuration.
703704
*/
704-
public suspend fun getSettings(indexName: String, requestOptions: RequestOptions? = null): SettingsResponse {
705+
public suspend fun getSettings(indexName: String, getVersion: Int? = null, requestOptions: RequestOptions? = null): SettingsResponse {
705706
require(indexName.isNotBlank()) { "Parameter `indexName` is required when calling `getSettings`." }
706707
val requestConfig = RequestConfig(
707708
method = RequestMethod.GET,
708709
path = listOf("1", "indexes", "$indexName", "settings"),
710+
query = buildMap {
711+
getVersion?.let { put("getVersion", it) }
712+
},
709713
)
710714
return requester.execute(
711715
requestConfig = requestConfig,

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,11 +1463,12 @@ public function getRule($indexName, $objectID, $requestOptions = [])
14631463
* - settings
14641464
*
14651465
* @param string $indexName Name of the index on which to perform the operation. (required)
1466+
* @param int $getVersion When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. (optional, default to 1)
14661467
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
14671468
*
14681469
* @return array<string, mixed>|SettingsResponse
14691470
*/
1470-
public function getSettings($indexName, $requestOptions = [])
1471+
public function getSettings($indexName, $getVersion = null, $requestOptions = [])
14711472
{
14721473
// verify the required parameter 'indexName' is set
14731474
if (!isset($indexName)) {
@@ -1481,6 +1482,10 @@ public function getSettings($indexName, $requestOptions = [])
14811482
$headers = [];
14821483
$httpBody = null;
14831484

1485+
if (null !== $getVersion) {
1486+
$queryParameters['getVersion'] = $getVersion;
1487+
}
1488+
14841489
// path params
14851490
if (null !== $indexName) {
14861491
$resourcePath = str_replace(

0 commit comments

Comments
 (0)