Skip to content

Commit 0774f06

Browse files
fix(specs): enable watcher for push [skip-bc] (generated)
algolia/api-clients-automation#4229 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 5b43b03 commit 0774f06

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/main/scala/algoliasearch/api/IngestionClient.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import algoliasearch.ingestion.SourceSortKeys._
5252
import algoliasearch.ingestion.SourceType._
5353
import algoliasearch.ingestion.SourceUpdate
5454
import algoliasearch.ingestion.SourceUpdateResponse
55-
import algoliasearch.ingestion.SourceWatchResponse
5655
import algoliasearch.ingestion.Task
5756
import algoliasearch.ingestion.TaskCreate
5857
import algoliasearch.ingestion.TaskCreateResponse
@@ -72,6 +71,7 @@ import algoliasearch.ingestion.TransformationTry
7271
import algoliasearch.ingestion.TransformationTryResponse
7372
import algoliasearch.ingestion.TransformationUpdateResponse
7473
import algoliasearch.ingestion.TriggerType._
74+
import algoliasearch.ingestion.WatchResponse
7575
import algoliasearch.ingestion._
7676
import algoliasearch.ApiClient
7777
import algoliasearch.api.IngestionClient.hosts
@@ -1208,7 +1208,7 @@ class IngestionClient(
12081208
pushTaskPayload: PushTaskPayload,
12091209
watch: Option[Boolean] = None,
12101210
requestOptions: Option[RequestOptions] = None
1211-
)(implicit ec: ExecutionContext): Future[RunResponse] = Future {
1211+
)(implicit ec: ExecutionContext): Future[WatchResponse] = Future {
12121212
requireNotNull(taskID, "Parameter `taskID` is required when calling `pushTask`.")
12131213
requireNotNull(pushTaskPayload, "Parameter `pushTaskPayload` is required when calling `pushTask`.")
12141214

@@ -1219,7 +1219,7 @@ class IngestionClient(
12191219
.withBody(pushTaskPayload)
12201220
.withQueryParameter("watch", watch)
12211221
.build()
1222-
execute[RunResponse](request, requestOptions)
1222+
execute[WatchResponse](request, requestOptions)
12231223
}
12241224

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

14471447
val request = HttpRequest
14481448
.builder()
14491449
.withMethod("POST")
14501450
.withPath(s"/1/sources/${escape(sourceID)}/discover")
14511451
.build()
1452-
execute[SourceWatchResponse](request, requestOptions)
1452+
execute[WatchResponse](request, requestOptions)
14531453
}
14541454

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

16691669
val request = HttpRequest
16701670
.builder()
16711671
.withMethod("POST")
16721672
.withPath(s"/1/sources/validate")
16731673
.withBody(sourceCreate)
16741674
.build()
1675-
execute[SourceWatchResponse](request, requestOptions)
1675+
execute[WatchResponse](request, requestOptions)
16761676
}
16771677

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

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

17061706
}

src/main/scala/algoliasearch/ingestion/SourceWatchResponse.scala renamed to src/main/scala/algoliasearch/ingestion/WatchResponse.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
*/
2020
package algoliasearch.ingestion
2121

22-
/** SourceWatchResponse
22+
/** WatchResponse
2323
*
2424
* @param runID
2525
* Universally unique identifier (UUID) of a task run.
2626
* @param data
27-
* depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
27+
* when used with discovering or validating sources, the sampled data of your source is returned.
2828
* @param events
2929
* in case of error, observability events will be added to the response, if any.
3030
* @param message
3131
* a message describing the outcome of a validate run.
3232
*/
33-
case class SourceWatchResponse(
33+
case class WatchResponse(
3434
runID: Option[String] = scala.None,
3535
data: Option[Seq[Any]] = scala.None,
3636
events: Option[Seq[Event]] = scala.None,

0 commit comments

Comments
 (0)