Skip to content

Commit 7538649

Browse files
algolia-botleonardogavaudanshortcuts
committed
fix(specs): Add customSearchParameters to Variant schema, and add direction query param for GET abtests (#5130) (generated) [skip ci]
Co-authored-by: Leonardo Gavaudan <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent d1596a8 commit 7538649

File tree

8 files changed

+113
-2
lines changed

8 files changed

+113
-2
lines changed

clients/algoliasearch-client-javascript/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
/**
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';

clients/algoliasearch-client-javascript/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';

clients/algoliasearch-client-javascript/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
};

clients/algoliasearch-client-javascript/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,

docs/bundled/abtesting-v3.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,15 @@
350350
"schema": {
351351
"type": "string"
352352
}
353+
},
354+
{
355+
"name": "direction",
356+
"in": "query",
357+
"description": "Sort order for A/B tests by start date.\nUse 'asc' for ascending or 'desc' for descending. Active A/B tests are always listed first.\n",
358+
"example": "desc",
359+
"schema": {
360+
"$ref": "#/components/schemas/direction"
361+
}
353362
}
354363
],
355364
"responses": {
@@ -932,6 +941,15 @@
932941
}
933942
}
934943
},
944+
"direction": {
945+
"type": "string",
946+
"description": "Sort order for A/B tests by start date.\nUse 'asc' for ascending or 'desc' for descending.\nActive A/B tests are always listed first.\n",
947+
"enum": [
948+
"asc",
949+
"desc"
950+
],
951+
"example": "desc"
952+
},
935953
"abTestID": {
936954
"type": "integer",
937955
"description": "Unique A/B test identifier.",
@@ -1180,6 +1198,14 @@
11801198
},
11811199
"metadata": {
11821200
"$ref": "#/components/schemas/variantMetadata"
1201+
},
1202+
"customSearchParameters": {
1203+
"type": "object",
1204+
"description": "Search parameters applied to this variant when the same index is used for multiple variants.\nOnly present if custom search parameters were provided during test creation.\n",
1205+
"example": {
1206+
"enablePersonalization": true,
1207+
"personalizationImpact": 50
1208+
}
11831209
}
11841210
},
11851211
"required": [

docs/bundled/abtesting-v3.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,16 @@ paths:
448448
example: _development
449449
schema:
450450
type: string
451+
- name: direction
452+
in: query
453+
description: >
454+
Sort order for A/B tests by start date.
455+
456+
Use 'asc' for ascending or 'desc' for descending. Active A/B tests
457+
are always listed first.
458+
example: desc
459+
schema:
460+
$ref: '#/components/schemas/direction'
451461
responses:
452462
'200':
453463
description: OK
@@ -513,7 +523,7 @@ paths:
513523
label: curl
514524
source: |-
515525
curl --request GET \
516-
--url 'https://analytics.us.algolia.com/3/abtests?offset=0&limit=10&indexPrefix=dev_&indexSuffix=_development' \
526+
--url 'https://analytics.us.algolia.com/3/abtests?offset=0&limit=10&indexPrefix=dev_&indexSuffix=_development&direction=desc' \
517527
--header 'accept: application/json' \
518528
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
519529
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'
@@ -1062,6 +1072,16 @@ components:
10621072
message:
10631073
type: string
10641074
example: Invalid Application-Id or API-Key
1075+
direction:
1076+
type: string
1077+
description: |
1078+
Sort order for A/B tests by start date.
1079+
Use 'asc' for ascending or 'desc' for descending.
1080+
Active A/B tests are always listed first.
1081+
enum:
1082+
- asc
1083+
- desc
1084+
example: desc
10651085
abTestID:
10661086
type: integer
10671087
description: Unique A/B test identifier.
@@ -1315,6 +1335,17 @@ components:
13151335
$ref: '#/components/schemas/metrics'
13161336
metadata:
13171337
$ref: '#/components/schemas/variantMetadata'
1338+
customSearchParameters:
1339+
type: object
1340+
description: >
1341+
Search parameters applied to this variant when the same index is
1342+
used for multiple variants.
1343+
1344+
Only present if custom search parameters were provided during test
1345+
creation.
1346+
example:
1347+
enablePersonalization: true
1348+
personalizationImpact: 50
13181349
required:
13191350
- index
13201351
- description

specs/bundled/abtesting-v3.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,16 @@ paths:
327327
example: _development
328328
schema:
329329
type: string
330+
- name: direction
331+
in: query
332+
description: >
333+
Sort order for A/B tests by start date.
334+
335+
Use 'asc' for ascending or 'desc' for descending. Active A/B tests
336+
are always listed first.
337+
example: desc
338+
schema:
339+
$ref: '#/components/schemas/direction'
330340
responses:
331341
'200':
332342
description: OK
@@ -732,6 +742,16 @@ components:
732742
message:
733743
type: string
734744
example: Invalid Application-Id or API-Key
745+
direction:
746+
type: string
747+
description: |
748+
Sort order for A/B tests by start date.
749+
Use 'asc' for ascending or 'desc' for descending.
750+
Active A/B tests are always listed first.
751+
enum:
752+
- asc
753+
- desc
754+
example: desc
735755
abTestID:
736756
type: integer
737757
description: Unique A/B test identifier.
@@ -985,6 +1005,17 @@ components:
9851005
$ref: '#/components/schemas/metrics'
9861006
metadata:
9871007
$ref: '#/components/schemas/variantMetadata'
1008+
customSearchParameters:
1009+
type: object
1010+
description: >
1011+
Search parameters applied to this variant when the same index is
1012+
used for multiple variants.
1013+
1014+
Only present if custom search parameters were provided during test
1015+
creation.
1016+
example:
1017+
enablePersonalization: true
1018+
personalizationImpact: 50
9881019
required:
9891020
- index
9901021
- description

0 commit comments

Comments
 (0)