Skip to content

Commit 2f5e0ad

Browse files
algolia-botleonardogavaudanshortcuts
committed
fix(specs): Add customSearchParameters to Variant schema, and add direction query param for GET abtests (generated)
algolia/api-clients-automation#5130 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Leonardo Gavaudan <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 92a8ec8 commit 2f5e0ad

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

packages/abtesting/model/clientMethodProps.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// 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.
22

3+
import type { Direction } from '../model/direction';
4+
35
import type { MetricName } from '../model/metricName';
46

57
/**
@@ -128,6 +130,10 @@ export type ListABTestsProps = {
128130
* Index name suffix. Only A/B tests for indices ending with this string are included in the response.
129131
*/
130132
indexSuffix?: string | undefined;
133+
/**
134+
* Sort order for A/B tests by start date. Use \'asc\' for ascending or \'desc\' for descending. Active A/B tests are always listed first.
135+
*/
136+
direction?: Direction | undefined;
131137
};
132138

133139
/**

packages/abtesting/model/direction.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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+
3+
/**
4+
* Sort order for A/B tests by start date. Use \'asc\' for ascending or \'desc\' for descending. Active A/B tests are always listed first.
5+
*/
6+
export type Direction = 'asc' | 'desc';

packages/abtesting/model/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export * from './addABTestsVariant';
1010
export * from './clientMethodProps';
1111
export * from './createMetric';
1212
export * from './customSearchParams';
13+
export * from './direction';
1314
export * from './effectMetric';
1415
export * from './emptySearchFilter';
1516
export * from './errorBase';

packages/abtesting/model/variant.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ export type Variant = {
3030
metrics: Array<MetricResult>;
3131

3232
metadata?: VariantMetadata | undefined;
33+
34+
/**
35+
* Search parameters applied to this variant when the same index is used for multiple variants. Only present if custom search parameters were provided during test creation.
36+
*/
37+
customSearchParameters?: Record<string, unknown> | undefined;
3338
};

packages/abtesting/src/abtestingClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,11 @@ export function createAbtestingClient({
433433
* @param listABTests.limit - Number of items to return.
434434
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
435435
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
436+
* @param listABTests.direction - Sort order for A/B tests by start date. Use \'asc\' for ascending or \'desc\' for descending. Active A/B tests are always listed first.
436437
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
437438
*/
438439
listABTests(
439-
{ offset, limit, indexPrefix, indexSuffix }: ListABTestsProps = {},
440+
{ offset, limit, indexPrefix, indexSuffix, direction }: ListABTestsProps = {},
440441
requestOptions: RequestOptions | undefined = undefined,
441442
): Promise<ListABTestsResponse> {
442443
const requestPath = '/3/abtests';
@@ -459,6 +460,10 @@ export function createAbtestingClient({
459460
queryParameters['indexSuffix'] = indexSuffix.toString();
460461
}
461462

463+
if (direction !== undefined) {
464+
queryParameters['direction'] = direction.toString();
465+
}
466+
462467
const request: Request = {
463468
method: 'GET',
464469
path: requestPath,

0 commit comments

Comments
 (0)