Skip to content

Commit 1c0a8e5

Browse files
committed
add realtime to config
1 parent 9a3935c commit 1c0a8e5

File tree

7 files changed

+46
-2
lines changed

7 files changed

+46
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Feature not enabled.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: '../schemas/ErrorResponses.yml#/featureNotEnabled'

Diff for: specs/advanced-personalization/common/schemas/Configuration.yml

+13
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,16 @@ status:
7474
$ref: '../enums.yml#/errorCodes'
7575
lastUpdatedAt:
7676
type: string
77+
78+
features:
79+
type: object
80+
properties:
81+
realtime:
82+
$ref: '#/realtime'
83+
84+
realtime:
85+
type: object
86+
properties:
87+
enabled:
88+
type: bool
89+
description: Whether the realtime personalization feature is enabled.

Diff for: specs/advanced-personalization/common/schemas/ConfigurationObject.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ configurationObject:
3838
$ref: './Configuration.yml#/profileType'
3939
status:
4040
$ref: './Configuration.yml#/status'
41-
required: [indices, personalzationReRanking, profileType, status]
41+
features:
42+
$ref: './Configuration.yml#/features'
43+
required: [indices, personalzationReRanking, profileType, status, features]

Diff for: specs/advanced-personalization/common/schemas/ErrorCodes.yml

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ unauthorized:
88
description: HTTP status code for an authorization error.
99
enum: [401]
1010

11+
paymentRequired:
12+
type: integer
13+
description: HTTP status code for a payment required error.
14+
enum: [402]
15+
1116
notFound:
1217
type: integer
1318
description: HTTP status code for a not found error.

Diff for: specs/advanced-personalization/common/schemas/ErrorMessages.yml

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ unauthorized:
1313
description: Details about the response, such as error messages.
1414
enum: [Unauthorized]
1515

16+
featureNotEnabled:
17+
type: string
18+
description: Details about the response, such as error messages.
19+
enum:
20+
- "Predictive profiles are not allowed for this app. Please contact support to upgrade your plan: https://support.algolia.com/"
21+
- "Realtime Personalization is not allowed for this app. Please contact support to upgrade your plan: https://support.algolia.com/"
22+
1623
genericNotFound:
1724
type: string
1825
description: Details about the response, such as error messages.

Diff for: specs/advanced-personalization/common/schemas/ErrorResponses.yml

+8
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ internalServerError:
5353
$ref: './ErrorCodes.yml#/internalServerError'
5454
message:
5555
$ref: './ErrorMessages.yml#/internalServerError'
56+
57+
featureNotEnabled:
58+
type: object
59+
properties:
60+
status:
61+
$ref: './ErrorCodes.yml#/paymentRequired'
62+
message:
63+
$ref: './ErrorMessages.yml#/featureNotEnabled'

Diff for: specs/advanced-personalization/paths/config.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ put:
6767
$ref: '../common/schemas/Configuration.yml#/personalizationReRanking'
6868
profileType:
6969
$ref: '../common/schemas/Configuration.yml#/profileType'
70-
required: [indices, personalizationReRanking, profileType]
70+
features:
71+
$ref: '../common/schemas/Configuration.yml#/features'
72+
required: [indices, personalizationReRanking, profileType, features]
7173
responses:
7274
'200':
7375
description: OK
@@ -94,5 +96,7 @@ put:
9496
$ref: '../common/responses/BadRequest.yml'
9597
'401':
9698
$ref: '../common/responses/Unauthorized.yml'
99+
'402':
100+
$ref: '../common/responses/FeatureNotEnabled.yml'
97101
'500':
98102
$ref: '../common/responses/InternalServerError.yml'

0 commit comments

Comments
 (0)