Skip to content

Commit

Permalink
fix(specs): enable watcher for push [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4229

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
algolia-bot and shortcuts committed Dec 11, 2024
1 parent 5b43b03 commit 0774f06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/main/scala/algoliasearch/api/IngestionClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import algoliasearch.ingestion.SourceSortKeys._
import algoliasearch.ingestion.SourceType._
import algoliasearch.ingestion.SourceUpdate
import algoliasearch.ingestion.SourceUpdateResponse
import algoliasearch.ingestion.SourceWatchResponse
import algoliasearch.ingestion.Task
import algoliasearch.ingestion.TaskCreate
import algoliasearch.ingestion.TaskCreateResponse
Expand All @@ -72,6 +71,7 @@ import algoliasearch.ingestion.TransformationTry
import algoliasearch.ingestion.TransformationTryResponse
import algoliasearch.ingestion.TransformationUpdateResponse
import algoliasearch.ingestion.TriggerType._
import algoliasearch.ingestion.WatchResponse
import algoliasearch.ingestion._
import algoliasearch.ApiClient
import algoliasearch.api.IngestionClient.hosts
Expand Down Expand Up @@ -1208,7 +1208,7 @@ class IngestionClient(
pushTaskPayload: PushTaskPayload,
watch: Option[Boolean] = None,
requestOptions: Option[RequestOptions] = None
)(implicit ec: ExecutionContext): Future[RunResponse] = Future {
)(implicit ec: ExecutionContext): Future[WatchResponse] = Future {
requireNotNull(taskID, "Parameter `taskID` is required when calling `pushTask`.")
requireNotNull(pushTaskPayload, "Parameter `pushTaskPayload` is required when calling `pushTask`.")

Expand All @@ -1219,7 +1219,7 @@ class IngestionClient(
.withBody(pushTaskPayload)
.withQueryParameter("watch", watch)
.build()
execute[RunResponse](request, requestOptions)
execute[WatchResponse](request, requestOptions)
}

/** Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
Expand Down Expand Up @@ -1441,15 +1441,15 @@ class IngestionClient(
*/
def triggerDockerSourceDiscover(sourceID: String, requestOptions: Option[RequestOptions] = None)(implicit
ec: ExecutionContext
): Future[SourceWatchResponse] = Future {
): Future[WatchResponse] = Future {
requireNotNull(sourceID, "Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.")

val request = HttpRequest
.builder()
.withMethod("POST")
.withPath(s"/1/sources/${escape(sourceID)}/discover")
.build()
execute[SourceWatchResponse](request, requestOptions)
execute[WatchResponse](request, requestOptions)
}

/** Try a transformation before creating it.
Expand Down Expand Up @@ -1664,15 +1664,15 @@ class IngestionClient(
*/
def validateSource(sourceCreate: Option[SourceCreate] = None, requestOptions: Option[RequestOptions] = None)(implicit
ec: ExecutionContext
): Future[SourceWatchResponse] = Future {
): Future[WatchResponse] = Future {

val request = HttpRequest
.builder()
.withMethod("POST")
.withPath(s"/1/sources/validate")
.withBody(sourceCreate)
.build()
execute[SourceWatchResponse](request, requestOptions)
execute[WatchResponse](request, requestOptions)
}

/** Validates an update of a source payload to ensure it can be created and that the data source can be reached by
Expand All @@ -1690,7 +1690,7 @@ class IngestionClient(
sourceID: String,
sourceUpdate: SourceUpdate,
requestOptions: Option[RequestOptions] = None
)(implicit ec: ExecutionContext): Future[SourceWatchResponse] = Future {
)(implicit ec: ExecutionContext): Future[WatchResponse] = Future {
requireNotNull(sourceID, "Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.")
requireNotNull(sourceUpdate, "Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.")

Expand All @@ -1700,7 +1700,7 @@ class IngestionClient(
.withPath(s"/1/sources/${escape(sourceID)}/validate")
.withBody(sourceUpdate)
.build()
execute[SourceWatchResponse](request, requestOptions)
execute[WatchResponse](request, requestOptions)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
*/
package algoliasearch.ingestion

/** SourceWatchResponse
/** WatchResponse
*
* @param runID
* Universally unique identifier (UUID) of a task run.
* @param data
* depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
* when used with discovering or validating sources, the sampled data of your source is returned.
* @param events
* in case of error, observability events will be added to the response, if any.
* @param message
* a message describing the outcome of a validate run.
*/
case class SourceWatchResponse(
case class WatchResponse(
runID: Option[String] = scala.None,
data: Option[Seq[Any]] = scala.None,
events: Option[Seq[Event]] = scala.None,
Expand Down

0 comments on commit 0774f06

Please sign in to comment.