diff --git a/algoliasearch/src/main/java/com/algolia/api/IngestionClient.java b/algoliasearch/src/main/java/com/algolia/api/IngestionClient.java index 11fab024..20893fcd 100644 --- a/algoliasearch/src/main/java/com/algolia/api/IngestionClient.java +++ b/algoliasearch/src/main/java/com/algolia/api/IngestionClient.java @@ -2996,6 +2996,44 @@ public CompletableFuture listTransformationsAsync() return this.listTransformationsAsync(null, null, null, null, null); } + /** + * Push a `batch` request payload through the Pipeline. You can check the status of task pushes + * with the observability endpoints. + * + * @param taskID Unique identifier of a task. (required) + * @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the + * Connectors pipeline. (required) + * @param watch When provided, the push operation will be synchronous and the API will wait for + * the ingestion to be finished before responding. (optional) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. + * @throws AlgoliaRuntimeException If it fails to process the API call + */ + public RunResponse pushTask( + @Nonnull String taskID, + @Nonnull PushTaskPayload pushTaskPayload, + Boolean watch, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return LaunderThrowable.await(pushTaskAsync(taskID, pushTaskPayload, watch, requestOptions)); + } + + /** + * Push a `batch` request payload through the Pipeline. You can check the status of task pushes + * with the observability endpoints. + * + * @param taskID Unique identifier of a task. (required) + * @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the + * Connectors pipeline. (required) + * @param watch When provided, the push operation will be synchronous and the API will wait for + * the ingestion to be finished before responding. (optional) + * @throws AlgoliaRuntimeException If it fails to process the API call + */ + public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload, Boolean watch) + throws AlgoliaRuntimeException { + return this.pushTask(taskID, pushTaskPayload, watch, null); + } + /** * Push a `batch` request payload through the Pipeline. You can check the status of task pushes * with the observability endpoints. @@ -3009,7 +3047,7 @@ public CompletableFuture listTransformationsAsync() */ public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload, RequestOptions requestOptions) throws AlgoliaRuntimeException { - return LaunderThrowable.await(pushTaskAsync(taskID, pushTaskPayload, requestOptions)); + return this.pushTask(taskID, pushTaskPayload, null, requestOptions); } /** @@ -3022,7 +3060,7 @@ public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pus * @throws AlgoliaRuntimeException If it fails to process the API call */ public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload) throws AlgoliaRuntimeException { - return this.pushTask(taskID, pushTaskPayload, null); + return this.pushTask(taskID, pushTaskPayload, null, null); } /** @@ -3032,6 +3070,8 @@ public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pus * @param taskID Unique identifier of a task. (required) * @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the * Connectors pipeline. (required) + * @param watch When provided, the push operation will be synchronous and the API will wait for + * the ingestion to be finished before responding. (optional) * @param requestOptions The requestOptions to send along with the query, they will be merged with * the transporter requestOptions. * @throws AlgoliaRuntimeException If it fails to process the API call @@ -3039,6 +3079,7 @@ public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pus public CompletableFuture pushTaskAsync( @Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload, + Boolean watch, RequestOptions requestOptions ) throws AlgoliaRuntimeException { Parameters.requireNonNull(taskID, "Parameter `taskID` is required when calling `pushTask`."); @@ -3049,10 +3090,46 @@ public CompletableFuture pushTaskAsync( .setPath("/2/tasks/{taskID}/push", taskID) .setMethod("POST") .setBody(pushTaskPayload) + .addQueryParameter("watch", watch) .build(); return executeAsync(request, requestOptions, new TypeReference() {}); } + /** + * (asynchronously) Push a `batch` request payload through the Pipeline. You can check the status + * of task pushes with the observability endpoints. + * + * @param taskID Unique identifier of a task. (required) + * @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the + * Connectors pipeline. (required) + * @param watch When provided, the push operation will be synchronous and the API will wait for + * the ingestion to be finished before responding. (optional) + * @throws AlgoliaRuntimeException If it fails to process the API call + */ + public CompletableFuture pushTaskAsync(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload, Boolean watch) + throws AlgoliaRuntimeException { + return this.pushTaskAsync(taskID, pushTaskPayload, watch, null); + } + + /** + * (asynchronously) Push a `batch` request payload through the Pipeline. You can check the status + * of task pushes with the observability endpoints. + * + * @param taskID Unique identifier of a task. (required) + * @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the + * Connectors pipeline. (required) + * @param requestOptions The requestOptions to send along with the query, they will be merged with + * the transporter requestOptions. + * @throws AlgoliaRuntimeException If it fails to process the API call + */ + public CompletableFuture pushTaskAsync( + @Nonnull String taskID, + @Nonnull PushTaskPayload pushTaskPayload, + RequestOptions requestOptions + ) throws AlgoliaRuntimeException { + return this.pushTaskAsync(taskID, pushTaskPayload, null, requestOptions); + } + /** * (asynchronously) Push a `batch` request payload through the Pipeline. You can check the status * of task pushes with the observability endpoints. @@ -3064,7 +3141,7 @@ public CompletableFuture pushTaskAsync( */ public CompletableFuture pushTaskAsync(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload) throws AlgoliaRuntimeException { - return this.pushTaskAsync(taskID, pushTaskPayload, null); + return this.pushTaskAsync(taskID, pushTaskPayload, null, null); } /**