Skip to content

Commit

Permalink
feat(specs): add notification settings to tasks [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4297

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 Jan 6, 2025
1 parent a61fcd7 commit 94a2179
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -816,11 +816,12 @@ public class IngestionClient(
* @param sourceType Filters the tasks with the specified source type.
* @param destinationID Destination IDs for filtering the list of tasks.
* @param triggerType Type of task trigger for filtering the list of tasks.
* @param withEmailNotifications If specified, the response only includes tasks with notifications.email.enabled set to this value.
* @param sort Property by which to sort the list of tasks. (default to createdAt)
* @param order Sort order of the response, ascending or descending. (default to desc)
* @param requestOptions additional request configuration.
*/
public suspend fun listTasks(itemsPerPage: Int? = null, page: Int? = null, action: List<ActionType>? = null, enabled: Boolean? = null, sourceID: List<String>? = null, sourceType: List<SourceType>? = null, destinationID: List<String>? = null, triggerType: List<TriggerType>? = null, sort: TaskSortKeys? = null, order: OrderKeys? = null, requestOptions: RequestOptions? = null): ListTasksResponse {
public suspend fun listTasks(itemsPerPage: Int? = null, page: Int? = null, action: List<ActionType>? = null, enabled: Boolean? = null, sourceID: List<String>? = null, sourceType: List<SourceType>? = null, destinationID: List<String>? = null, triggerType: List<TriggerType>? = null, withEmailNotifications: Boolean? = null, sort: TaskSortKeys? = null, order: OrderKeys? = null, requestOptions: RequestOptions? = null): ListTasksResponse {
val requestConfig = RequestConfig(
method = RequestMethod.GET,
path = listOf("2", "tasks"),
Expand All @@ -833,6 +834,7 @@ public class IngestionClient(
sourceType?.let { put("sourceType", it.joinToString(",")) }
destinationID?.let { put("destinationID", it.joinToString(",")) }
triggerType?.let { put("triggerType", it.joinToString(",")) }
withEmailNotifications?.let { put("withEmailNotifications", it) }
sort?.let { put("sort", it) }
order?.let { put("order", it) }
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** 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.*

/**
* EmailNotifications
*
* @param enabled Whether to send email notifications, note that this doesn't prevent the task from being blocked.
*/
@Serializable
public data class EmailNotifications(

/** Whether to send email notifications, note that this doesn't prevent the task from being blocked. */
@SerialName(value = "enabled") val enabled: Boolean? = null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** 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.*

/**
* Notifications settings for a task.
*
* @param email
*/
@Serializable
public data class Notifications(

@SerialName(value = "email") val email: EmailNotifications,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** 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.*

/**
* Set of rules for a task.
*
* @param criticalThreshold The number of critical failures in a row before blocking the task and sending a notification.
*/
@Serializable
public data class Policies(

/** The number of critical failures in a row before blocking the task and sending a notification. */
@SerialName(value = "criticalThreshold") val criticalThreshold: Int? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import kotlinx.serialization.json.*
* @param failureThreshold Maximum accepted percentage of failures for a task run to finish successfully.
* @param action
* @param cursor Date of the last cursor in RFC 3339 format.
* @param notifications
* @param policies
* @param updatedAt Date of last update in RFC 3339 format.
*/
@Serializable
Expand Down Expand Up @@ -58,6 +60,10 @@ public data class Task(
/** Date of the last cursor in RFC 3339 format. */
@SerialName(value = "cursor") val cursor: String? = null,

@SerialName(value = "notifications") val notifications: Notifications? = null,

@SerialName(value = "policies") val policies: Policies? = null,

/** Date of last update in RFC 3339 format. */
@SerialName(value = "updatedAt") val updatedAt: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import kotlinx.serialization.json.*
* @param failureThreshold Maximum accepted percentage of failures for a task run to finish successfully.
* @param input
* @param cursor Date of the last cursor in RFC 3339 format.
* @param notifications
* @param policies
*/
@Serializable
public data class TaskCreate(
Expand All @@ -40,4 +42,8 @@ public data class TaskCreate(

/** Date of the last cursor in RFC 3339 format. */
@SerialName(value = "cursor") val cursor: String? = null,

@SerialName(value = "notifications") val notifications: Notifications? = null,

@SerialName(value = "policies") val policies: Policies? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import kotlinx.serialization.json.*
* @param input
* @param enabled Whether the task is enabled.
* @param failureThreshold Maximum accepted percentage of failures for a task run to finish successfully.
* @param notifications
* @param policies
*/
@Serializable
public data class TaskUpdate(
Expand All @@ -29,4 +31,8 @@ public data class TaskUpdate(

/** Maximum accepted percentage of failures for a task run to finish successfully. */
@SerialName(value = "failureThreshold") val failureThreshold: Int? = null,

@SerialName(value = "notifications") val notifications: Notifications? = null,

@SerialName(value = "policies") val policies: Policies? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import kotlinx.serialization.json.*
* @param failureThreshold Maximum accepted percentage of failures for a task run to finish successfully.
* @param action
* @param cursor Date of the last cursor in RFC 3339 format.
* @param notifications
* @param policies
* @param updatedAt Date of last update in RFC 3339 format.
*/
@Deprecated(message = "This schema is deprecated.")
Expand Down Expand Up @@ -50,6 +52,10 @@ public data class TaskV1(
/** Date of the last cursor in RFC 3339 format. */
@SerialName(value = "cursor") val cursor: String? = null,

@SerialName(value = "notifications") val notifications: Notifications? = null,

@SerialName(value = "policies") val policies: Policies? = null,

/** Date of last update in RFC 3339 format. */
@SerialName(value = "updatedAt") val updatedAt: String? = null,
)

0 comments on commit 94a2179

Please sign in to comment.