Skip to content

Commit ceea11e

Browse files
algolia-botdamcou
andcommitted
chore: generated code for commit d21c3b7. [skip ci]
Co-authored-by: Damien Couchez <[email protected]>
1 parent d21c3b7 commit ceea11e

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export function createSearchClient({
206206
},
207207

208208
/**
209-
* Helper: Wait for an API key to be valid, updated or deleted based on a given `operation`.
209+
* Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
210210
*
211211
* @summary Wait for an API key task to be processed.
212212
* @param waitForApiKeyOptions - The waitForApiKeyOptions object.

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,6 +3237,48 @@ function ($res) {
32373237
);
32383238
}
32393239

3240+
/**
3241+
* Wait for an API key to be added, updated or deleted based on a given `operation`.
3242+
*
3243+
* @param string $operation the `operation` that was done on a `key`
3244+
* @param string $key the `key` that has been added, deleted or updated
3245+
* @param array $apiKey necessary to know if an `update` operation has been processed, compare fields of the response with it
3246+
* @param int|null $maxRetries Maximum number of retries
3247+
* @param int|null $timeout Timeout
3248+
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
3249+
*
3250+
* @throws ExceededRetriesException
3251+
*
3252+
* @return void
3253+
*/
3254+
public function waitForApiKey(
3255+
$operation,
3256+
$key,
3257+
$apiKey = null,
3258+
$maxRetries = null,
3259+
$timeout = null,
3260+
$requestOptions = []
3261+
) {
3262+
if ($timeout === null) {
3263+
$timeout = $this->config->getWaitTaskTimeBeforeRetry();
3264+
}
3265+
3266+
if ($maxRetries === null) {
3267+
$maxRetries = $this->config->getDefaultMaxRetries();
3268+
}
3269+
3270+
Helpers::retryForApiKeyUntil(
3271+
$operation,
3272+
$this,
3273+
$key,
3274+
$apiKey,
3275+
$maxRetries,
3276+
$timeout,
3277+
null,
3278+
$requestOptions
3279+
);
3280+
}
3281+
32403282
private function sendRequest(
32413283
$method,
32423284
$resourcePath,

0 commit comments

Comments
 (0)