Skip to content

Commit 86ebd34

Browse files
feat(specs): document runMetadata parameter (generated)
algolia/api-clients-automation#5087 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Devin Beeuwkes <46448173+DevinCodes@users.noreply.github.com>
1 parent c26e1c2 commit 86ebd34

File tree

3 files changed

+48
-7
lines changed

3 files changed

+48
-7
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import algoliasearch.ingestion.RunSortKeys._
4444
import algoliasearch.ingestion.RunSourcePayload
4545
import algoliasearch.ingestion.RunSourceResponse
4646
import algoliasearch.ingestion.RunStatus._
47+
import algoliasearch.ingestion.RunTaskPayload
4748
import algoliasearch.ingestion.RunType._
4849
import algoliasearch.ingestion.Source
4950
import algoliasearch.ingestion.SourceCreate
@@ -1338,16 +1339,20 @@ class IngestionClient(
13381339
*
13391340
* @param taskID
13401341
* Unique identifier of a task.
1342+
* @param runTaskPayload
13411343
*/
1342-
def runTask(taskID: String, requestOptions: Option[RequestOptions] = None)(implicit
1343-
ec: ExecutionContext
1344-
): Future[RunResponse] = Future {
1344+
def runTask(
1345+
taskID: String,
1346+
runTaskPayload: Option[RunTaskPayload] = None,
1347+
requestOptions: Option[RequestOptions] = None
1348+
)(implicit ec: ExecutionContext): Future[RunResponse] = Future {
13451349
requireNotNull(taskID, "Parameter `taskID` is required when calling `runTask`.")
13461350

13471351
val request = HttpRequest
13481352
.builder()
13491353
.withMethod("POST")
13501354
.withPath(s"/2/tasks/${escape(taskID)}/run")
1355+
.withBody(runTaskPayload)
13511356
.build()
13521357
execute[RunResponse](request, requestOptions)
13531358
}
@@ -1364,16 +1369,20 @@ class IngestionClient(
13641369
*
13651370
* @param taskID
13661371
* Unique identifier of a task.
1372+
* @param runTaskPayload
13671373
*/
1368-
def runTaskV1(taskID: String, requestOptions: Option[RequestOptions] = None)(implicit
1369-
ec: ExecutionContext
1370-
): Future[RunResponse] = Future {
1374+
def runTaskV1(
1375+
taskID: String,
1376+
runTaskPayload: Option[RunTaskPayload] = None,
1377+
requestOptions: Option[RequestOptions] = None
1378+
)(implicit ec: ExecutionContext): Future[RunResponse] = Future {
13711379
requireNotNull(taskID, "Parameter `taskID` is required when calling `runTaskV1`.")
13721380

13731381
val request = HttpRequest
13741382
.builder()
13751383
.withMethod("POST")
13761384
.withPath(s"/1/tasks/${escape(taskID)}/run")
1385+
.withBody(runTaskPayload)
13771386
.build()
13781387
execute[RunResponse](request, requestOptions)
13791388
}

src/main/scala/algoliasearch/ingestion/RunSourcePayload.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ import algoliasearch.ingestion.EntityType._
2929
* List of index names to exclude in reindex/update.
3030
* @param entityIDs
3131
* List of entityIDs to update.
32+
* @param runMetadata
33+
* Additional information that will be passed to the created runs.
3234
*/
3335
case class RunSourcePayload(
3436
indexToInclude: Option[Seq[String]] = scala.None,
3537
indexToExclude: Option[Seq[String]] = scala.None,
3638
entityIDs: Option[Seq[String]] = scala.None,
37-
entityType: Option[EntityType] = scala.None
39+
entityType: Option[EntityType] = scala.None,
40+
runMetadata: Option[Map[String, Any]] = scala.None
3841
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/** Ingestion API The Ingestion API lets you connect third-party services and platforms with Algolia and schedule tasks
2+
* to ingest your data. The Ingestion API powers the no-code [data
3+
* connectors](https://dashboard.algolia.com/connectors). ## Base URLs The base URLs for requests to the Ingestion API
4+
* are: - `https://data.us.algolia.com` - `https://data.eu.algolia.com` Use the URL that matches your [analytics
5+
* region](https://dashboard.algolia.com/account/infrastructure/analytics). **All requests must use HTTPS.** ##
6+
* Authentication To authenticate your API requests, add these headers: - `x-algolia-application-id`. Your Algolia
7+
* application ID. - `x-algolia-api-key`. An API key with the necessary permissions to make the request. The required
8+
* access control list (ACL) to make a request is listed in each endpoint's reference. You can find your application ID
9+
* and API key in the [Algolia dashboard](https://dashboard.algolia.com/account). ## Request format Request bodies must
10+
* be JSON objects. ## Response status and errors Response bodies are JSON objects. Successful responses return a `2xx`
11+
* status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. Error responses have a
12+
* `message` property with more information. ## Version The current version of the Ingestion API is version 1, as
13+
* indicated by the `/1/` in each endpoint's URL.
14+
*
15+
* The version of the OpenAPI document: 1.0.0
16+
*
17+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
18+
* https://openapi-generator.tech Do not edit the class manually.
19+
*/
20+
package algoliasearch.ingestion
21+
22+
/** RunTaskPayload
23+
*
24+
* @param runMetadata
25+
* Additional information that will be passed to the created run.
26+
*/
27+
case class RunTaskPayload(
28+
runMetadata: Option[Map[String, Any]] = scala.None
29+
)

0 commit comments

Comments
 (0)