Skip to content

Commit 413ffe5

Browse files
committed
Release: v6.1.0
- Added support for `reqlExpressions` on recommended item segments
1 parent f76f28a commit 413ffe5

File tree

6 files changed

+310
-6
lines changed

6 files changed

+310
-6
lines changed

Src/Recombee.ApiClient/ApiRequests/RecommendItemSegmentsToItem.cs

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,45 @@ public bool? ReturnAbGroup
110110
{
111111
get {return returnAbGroup;}
112112
}
113+
private readonly Dictionary<string, string> reqlExpressions;
114+
/// <summary>A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
115+
/// This can be used to compute additional properties of the recommended Item Segments.
116+
/// The keys are the names of the expressions, and the values are the actual ReQL expressions.
117+
/// Example request:
118+
/// ```json
119+
/// {
120+
/// "reqlExpressions": {
121+
/// "countItems": "size(segment_items(\"categories\", 'segmentId'))"
122+
/// }
123+
/// }
124+
/// ```
125+
/// Example response:
126+
/// ```json
127+
/// {
128+
/// "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
129+
/// "recomms":
130+
/// [
131+
/// {
132+
/// "id": "category-fantasy-books",
133+
/// "reqlEvaluations": {
134+
/// "countItems": 486
135+
/// }
136+
/// },
137+
/// {
138+
/// "id": "category-sci-fi-costumes",
139+
/// "reqlEvaluations": {
140+
/// "countItems": 19
141+
/// }
142+
/// }
143+
/// ],
144+
/// "numberNextRecommsCalls": 0
145+
/// }
146+
/// ```
147+
/// </summary>
148+
public Dictionary<string, string> ReqlExpressions
149+
{
150+
get {return reqlExpressions;}
151+
}
113152

114153
/// <summary>Construct the request</summary>
115154
/// <param name="itemId">ID of the item for which the recommendations are to be generated.</param>
@@ -148,7 +187,41 @@ public bool? ReturnAbGroup
148187
/// </param>
149188
/// <param name="returnAbGroup">If there is a custom AB-testing running, return the name of the group to which the request belongs.
150189
/// </param>
151-
public RecommendItemSegmentsToItem (string itemId, string targetUserId, long count, string scenario = null, bool? cascadeCreate = null, string filter = null, string booster = null, Logic logic = null, Dictionary<string, object> expertSettings = null, bool? returnAbGroup = null): base(HttpMethod.Post, 3000)
190+
/// <param name="reqlExpressions">A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
191+
/// This can be used to compute additional properties of the recommended Item Segments.
192+
/// The keys are the names of the expressions, and the values are the actual ReQL expressions.
193+
/// Example request:
194+
/// ```json
195+
/// {
196+
/// "reqlExpressions": {
197+
/// "countItems": "size(segment_items(\"categories\", 'segmentId'))"
198+
/// }
199+
/// }
200+
/// ```
201+
/// Example response:
202+
/// ```json
203+
/// {
204+
/// "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
205+
/// "recomms":
206+
/// [
207+
/// {
208+
/// "id": "category-fantasy-books",
209+
/// "reqlEvaluations": {
210+
/// "countItems": 486
211+
/// }
212+
/// },
213+
/// {
214+
/// "id": "category-sci-fi-costumes",
215+
/// "reqlEvaluations": {
216+
/// "countItems": 19
217+
/// }
218+
/// }
219+
/// ],
220+
/// "numberNextRecommsCalls": 0
221+
/// }
222+
/// ```
223+
/// </param>
224+
public RecommendItemSegmentsToItem (string itemId, string targetUserId, long count, string scenario = null, bool? cascadeCreate = null, string filter = null, string booster = null, Logic logic = null, Dictionary<string, object> expertSettings = null, bool? returnAbGroup = null, Dictionary<string, string> reqlExpressions = null): base(HttpMethod.Post, 3000)
152225
{
153226
this.itemId = itemId;
154227
this.targetUserId = targetUserId;
@@ -160,6 +233,7 @@ public RecommendItemSegmentsToItem (string itemId, string targetUserId, long cou
160233
this.logic = logic;
161234
this.expertSettings = expertSettings;
162235
this.returnAbGroup = returnAbGroup;
236+
this.reqlExpressions = reqlExpressions;
163237
}
164238

165239
/// <returns>URI to the endpoint including path parameters</returns>
@@ -202,6 +276,8 @@ public override Dictionary<string, object> BodyParameters()
202276
parameters["expertSettings"] = this.ExpertSettings;
203277
if (this.ReturnAbGroup.HasValue)
204278
parameters["returnAbGroup"] = this.ReturnAbGroup.Value;
279+
if (this.ReqlExpressions != null)
280+
parameters["reqlExpressions"] = this.ReqlExpressions;
205281
return parameters;
206282
}
207283

Src/Recombee.ApiClient/ApiRequests/RecommendItemSegmentsToItemSegment.cs

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,45 @@ public bool? ReturnAbGroup
109109
{
110110
get {return returnAbGroup;}
111111
}
112+
private readonly Dictionary<string, string> reqlExpressions;
113+
/// <summary>A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
114+
/// This can be used to compute additional properties of the recommended Item Segments.
115+
/// The keys are the names of the expressions, and the values are the actual ReQL expressions.
116+
/// Example request:
117+
/// ```json
118+
/// {
119+
/// "reqlExpressions": {
120+
/// "countItems": "size(segment_items(\"categories\", 'segmentId'))"
121+
/// }
122+
/// }
123+
/// ```
124+
/// Example response:
125+
/// ```json
126+
/// {
127+
/// "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
128+
/// "recomms":
129+
/// [
130+
/// {
131+
/// "id": "category-fantasy-books",
132+
/// "reqlEvaluations": {
133+
/// "countItems": 486
134+
/// }
135+
/// },
136+
/// {
137+
/// "id": "category-sci-fi-costumes",
138+
/// "reqlEvaluations": {
139+
/// "countItems": 19
140+
/// }
141+
/// }
142+
/// ],
143+
/// "numberNextRecommsCalls": 0
144+
/// }
145+
/// ```
146+
/// </summary>
147+
public Dictionary<string, string> ReqlExpressions
148+
{
149+
get {return reqlExpressions;}
150+
}
112151

113152
/// <summary>Construct the request</summary>
114153
/// <param name="contextSegmentId">ID of the segment from `contextSegmentationId` for which the recommendations are to be generated.</param>
@@ -147,7 +186,41 @@ public bool? ReturnAbGroup
147186
/// </param>
148187
/// <param name="returnAbGroup">If there is a custom AB-testing running, return the name of the group to which the request belongs.
149188
/// </param>
150-
public RecommendItemSegmentsToItemSegment (string contextSegmentId, string targetUserId, long count, string scenario = null, bool? cascadeCreate = null, string filter = null, string booster = null, Logic logic = null, Dictionary<string, object> expertSettings = null, bool? returnAbGroup = null): base(HttpMethod.Post, 3000)
189+
/// <param name="reqlExpressions">A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
190+
/// This can be used to compute additional properties of the recommended Item Segments.
191+
/// The keys are the names of the expressions, and the values are the actual ReQL expressions.
192+
/// Example request:
193+
/// ```json
194+
/// {
195+
/// "reqlExpressions": {
196+
/// "countItems": "size(segment_items(\"categories\", 'segmentId'))"
197+
/// }
198+
/// }
199+
/// ```
200+
/// Example response:
201+
/// ```json
202+
/// {
203+
/// "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
204+
/// "recomms":
205+
/// [
206+
/// {
207+
/// "id": "category-fantasy-books",
208+
/// "reqlEvaluations": {
209+
/// "countItems": 486
210+
/// }
211+
/// },
212+
/// {
213+
/// "id": "category-sci-fi-costumes",
214+
/// "reqlEvaluations": {
215+
/// "countItems": 19
216+
/// }
217+
/// }
218+
/// ],
219+
/// "numberNextRecommsCalls": 0
220+
/// }
221+
/// ```
222+
/// </param>
223+
public RecommendItemSegmentsToItemSegment (string contextSegmentId, string targetUserId, long count, string scenario = null, bool? cascadeCreate = null, string filter = null, string booster = null, Logic logic = null, Dictionary<string, object> expertSettings = null, bool? returnAbGroup = null, Dictionary<string, string> reqlExpressions = null): base(HttpMethod.Post, 3000)
151224
{
152225
this.contextSegmentId = contextSegmentId;
153226
this.targetUserId = targetUserId;
@@ -159,6 +232,7 @@ public RecommendItemSegmentsToItemSegment (string contextSegmentId, string targe
159232
this.logic = logic;
160233
this.expertSettings = expertSettings;
161234
this.returnAbGroup = returnAbGroup;
235+
this.reqlExpressions = reqlExpressions;
162236
}
163237

164238
/// <returns>URI to the endpoint including path parameters</returns>
@@ -202,6 +276,8 @@ public override Dictionary<string, object> BodyParameters()
202276
parameters["expertSettings"] = this.ExpertSettings;
203277
if (this.ReturnAbGroup.HasValue)
204278
parameters["returnAbGroup"] = this.ReturnAbGroup.Value;
279+
if (this.ReqlExpressions != null)
280+
parameters["reqlExpressions"] = this.ReqlExpressions;
205281
return parameters;
206282
}
207283

Src/Recombee.ApiClient/ApiRequests/RecommendItemSegmentsToUser.cs

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,45 @@ public bool? ReturnAbGroup
9191
{
9292
get {return returnAbGroup;}
9393
}
94+
private readonly Dictionary<string, string> reqlExpressions;
95+
/// <summary>A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
96+
/// This can be used to compute additional properties of the recommended Item Segments.
97+
/// The keys are the names of the expressions, and the values are the actual ReQL expressions.
98+
/// Example request:
99+
/// ```json
100+
/// {
101+
/// "reqlExpressions": {
102+
/// "countItems": "size(segment_items(\"categories\", 'segmentId'))"
103+
/// }
104+
/// }
105+
/// ```
106+
/// Example response:
107+
/// ```json
108+
/// {
109+
/// "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
110+
/// "recomms":
111+
/// [
112+
/// {
113+
/// "id": "category-fantasy-books",
114+
/// "reqlEvaluations": {
115+
/// "countItems": 486
116+
/// }
117+
/// },
118+
/// {
119+
/// "id": "category-sci-fi-costumes",
120+
/// "reqlEvaluations": {
121+
/// "countItems": 19
122+
/// }
123+
/// }
124+
/// ],
125+
/// "numberNextRecommsCalls": 0
126+
/// }
127+
/// ```
128+
/// </summary>
129+
public Dictionary<string, string> ReqlExpressions
130+
{
131+
get {return reqlExpressions;}
132+
}
94133

95134
/// <summary>Construct the request</summary>
96135
/// <param name="userId">ID of the user for whom personalized recommendations are to be generated.</param>
@@ -115,7 +154,41 @@ public bool? ReturnAbGroup
115154
/// </param>
116155
/// <param name="returnAbGroup">If there is a custom AB-testing running, return the name of the group to which the request belongs.
117156
/// </param>
118-
public RecommendItemSegmentsToUser (string userId, long count, string scenario = null, bool? cascadeCreate = null, string filter = null, string booster = null, Logic logic = null, Dictionary<string, object> expertSettings = null, bool? returnAbGroup = null): base(HttpMethod.Post, 3000)
157+
/// <param name="reqlExpressions">A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
158+
/// This can be used to compute additional properties of the recommended Item Segments.
159+
/// The keys are the names of the expressions, and the values are the actual ReQL expressions.
160+
/// Example request:
161+
/// ```json
162+
/// {
163+
/// "reqlExpressions": {
164+
/// "countItems": "size(segment_items(\"categories\", 'segmentId'))"
165+
/// }
166+
/// }
167+
/// ```
168+
/// Example response:
169+
/// ```json
170+
/// {
171+
/// "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
172+
/// "recomms":
173+
/// [
174+
/// {
175+
/// "id": "category-fantasy-books",
176+
/// "reqlEvaluations": {
177+
/// "countItems": 486
178+
/// }
179+
/// },
180+
/// {
181+
/// "id": "category-sci-fi-costumes",
182+
/// "reqlEvaluations": {
183+
/// "countItems": 19
184+
/// }
185+
/// }
186+
/// ],
187+
/// "numberNextRecommsCalls": 0
188+
/// }
189+
/// ```
190+
/// </param>
191+
public RecommendItemSegmentsToUser (string userId, long count, string scenario = null, bool? cascadeCreate = null, string filter = null, string booster = null, Logic logic = null, Dictionary<string, object> expertSettings = null, bool? returnAbGroup = null, Dictionary<string, string> reqlExpressions = null): base(HttpMethod.Post, 3000)
119192
{
120193
this.userId = userId;
121194
this.count = count;
@@ -126,6 +199,7 @@ public RecommendItemSegmentsToUser (string userId, long count, string scenario =
126199
this.logic = logic;
127200
this.expertSettings = expertSettings;
128201
this.returnAbGroup = returnAbGroup;
202+
this.reqlExpressions = reqlExpressions;
129203
}
130204

131205
/// <returns>URI to the endpoint including path parameters</returns>
@@ -167,6 +241,8 @@ public override Dictionary<string, object> BodyParameters()
167241
parameters["expertSettings"] = this.ExpertSettings;
168242
if (this.ReturnAbGroup.HasValue)
169243
parameters["returnAbGroup"] = this.ReturnAbGroup.Value;
244+
if (this.ReqlExpressions != null)
245+
parameters["reqlExpressions"] = this.ReqlExpressions;
170246
return parameters;
171247
}
172248

0 commit comments

Comments
 (0)