Skip to content

Commit fd0af40

Browse files
feat(specs): add v2 endpoints for ingestion
algolia/api-clients-automation#3416 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 3033803 commit fd0af40

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed

client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,30 @@ public class IngestionClient(
902902
)
903903
}
904904

905+
/**
906+
* Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints.
907+
*
908+
* Required API Key ACLs:
909+
* - addObject
910+
* - deleteIndex
911+
* - editSettings
912+
* @param taskID Unique identifier of a task.
913+
* @param batchWriteParams Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
914+
* @param requestOptions additional request configuration.
915+
*/
916+
public suspend fun pushTask(taskID: String, batchWriteParams: BatchWriteParams, requestOptions: RequestOptions? = null): RunResponse {
917+
require(taskID.isNotBlank()) { "Parameter `taskID` is required when calling `pushTask`." }
918+
val requestConfig = RequestConfig(
919+
method = RequestMethod.POST,
920+
path = listOf("2", "tasks", "$taskID", "push"),
921+
body = batchWriteParams,
922+
)
923+
return requester.execute(
924+
requestConfig = requestConfig,
925+
requestOptions = requestOptions,
926+
)
927+
}
928+
905929
/**
906930
* Runs a task. You can check the status of task runs with the observability endpoints.
907931
*
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */
2+
package com.algolia.client.model.ingestion
3+
4+
import kotlinx.serialization.*
5+
6+
/**
7+
* Type of indexing operation.
8+
*/
9+
@Serializable
10+
public enum class Action(public val value: kotlin.String) {
11+
12+
@SerialName(value = "addObject")
13+
AddObject("addObject"),
14+
15+
@SerialName(value = "updateObject")
16+
UpdateObject("updateObject"),
17+
18+
@SerialName(value = "partialUpdateObject")
19+
PartialUpdateObject("partialUpdateObject"),
20+
21+
@SerialName(value = "partialUpdateObjectNoCreate")
22+
PartialUpdateObjectNoCreate("partialUpdateObjectNoCreate"),
23+
24+
@SerialName(value = "deleteObject")
25+
DeleteObject("deleteObject"),
26+
27+
@SerialName(value = "delete")
28+
Delete("delete"),
29+
30+
@SerialName(value = "clear")
31+
Clear("clear");
32+
33+
override fun toString(): kotlin.String = value
34+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */
2+
package com.algolia.client.model.ingestion
3+
4+
import kotlinx.serialization.*
5+
import kotlinx.serialization.json.*
6+
7+
/**
8+
* BatchRequest
9+
*
10+
* @param action
11+
* @param body Operation arguments (varies with specified `action`).
12+
*/
13+
@Serializable
14+
public data class BatchRequest(
15+
16+
@SerialName(value = "action") val action: Action,
17+
18+
/** Operation arguments (varies with specified `action`). */
19+
@SerialName(value = "body") val body: JsonObject,
20+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */
2+
package com.algolia.client.model.ingestion
3+
4+
import kotlinx.serialization.*
5+
import kotlinx.serialization.json.*
6+
7+
/**
8+
* Batch parameters.
9+
*
10+
* @param requests
11+
*/
12+
@Serializable
13+
public data class BatchWriteParams(
14+
15+
@SerialName(value = "requests") val requests: List<BatchRequest>,
16+
)

0 commit comments

Comments
 (0)