Skip to content

Commit 3fece49

Browse files
feat(specs): add put task endpoint to ingestion api (generated)
algolia/api-clients-automation#5281 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 1661428 commit 3fece49

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,25 @@ public class IngestionClient(
987987
)
988988
}
989989

990+
/**
991+
* Fully updates a task by its ID, use partialUpdateTask if you only want to update a subset of fields.
992+
* @param taskID Unique identifier of a task.
993+
* @param taskReplace
994+
* @param requestOptions additional request configuration.
995+
*/
996+
public suspend fun replaceTask(taskID: String, taskReplace: TaskReplace, requestOptions: RequestOptions? = null): TaskUpdateResponse {
997+
require(taskID.isNotBlank()) { "Parameter `taskID` is required when calling `replaceTask`." }
998+
val requestConfig = RequestConfig(
999+
method = RequestMethod.PUT,
1000+
path = listOf("2", "tasks", "$taskID"),
1001+
body = taskReplace,
1002+
)
1003+
return requester.execute(
1004+
requestConfig = requestConfig,
1005+
requestOptions = requestOptions,
1006+
)
1007+
}
1008+
9901009
/**
9911010
* Runs all tasks linked to a source, only available for Shopify, BigCommerce and commercetools sources. Creates one run per task.
9921011
*
@@ -1338,7 +1357,7 @@ public class IngestionClient(
13381357
}
13391358

13401359
/**
1341-
* Updates a task by its ID.
1360+
* Partially updates a task by its ID.
13421361
* @param taskID Unique identifier of a task.
13431362
* @param taskUpdate
13441363
* @param requestOptions additional request configuration.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
* API request body for updating a task.
9+
*
10+
* @param destinationID Universally unique identifier (UUID) of a destination resource.
11+
* @param action
12+
* @param subscriptionAction
13+
* @param cron Cron expression for the task's schedule.
14+
* @param enabled Whether the task is enabled.
15+
* @param failureThreshold Maximum accepted percentage of failures for a task run to finish successfully.
16+
* @param input
17+
* @param cursor Date of the last cursor in RFC 3339 format.
18+
* @param notifications
19+
* @param policies
20+
*/
21+
@Serializable
22+
public data class TaskReplace(
23+
24+
/** Universally unique identifier (UUID) of a destination resource. */
25+
@SerialName(value = "destinationID") val destinationID: String,
26+
27+
@SerialName(value = "action") val action: ActionType,
28+
29+
@SerialName(value = "subscriptionAction") val subscriptionAction: ActionType? = null,
30+
31+
/** Cron expression for the task's schedule. */
32+
@SerialName(value = "cron") val cron: String? = null,
33+
34+
/** Whether the task is enabled. */
35+
@SerialName(value = "enabled") val enabled: Boolean? = null,
36+
37+
/** Maximum accepted percentage of failures for a task run to finish successfully. */
38+
@SerialName(value = "failureThreshold") val failureThreshold: Int? = null,
39+
40+
@SerialName(value = "input") val input: TaskInput? = null,
41+
42+
/** Date of the last cursor in RFC 3339 format. */
43+
@SerialName(value = "cursor") val cursor: String? = null,
44+
45+
@SerialName(value = "notifications") val notifications: Notifications? = null,
46+
47+
@SerialName(value = "policies") val policies: Policies? = null,
48+
)

client/src/commonMain/kotlin/com/algolia/client/model/ingestion/TaskUpdate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import kotlinx.serialization.*
55
import kotlinx.serialization.json.*
66

77
/**
8-
* API request body for updating a task.
8+
* API request body for partially updating a task.
99
*
1010
* @param destinationID Universally unique identifier (UUID) of a destination resource.
1111
* @param cron Cron expression for the task's schedule.

0 commit comments

Comments
 (0)