Skip to content

Commit

Permalink
feat(specs): add runSource endpoint (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3453

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
algolia-bot and millotp committed Aug 2, 2024
1 parent fe30936 commit 9928474
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,30 @@ public class IngestionClient(
)
}

/**
* Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
*
* Required API Key ACLs:
* - addObject
* - deleteIndex
* - editSettings
* @param sourceID Unique identifier of a source.
* @param runSourcePayload
* @param requestOptions additional request configuration.
*/
public suspend fun runSource(sourceID: String, runSourcePayload: RunSourcePayload? = null, requestOptions: RequestOptions? = null): RunSourceResponse {
require(sourceID.isNotBlank()) { "Parameter `sourceID` is required when calling `runSource`." }
val requestConfig = RequestConfig(
method = RequestMethod.POST,
path = listOf("1", "sources", "$sourceID", "run"),
body = runSourcePayload,
)
return requester.execute(
requestConfig = requestConfig,
requestOptions = requestOptions,
)
}

/**
* Runs a task. You can check the status of task runs with the observability endpoints.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** 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. */
package com.algolia.client.model.ingestion

import kotlinx.serialization.*

/**
* Type of entity to update.
*/
@Serializable
public enum class EntityType(public val value: kotlin.String) {

@SerialName(value = "product")
Product("product"),

@SerialName(value = "collection")
Collection("collection");

override fun toString(): kotlin.String = value
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** 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. */
package com.algolia.client.model.ingestion

import kotlinx.serialization.*
import kotlinx.serialization.json.*

/**
* RunSourcePayload
*
* @param indexToInclude List of index names to include in reidexing/update.
* @param indexToExclude List of index names to exclude in reidexing/update.
* @param entityIDs List of entityID to update.
* @param entityType
*/
@Serializable
public data class RunSourcePayload(

/** List of index names to include in reidexing/update. */
@SerialName(value = "indexToInclude") val indexToInclude: List<String>? = null,

/** List of index names to exclude in reidexing/update. */
@SerialName(value = "indexToExclude") val indexToExclude: List<String>? = null,

/** List of entityID to update. */
@SerialName(value = "entityIDs") val entityIDs: List<String>? = null,

@SerialName(value = "entityType") val entityType: EntityType? = null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** 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. */
package com.algolia.client.model.ingestion

import kotlinx.serialization.*
import kotlinx.serialization.json.*

/**
* RunSourceResponse
*
* @param taskWithRunID Map of taskID sent for reindex with the corresponding runID.
* @param createdAt Date of creation in RFC 3339 format.
*/
@Serializable
public data class RunSourceResponse(

/** Map of taskID sent for reindex with the corresponding runID. */
@SerialName(value = "taskWithRunID") val taskWithRunID: Map<kotlin.String, String>,

/** Date of creation in RFC 3339 format. */
@SerialName(value = "createdAt") val createdAt: String,
)

0 comments on commit 9928474

Please sign in to comment.