@@ -46,6 +46,239 @@ private static List<Host> getDefaultHosts(String appId) {
46
46
return Stream .concat (hosts .stream (), commonHosts .stream ()).collect (Collectors .toList ());
47
47
}
48
48
49
+ /**
50
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated,
51
+ * depending on whether a Recommend Rule with the same `objectID` already exists. You may also
52
+ * specify `true` for `clearExistingRules`, in which case the batch will atomically replace all
53
+ * the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
54
+ * conditions and consequences apply to a [source
55
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
56
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
57
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
58
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
59
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
60
+ * match the data source item's attributes instead).
61
+ *
62
+ * @param indexName Name of the index on which to perform the operation. (required)
63
+ * @param model [Recommend
64
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
65
+ * (required)
66
+ * @param recommendRule (optional)
67
+ * @param requestOptions The requestOptions to send along with the query, they will be merged with
68
+ * the transporter requestOptions.
69
+ * @throws AlgoliaRuntimeException If it fails to process the API call
70
+ */
71
+ public RecommendUpdatedAtResponse batchRecommendRules (
72
+ @ Nonnull String indexName ,
73
+ @ Nonnull RecommendModels model ,
74
+ List <RecommendRule > recommendRule ,
75
+ RequestOptions requestOptions
76
+ ) throws AlgoliaRuntimeException {
77
+ return LaunderThrowable .await (batchRecommendRulesAsync (indexName , model , recommendRule , requestOptions ));
78
+ }
79
+
80
+ /**
81
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated,
82
+ * depending on whether a Recommend Rule with the same `objectID` already exists. You may also
83
+ * specify `true` for `clearExistingRules`, in which case the batch will atomically replace all
84
+ * the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
85
+ * conditions and consequences apply to a [source
86
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
87
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
88
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
89
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
90
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
91
+ * match the data source item's attributes instead).
92
+ *
93
+ * @param indexName Name of the index on which to perform the operation. (required)
94
+ * @param model [Recommend
95
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
96
+ * (required)
97
+ * @param recommendRule (optional)
98
+ * @throws AlgoliaRuntimeException If it fails to process the API call
99
+ */
100
+ public RecommendUpdatedAtResponse batchRecommendRules (
101
+ @ Nonnull String indexName ,
102
+ @ Nonnull RecommendModels model ,
103
+ List <RecommendRule > recommendRule
104
+ ) throws AlgoliaRuntimeException {
105
+ return this .batchRecommendRules (indexName , model , recommendRule , null );
106
+ }
107
+
108
+ /**
109
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated,
110
+ * depending on whether a Recommend Rule with the same `objectID` already exists. You may also
111
+ * specify `true` for `clearExistingRules`, in which case the batch will atomically replace all
112
+ * the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
113
+ * conditions and consequences apply to a [source
114
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
115
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
116
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
117
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
118
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
119
+ * match the data source item's attributes instead).
120
+ *
121
+ * @param indexName Name of the index on which to perform the operation. (required)
122
+ * @param model [Recommend
123
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
124
+ * (required)
125
+ * @param requestOptions The requestOptions to send along with the query, they will be merged with
126
+ * the transporter requestOptions.
127
+ * @throws AlgoliaRuntimeException If it fails to process the API call
128
+ */
129
+ public RecommendUpdatedAtResponse batchRecommendRules (
130
+ @ Nonnull String indexName ,
131
+ @ Nonnull RecommendModels model ,
132
+ RequestOptions requestOptions
133
+ ) throws AlgoliaRuntimeException {
134
+ return this .batchRecommendRules (indexName , model , null , requestOptions );
135
+ }
136
+
137
+ /**
138
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated,
139
+ * depending on whether a Recommend Rule with the same `objectID` already exists. You may also
140
+ * specify `true` for `clearExistingRules`, in which case the batch will atomically replace all
141
+ * the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
142
+ * conditions and consequences apply to a [source
143
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
144
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
145
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
146
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
147
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
148
+ * match the data source item's attributes instead).
149
+ *
150
+ * @param indexName Name of the index on which to perform the operation. (required)
151
+ * @param model [Recommend
152
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
153
+ * (required)
154
+ * @throws AlgoliaRuntimeException If it fails to process the API call
155
+ */
156
+ public RecommendUpdatedAtResponse batchRecommendRules (@ Nonnull String indexName , @ Nonnull RecommendModels model )
157
+ throws AlgoliaRuntimeException {
158
+ return this .batchRecommendRules (indexName , model , null , null );
159
+ }
160
+
161
+ /**
162
+ * (asynchronously) Create or update a batch of Recommend Rules Each Recommend Rule is created or
163
+ * updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may
164
+ * also specify `true` for `clearExistingRules`, in which case the batch will atomically replace
165
+ * all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
166
+ * conditions and consequences apply to a [source
167
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
168
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
169
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
170
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
171
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
172
+ * match the data source item's attributes instead).
173
+ *
174
+ * @param indexName Name of the index on which to perform the operation. (required)
175
+ * @param model [Recommend
176
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
177
+ * (required)
178
+ * @param recommendRule (optional)
179
+ * @param requestOptions The requestOptions to send along with the query, they will be merged with
180
+ * the transporter requestOptions.
181
+ * @throws AlgoliaRuntimeException If it fails to process the API call
182
+ */
183
+ public CompletableFuture <RecommendUpdatedAtResponse > batchRecommendRulesAsync (
184
+ @ Nonnull String indexName ,
185
+ @ Nonnull RecommendModels model ,
186
+ List <RecommendRule > recommendRule ,
187
+ RequestOptions requestOptions
188
+ ) throws AlgoliaRuntimeException {
189
+ Parameters .requireNonNull (indexName , "Parameter `indexName` is required when calling `batchRecommendRules`." );
190
+
191
+ Parameters .requireNonNull (model , "Parameter `model` is required when calling `batchRecommendRules`." );
192
+
193
+ HttpRequest request = HttpRequest .builder ()
194
+ .setPath ("/1/indexes/{indexName}/{model}/recommend/rules/batch" , indexName , model )
195
+ .setMethod ("POST" )
196
+ .setBody (recommendRule )
197
+ .build ();
198
+ return executeAsync (request , requestOptions , new TypeReference <RecommendUpdatedAtResponse >() {});
199
+ }
200
+
201
+ /**
202
+ * (asynchronously) Create or update a batch of Recommend Rules Each Recommend Rule is created or
203
+ * updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may
204
+ * also specify `true` for `clearExistingRules`, in which case the batch will atomically replace
205
+ * all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
206
+ * conditions and consequences apply to a [source
207
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
208
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
209
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
210
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
211
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
212
+ * match the data source item's attributes instead).
213
+ *
214
+ * @param indexName Name of the index on which to perform the operation. (required)
215
+ * @param model [Recommend
216
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
217
+ * (required)
218
+ * @param recommendRule (optional)
219
+ * @throws AlgoliaRuntimeException If it fails to process the API call
220
+ */
221
+ public CompletableFuture <RecommendUpdatedAtResponse > batchRecommendRulesAsync (
222
+ @ Nonnull String indexName ,
223
+ @ Nonnull RecommendModels model ,
224
+ List <RecommendRule > recommendRule
225
+ ) throws AlgoliaRuntimeException {
226
+ return this .batchRecommendRulesAsync (indexName , model , recommendRule , null );
227
+ }
228
+
229
+ /**
230
+ * (asynchronously) Create or update a batch of Recommend Rules Each Recommend Rule is created or
231
+ * updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may
232
+ * also specify `true` for `clearExistingRules`, in which case the batch will atomically replace
233
+ * all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
234
+ * conditions and consequences apply to a [source
235
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
236
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
237
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
238
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
239
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
240
+ * match the data source item's attributes instead).
241
+ *
242
+ * @param indexName Name of the index on which to perform the operation. (required)
243
+ * @param model [Recommend
244
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
245
+ * (required)
246
+ * @param requestOptions The requestOptions to send along with the query, they will be merged with
247
+ * the transporter requestOptions.
248
+ * @throws AlgoliaRuntimeException If it fails to process the API call
249
+ */
250
+ public CompletableFuture <RecommendUpdatedAtResponse > batchRecommendRulesAsync (
251
+ @ Nonnull String indexName ,
252
+ @ Nonnull RecommendModels model ,
253
+ RequestOptions requestOptions
254
+ ) throws AlgoliaRuntimeException {
255
+ return this .batchRecommendRulesAsync (indexName , model , null , requestOptions );
256
+ }
257
+
258
+ /**
259
+ * (asynchronously) Create or update a batch of Recommend Rules Each Recommend Rule is created or
260
+ * updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may
261
+ * also specify `true` for `clearExistingRules`, in which case the batch will atomically replace
262
+ * all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the
263
+ * conditions and consequences apply to a [source
264
+ * item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main
265
+ * differences are the following: - Conditions `pattern` and `anchoring` are unavailable. -
266
+ * Condition `filters` triggers if the source item matches the specified filters. - Condition
267
+ * `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. -
268
+ * Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to
269
+ * match the data source item's attributes instead).
270
+ *
271
+ * @param indexName Name of the index on which to perform the operation. (required)
272
+ * @param model [Recommend
273
+ * model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
274
+ * (required)
275
+ * @throws AlgoliaRuntimeException If it fails to process the API call
276
+ */
277
+ public CompletableFuture <RecommendUpdatedAtResponse > batchRecommendRulesAsync (@ Nonnull String indexName , @ Nonnull RecommendModels model )
278
+ throws AlgoliaRuntimeException {
279
+ return this .batchRecommendRulesAsync (indexName , model , null , null );
280
+ }
281
+
49
282
/**
50
283
* This method allow you to send requests to the Algolia REST API.
51
284
*
0 commit comments