Skip to content

Commit

Permalink
feat(specs): add watch to pushTask ingestion (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4224

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
algolia-bot and shortcuts committed Dec 10, 2024
1 parent 9d58886 commit 8205398
Showing 1 changed file with 80 additions and 3 deletions.
83 changes: 80 additions & 3 deletions algoliasearch/src/main/java/com/algolia/api/IngestionClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2996,6 +2996,44 @@ public CompletableFuture<ListTransformationsResponse> 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.
Expand All @@ -3009,7 +3047,7 @@ public CompletableFuture<ListTransformationsResponse> 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);
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -3032,13 +3070,16 @@ 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
*/
public CompletableFuture<RunResponse> pushTaskAsync(
@Nonnull String taskID,
@Nonnull PushTaskPayload pushTaskPayload,
Boolean watch,
RequestOptions requestOptions
) throws AlgoliaRuntimeException {
Parameters.requireNonNull(taskID, "Parameter `taskID` is required when calling `pushTask`.");
Expand All @@ -3049,10 +3090,46 @@ public CompletableFuture<RunResponse> pushTaskAsync(
.setPath("/2/tasks/{taskID}/push", taskID)
.setMethod("POST")
.setBody(pushTaskPayload)
.addQueryParameter("watch", watch)
.build();
return executeAsync(request, requestOptions, new TypeReference<RunResponse>() {});
}

/**
* (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<RunResponse> 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<RunResponse> 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.
Expand All @@ -3064,7 +3141,7 @@ public CompletableFuture<RunResponse> pushTaskAsync(
*/
public CompletableFuture<RunResponse> pushTaskAsync(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload)
throws AlgoliaRuntimeException {
return this.pushTaskAsync(taskID, pushTaskPayload, null);
return this.pushTaskAsync(taskID, pushTaskPayload, null, null);
}

/**
Expand Down

0 comments on commit 8205398

Please sign in to comment.