Skip to content

Commit 8f59e05

Browse files
algolia-botfebeckmillotp
committed
feat(specs): add /schedule endpoint (generated)
algolia/api-clients-automation#3350 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Fernando Beck <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 6c33e05 commit 8f59e05

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,26 @@ public class AbtestingClient(
202202
)
203203
}
204204

205+
/**
206+
* Schedule an A/B test to be started at a later time.
207+
*
208+
* Required API Key ACLs:
209+
* - editSettings
210+
* @param scheduleABTestsRequest
211+
* @param requestOptions additional request configuration.
212+
*/
213+
public suspend fun scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions: RequestOptions? = null): ScheduleABTestResponse {
214+
val requestConfig = RequestConfig(
215+
method = RequestMethod.POST,
216+
path = listOf("2", "abtests", "schedule"),
217+
body = scheduleABTestsRequest,
218+
)
219+
return requester.execute(
220+
requestConfig = requestConfig,
221+
requestOptions = requestOptions,
222+
)
223+
}
224+
205225
/**
206226
* Stops an A/B test by its ID. You can't restart stopped A/B tests.
207227
*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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.abtesting
3+
4+
import kotlinx.serialization.*
5+
import kotlinx.serialization.json.*
6+
7+
/**
8+
* ScheduleABTestResponse
9+
*
10+
* @param abTestScheduleID Unique scheduled A/B test identifier.
11+
*/
12+
@Serializable
13+
public data class ScheduleABTestResponse(
14+
15+
/** Unique scheduled A/B test identifier. */
16+
@SerialName(value = "abTestScheduleID") val abTestScheduleID: Int,
17+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.abtesting
3+
4+
import kotlinx.serialization.*
5+
import kotlinx.serialization.json.*
6+
7+
/**
8+
* ScheduleABTestsRequest
9+
*
10+
* @param name A/B test name.
11+
* @param variants A/B test variants.
12+
* @param scheduledAt Date and time when the A/B test is scheduled to start, in RFC 3339 format.
13+
* @param endAt End date and time of the A/B test, in RFC 3339 format.
14+
*/
15+
@Serializable
16+
public data class ScheduleABTestsRequest(
17+
18+
/** A/B test name. */
19+
@SerialName(value = "name") val name: String,
20+
21+
/** A/B test variants. */
22+
@SerialName(value = "variants") val variants: List<AddABTestsVariant>,
23+
24+
/** Date and time when the A/B test is scheduled to start, in RFC 3339 format. */
25+
@SerialName(value = "scheduledAt") val scheduledAt: String,
26+
27+
/** End date and time of the A/B test, in RFC 3339 format. */
28+
@SerialName(value = "endAt") val endAt: String,
29+
)

0 commit comments

Comments
 (0)