Skip to content

Commit 9928474

Browse files
algolia-botmillotp
andcommitted
feat(specs): add runSource endpoint (generated)
algolia/api-clients-automation#3453 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent fe30936 commit 9928474

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-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
@@ -926,6 +926,30 @@ public class IngestionClient(
926926
)
927927
}
928928

929+
/**
930+
* Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
931+
*
932+
* Required API Key ACLs:
933+
* - addObject
934+
* - deleteIndex
935+
* - editSettings
936+
* @param sourceID Unique identifier of a source.
937+
* @param runSourcePayload
938+
* @param requestOptions additional request configuration.
939+
*/
940+
public suspend fun runSource(sourceID: String, runSourcePayload: RunSourcePayload? = null, requestOptions: RequestOptions? = null): RunSourceResponse {
941+
require(sourceID.isNotBlank()) { "Parameter `sourceID` is required when calling `runSource`." }
942+
val requestConfig = RequestConfig(
943+
method = RequestMethod.POST,
944+
path = listOf("1", "sources", "$sourceID", "run"),
945+
body = runSourcePayload,
946+
)
947+
return requester.execute(
948+
requestConfig = requestConfig,
949+
requestOptions = requestOptions,
950+
)
951+
}
952+
929953
/**
930954
* Runs a task. You can check the status of task runs with the observability endpoints.
931955
*
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 entity to update.
8+
*/
9+
@Serializable
10+
public enum class EntityType(public val value: kotlin.String) {
11+
12+
@SerialName(value = "product")
13+
Product("product"),
14+
15+
@SerialName(value = "collection")
16+
Collection("collection");
17+
18+
override fun toString(): kotlin.String = value
19+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
* RunSourcePayload
9+
*
10+
* @param indexToInclude List of index names to include in reidexing/update.
11+
* @param indexToExclude List of index names to exclude in reidexing/update.
12+
* @param entityIDs List of entityID to update.
13+
* @param entityType
14+
*/
15+
@Serializable
16+
public data class RunSourcePayload(
17+
18+
/** List of index names to include in reidexing/update. */
19+
@SerialName(value = "indexToInclude") val indexToInclude: List<String>? = null,
20+
21+
/** List of index names to exclude in reidexing/update. */
22+
@SerialName(value = "indexToExclude") val indexToExclude: List<String>? = null,
23+
24+
/** List of entityID to update. */
25+
@SerialName(value = "entityIDs") val entityIDs: List<String>? = null,
26+
27+
@SerialName(value = "entityType") val entityType: EntityType? = null,
28+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
* RunSourceResponse
9+
*
10+
* @param taskWithRunID Map of taskID sent for reindex with the corresponding runID.
11+
* @param createdAt Date of creation in RFC 3339 format.
12+
*/
13+
@Serializable
14+
public data class RunSourceResponse(
15+
16+
/** Map of taskID sent for reindex with the corresponding runID. */
17+
@SerialName(value = "taskWithRunID") val taskWithRunID: Map<kotlin.String, String>,
18+
19+
/** Date of creation in RFC 3339 format. */
20+
@SerialName(value = "createdAt") val createdAt: String,
21+
)

0 commit comments

Comments
 (0)