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 3d3931b commit dcdb228
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/scala/algoliasearch/api/IngestionClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,16 @@ class IngestionClient(
* Unique identifier of a task.
* @param pushTaskPayload
* Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
* @param watch
* When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished
* before responding.
*/
def pushTask(taskID: String, pushTaskPayload: PushTaskPayload, requestOptions: Option[RequestOptions] = None)(implicit
ec: ExecutionContext
): Future[RunResponse] = Future {
def pushTask(
taskID: String,
pushTaskPayload: PushTaskPayload,
watch: Option[Boolean] = None,
requestOptions: Option[RequestOptions] = None
)(implicit ec: ExecutionContext): Future[RunResponse] = Future {
requireNotNull(taskID, "Parameter `taskID` is required when calling `pushTask`.")
requireNotNull(pushTaskPayload, "Parameter `pushTaskPayload` is required when calling `pushTask`.")

Expand All @@ -1211,6 +1217,7 @@ class IngestionClient(
.withMethod("POST")
.withPath(s"/2/tasks/${escape(taskID)}/push")
.withBody(pushTaskPayload)
.withQueryParameter("watch", watch)
.build()
execute[RunResponse](request, requestOptions)
}
Expand Down

0 comments on commit dcdb228

Please sign in to comment.