Skip to content

Commit 1cb7333

Browse files
algolia-botmillotp
andcommitted
fix(specs): add getVersion parameter to getSettings (generated)
algolia/api-clients-automation#5254 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 26e0ccb commit 1cb7333

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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(

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
{

0 commit comments

Comments
 (0)