Skip to content

Commit ed32815

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 1f34268 commit ed32815

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/** A/B Testing API The Algolia A/B Testing API lets you manage your Algolia A/B tests to optimize your search
2+
* experience. ## Base URLs The base URLs for requests to the A/B testing API are: - `https://analytics.us.algolia.com`
3+
* (alias: `https://analytics.algolia.com`) - `https://analytics.de.algolia.com` Use the URL that matches your
4+
* [analytics region](https://dashboard.algolia.com/account/infrastructure/analytics). **All requests must use HTTPS.**
5+
* ## Availability and authentication Access to the A/B testing API is available as part of the [Premium or Elevate
6+
* plans](https://www.algolia.com/pricing). To authenticate your API requests, add these headers: -
7+
* `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the necessary
8+
* permissions to make the request. The required access control list (ACL) to make a request is listed in each
9+
* endpoint's reference. You can find your application ID and API key in the [Algolia
10+
* dashboard](https://dashboard.algolia.com/account). ## Rate limits You can make up to **100 requests per minute per
11+
* app** to the A/B testing API. The response includes headers with information about the limits. ## Parameters Query
12+
* parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII
13+
* characters must be UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. ## Response status and errors The
14+
* A/B testing API returns JSON responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order
15+
* of attributes in the API response. Successful responses return a `2xx` status. Client errors return a `4xx` status.
16+
* Server errors are indicated by a `5xx` status. Error responses have a `message` property with more information. ##
17+
* Version The current version of the A/B Testing API is version 2, as indicated by the `/2/` in each endpoint's URL.
18+
*
19+
* The version of the OpenAPI document: 2.0.0
20+
*
21+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22+
* https://openapi-generator.tech Do not edit the class manually.
23+
*/
24+
package algoliasearch.abtesting
25+
26+
/** ScheduleABTestResponse
27+
*
28+
* @param abTestScheduleID
29+
* Unique scheduled A/B test identifier.
30+
*/
31+
case class ScheduleABTestResponse(
32+
abTestScheduleID: Int
33+
)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/** A/B Testing API The Algolia A/B Testing API lets you manage your Algolia A/B tests to optimize your search
2+
* experience. ## Base URLs The base URLs for requests to the A/B testing API are: - `https://analytics.us.algolia.com`
3+
* (alias: `https://analytics.algolia.com`) - `https://analytics.de.algolia.com` Use the URL that matches your
4+
* [analytics region](https://dashboard.algolia.com/account/infrastructure/analytics). **All requests must use HTTPS.**
5+
* ## Availability and authentication Access to the A/B testing API is available as part of the [Premium or Elevate
6+
* plans](https://www.algolia.com/pricing). To authenticate your API requests, add these headers: -
7+
* `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the necessary
8+
* permissions to make the request. The required access control list (ACL) to make a request is listed in each
9+
* endpoint's reference. You can find your application ID and API key in the [Algolia
10+
* dashboard](https://dashboard.algolia.com/account). ## Rate limits You can make up to **100 requests per minute per
11+
* app** to the A/B testing API. The response includes headers with information about the limits. ## Parameters Query
12+
* parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII
13+
* characters must be UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. ## Response status and errors The
14+
* A/B testing API returns JSON responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order
15+
* of attributes in the API response. Successful responses return a `2xx` status. Client errors return a `4xx` status.
16+
* Server errors are indicated by a `5xx` status. Error responses have a `message` property with more information. ##
17+
* Version The current version of the A/B Testing API is version 2, as indicated by the `/2/` in each endpoint's URL.
18+
*
19+
* The version of the OpenAPI document: 2.0.0
20+
*
21+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22+
* https://openapi-generator.tech Do not edit the class manually.
23+
*/
24+
package algoliasearch.abtesting
25+
26+
/** ScheduleABTestsRequest
27+
*
28+
* @param name
29+
* A/B test name.
30+
* @param variants
31+
* A/B test variants.
32+
* @param scheduledAt
33+
* Date and time when the A/B test is scheduled to start, in RFC 3339 format.
34+
* @param endAt
35+
* End date and time of the A/B test, in RFC 3339 format.
36+
*/
37+
case class ScheduleABTestsRequest(
38+
name: String,
39+
variants: Seq[AddABTestsVariant],
40+
scheduledAt: String,
41+
endAt: String
42+
)

src/main/scala/algoliasearch/api/AbtestingClient.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import algoliasearch.abtesting.ABTestResponse
88
import algoliasearch.abtesting.AddABTestsRequest
99
import algoliasearch.abtesting.ErrorBase
1010
import algoliasearch.abtesting.ListABTestsResponse
11+
import algoliasearch.abtesting.ScheduleABTestResponse
12+
import algoliasearch.abtesting.ScheduleABTestsRequest
1113
import algoliasearch.abtesting._
1214
import algoliasearch.ApiClient
1315
import algoliasearch.api.AbtestingClient.hosts
@@ -261,6 +263,28 @@ class AbtestingClient(
261263
execute[ListABTestsResponse](request, requestOptions)
262264
}
263265

266+
/** Schedule an A/B test to be started at a later time.
267+
*
268+
* Required API Key ACLs:
269+
* - editSettings
270+
*/
271+
def scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest, requestOptions: Option[RequestOptions] = None)(
272+
implicit ec: ExecutionContext
273+
): Future[ScheduleABTestResponse] = Future {
274+
requireNotNull(
275+
scheduleABTestsRequest,
276+
"Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`."
277+
)
278+
279+
val request = HttpRequest
280+
.builder()
281+
.withMethod("POST")
282+
.withPath(s"/2/abtests/schedule")
283+
.withBody(scheduleABTestsRequest)
284+
.build()
285+
execute[ScheduleABTestResponse](request, requestOptions)
286+
}
287+
264288
/** Stops an A/B test by its ID. You can't restart stopped A/B tests.
265289
*
266290
* Required API Key ACLs:

0 commit comments

Comments
 (0)