File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed
algoliasearch-client-javascript/packages/client-search/src
algoliasearch-client-php/lib/Api Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ export function createSearchClient({
206
206
} ,
207
207
208
208
/**
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`.
210
210
*
211
211
* @summary Wait for an API key task to be processed.
212
212
* @param waitForApiKeyOptions - The waitForApiKeyOptions object.
Original file line number Diff line number Diff line change @@ -3237,6 +3237,48 @@ function ($res) {
3237
3237
);
3238
3238
}
3239
3239
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
+
3240
3282
private function sendRequest (
3241
3283
$ method ,
3242
3284
$ resourcePath ,
You can’t perform that action at this time.
0 commit comments