Skip to content

Commit

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

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Fernando Beck <fe.beck25@gmail.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
3 people committed Aug 20, 2024
1 parent 6c33e05 commit 8f59e05
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,26 @@ public class AbtestingClient(
)
}

/**
* Schedule an A/B test to be started at a later time.
*
* Required API Key ACLs:
* - editSettings
* @param scheduleABTestsRequest
* @param requestOptions additional request configuration.
*/
public suspend fun scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions: RequestOptions? = null): ScheduleABTestResponse {
val requestConfig = RequestConfig(
method = RequestMethod.POST,
path = listOf("2", "abtests", "schedule"),
body = scheduleABTestsRequest,
)
return requester.execute(
requestConfig = requestConfig,
requestOptions = requestOptions,
)
}

/**
* Stops an A/B test by its ID. You can't restart stopped A/B tests.
*
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.abtesting

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

/**
* ScheduleABTestResponse
*
* @param abTestScheduleID Unique scheduled A/B test identifier.
*/
@Serializable
public data class ScheduleABTestResponse(

/** Unique scheduled A/B test identifier. */
@SerialName(value = "abTestScheduleID") val abTestScheduleID: Int,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** 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.abtesting

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

/**
* ScheduleABTestsRequest
*
* @param name A/B test name.
* @param variants A/B test variants.
* @param scheduledAt Date and time when the A/B test is scheduled to start, in RFC 3339 format.
* @param endAt End date and time of the A/B test, in RFC 3339 format.
*/
@Serializable
public data class ScheduleABTestsRequest(

/** A/B test name. */
@SerialName(value = "name") val name: String,

/** A/B test variants. */
@SerialName(value = "variants") val variants: List<AddABTestsVariant>,

/** Date and time when the A/B test is scheduled to start, in RFC 3339 format. */
@SerialName(value = "scheduledAt") val scheduledAt: String,

/** End date and time of the A/B test, in RFC 3339 format. */
@SerialName(value = "endAt") val endAt: String,
)

0 comments on commit 8f59e05

Please sign in to comment.