Skip to content

Commit 5f041da

Browse files
chore: generated code for commit bf42712. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent bf42712 commit 5f041da

File tree

26 files changed

+373
-298
lines changed

26 files changed

+373
-298
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/ApiClient.java

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package com.algolia;
22

33
import com.algolia.exceptions.*;
4-
import com.algolia.utils.AlgoliaAgent;
5-
import com.algolia.utils.JSON;
6-
import com.algolia.utils.RequestOptions;
7-
import com.algolia.utils.Requester;
4+
import com.algolia.utils.*;
85
import java.io.IOException;
96
import java.io.UnsupportedEncodingException;
107
import java.lang.reflect.Type;
@@ -277,6 +274,8 @@ public void onResponse(Call call, Response response)
277274
* @param headerParams The header parameters
278275
* @param requestOptions The requestOptions to send along with the query, they will be merged with
279276
* the transporter requestOptions.
277+
* @param useReadTransporter Some POST methods in the Algolia REST API uses the `read`
278+
* transporter. This information is defined at the spec level.
280279
* @return The HTTP call
281280
* @throws AlgoliaRuntimeException If fail to serialize the request body object
282281
*/
@@ -286,15 +285,17 @@ public Call buildCall(
286285
Map<String, Object> queryParameters,
287286
Object body,
288287
Map<String, String> headerParams,
289-
RequestOptions requestOptions
288+
RequestOptions requestOptions,
289+
Boolean useReadTransporter
290290
) throws AlgoliaRuntimeException {
291291
Request request = buildRequest(
292292
path,
293293
method,
294294
queryParameters,
295295
body,
296296
headerParams,
297-
requestOptions
297+
requestOptions,
298+
useReadTransporter
298299
);
299300

300301
return requester.newCall(request);
@@ -311,6 +312,8 @@ public Call buildCall(
311312
* @param headerParams The header parameters
312313
* @param requestOptions The requestOptions to send along with the query, they will be merged with
313314
* the transporter requestOptions.
315+
* @param useReadTransporter Some POST methods in the Algolia REST API uses the `read`
316+
* transporter. This information is defined at the spec level.
314317
* @return The HTTP request
315318
* @throws AlgoliaRuntimeException If fail to serialize the request body object
316319
*/
@@ -320,7 +323,8 @@ public Request buildRequest(
320323
Map<String, Object> queryParameters,
321324
Object body,
322325
Map<String, String> headerParams,
323-
RequestOptions requestOptions
326+
RequestOptions requestOptions,
327+
Boolean useReadTransporter
324328
) throws AlgoliaRuntimeException {
325329
boolean hasRequestOptions = requestOptions != null;
326330
final String url = buildUrl(
@@ -350,6 +354,10 @@ public Request buildRequest(
350354
reqBody = serialize(body);
351355
}
352356

357+
if (useReadTransporter) {
358+
reqBuilder.tag(new UseReadTransporter());
359+
}
360+
353361
return reqBuilder.method(method, reqBody).build();
354362
}
355363

@@ -435,20 +443,4 @@ public void processHeaderParams(
435443
}
436444
}
437445
}
438-
439-
/**
440-
* Build a form-encoding request body with the given form parameters.
441-
*
442-
* @param formParams Form parameters in the form of Map
443-
* @return RequestBody
444-
*/
445-
public RequestBody buildRequestBodyFormEncoding(
446-
Map<String, Object> formParams
447-
) {
448-
okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
449-
for (Entry<String, Object> param : formParams.entrySet()) {
450-
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
451-
}
452-
return formBuilder.build();
453-
}
454446
}

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AbtestingClient.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public CompletableFuture<ABTestResponse> addABTestsAsync(
143143
queryParameters,
144144
bodyObj,
145145
headers,
146-
requestOptions
146+
requestOptions,
147+
false
147148
);
148149
Type returnType = new TypeToken<ABTestResponse>() {}.getType();
149150
return this.executeAsync(call, returnType);
@@ -236,7 +237,8 @@ public CompletableFuture<Object> delAsync(
236237
queryParameters,
237238
bodyObj,
238239
headers,
239-
requestOptions
240+
requestOptions,
241+
false
240242
);
241243
Type returnType = new TypeToken<Object>() {}.getType();
242244
return this.executeAsync(call, returnType);
@@ -320,7 +322,8 @@ public CompletableFuture<ABTestResponse> deleteABTestAsync(
320322
queryParameters,
321323
bodyObj,
322324
headers,
323-
requestOptions
325+
requestOptions,
326+
false
324327
);
325328
Type returnType = new TypeToken<ABTestResponse>() {}.getType();
326329
return this.executeAsync(call, returnType);
@@ -412,7 +415,8 @@ public CompletableFuture<Object> getAsync(
412415
queryParameters,
413416
bodyObj,
414417
headers,
415-
requestOptions
418+
requestOptions,
419+
false
416420
);
417421
Type returnType = new TypeToken<Object>() {}.getType();
418422
return this.executeAsync(call, returnType);
@@ -495,7 +499,8 @@ public CompletableFuture<ABTest> getABTestAsync(
495499
queryParameters,
496500
bodyObj,
497501
headers,
498-
requestOptions
502+
requestOptions,
503+
false
499504
);
500505
Type returnType = new TypeToken<ABTest>() {}.getType();
501506
return this.executeAsync(call, returnType);
@@ -586,7 +591,8 @@ public CompletableFuture<ListABTestsResponse> listABTestsAsync(
586591
queryParameters,
587592
bodyObj,
588593
headers,
589-
requestOptions
594+
requestOptions,
595+
false
590596
);
591597
Type returnType = new TypeToken<ListABTestsResponse>() {}.getType();
592598
return this.executeAsync(call, returnType);
@@ -697,7 +703,8 @@ public CompletableFuture<Object> postAsync(
697703
queryParameters,
698704
bodyObj,
699705
headers,
700-
requestOptions
706+
requestOptions,
707+
false
701708
);
702709
Type returnType = new TypeToken<Object>() {}.getType();
703710
return this.executeAsync(call, returnType);
@@ -810,7 +817,8 @@ public CompletableFuture<Object> putAsync(
810817
queryParameters,
811818
bodyObj,
812819
headers,
813-
requestOptions
820+
requestOptions,
821+
false
814822
);
815823
Type returnType = new TypeToken<Object>() {}.getType();
816824
return this.executeAsync(call, returnType);
@@ -898,7 +906,8 @@ public CompletableFuture<ABTestResponse> stopABTestAsync(
898906
queryParameters,
899907
bodyObj,
900908
headers,
901-
requestOptions
909+
requestOptions,
910+
false
902911
);
903912
Type returnType = new TypeToken<ABTestResponse>() {}.getType();
904913
return this.executeAsync(call, returnType);

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/AnalyticsClient.java

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public CompletableFuture<Object> delAsync(
161161
queryParameters,
162162
bodyObj,
163163
headers,
164-
requestOptions
164+
requestOptions,
165+
false
165166
);
166167
Type returnType = new TypeToken<Object>() {}.getType();
167168
return this.executeAsync(call, returnType);
@@ -267,7 +268,8 @@ public CompletableFuture<Object> getAsync(
267268
queryParameters,
268269
bodyObj,
269270
headers,
270-
requestOptions
271+
requestOptions,
272+
false
271273
);
272274
Type returnType = new TypeToken<Object>() {}.getType();
273275
return this.executeAsync(call, returnType);
@@ -417,7 +419,8 @@ public CompletableFuture<GetAverageClickPositionResponse> getAverageClickPositio
417419
queryParameters,
418420
bodyObj,
419421
headers,
420-
requestOptions
422+
requestOptions,
423+
false
421424
);
422425
Type returnType = new TypeToken<GetAverageClickPositionResponse>() {}
423426
.getType();
@@ -574,7 +577,8 @@ public CompletableFuture<GetClickPositionsResponse> getClickPositionsAsync(
574577
queryParameters,
575578
bodyObj,
576579
headers,
577-
requestOptions
580+
requestOptions,
581+
false
578582
);
579583
Type returnType = new TypeToken<GetClickPositionsResponse>() {}.getType();
580584
return this.executeAsync(call, returnType);
@@ -717,7 +721,8 @@ public CompletableFuture<GetClickThroughRateResponse> getClickThroughRateAsync(
717721
queryParameters,
718722
bodyObj,
719723
headers,
720-
requestOptions
724+
requestOptions,
725+
false
721726
);
722727
Type returnType = new TypeToken<GetClickThroughRateResponse>() {}.getType();
723728
return this.executeAsync(call, returnType);
@@ -866,7 +871,8 @@ public CompletableFuture<GetConversationRateResponse> getConversationRateAsync(
866871
queryParameters,
867872
bodyObj,
868873
headers,
869-
requestOptions
874+
requestOptions,
875+
false
870876
);
871877
Type returnType = new TypeToken<GetConversationRateResponse>() {}.getType();
872878
return this.executeAsync(call, returnType);
@@ -1015,7 +1021,8 @@ public CompletableFuture<GetNoClickRateResponse> getNoClickRateAsync(
10151021
queryParameters,
10161022
bodyObj,
10171023
headers,
1018-
requestOptions
1024+
requestOptions,
1025+
false
10191026
);
10201027
Type returnType = new TypeToken<GetNoClickRateResponse>() {}.getType();
10211028
return this.executeAsync(call, returnType);
@@ -1158,7 +1165,8 @@ public CompletableFuture<GetNoResultsRateResponse> getNoResultsRateAsync(
11581165
queryParameters,
11591166
bodyObj,
11601167
headers,
1161-
requestOptions
1168+
requestOptions,
1169+
false
11621170
);
11631171
Type returnType = new TypeToken<GetNoResultsRateResponse>() {}.getType();
11641172
return this.executeAsync(call, returnType);
@@ -1299,7 +1307,8 @@ public CompletableFuture<GetSearchesCountResponse> getSearchesCountAsync(
12991307
queryParameters,
13001308
bodyObj,
13011309
headers,
1302-
requestOptions
1310+
requestOptions,
1311+
false
13031312
);
13041313
Type returnType = new TypeToken<GetSearchesCountResponse>() {}.getType();
13051314
return this.executeAsync(call, returnType);
@@ -1486,7 +1495,8 @@ public CompletableFuture<GetSearchesNoClicksResponse> getSearchesNoClicksAsync(
14861495
queryParameters,
14871496
bodyObj,
14881497
headers,
1489-
requestOptions
1498+
requestOptions,
1499+
false
14901500
);
14911501
Type returnType = new TypeToken<GetSearchesNoClicksResponse>() {}.getType();
14921502
return this.executeAsync(call, returnType);
@@ -1698,7 +1708,8 @@ public CompletableFuture<GetSearchesNoResultsResponse> getSearchesNoResultsAsync
16981708
queryParameters,
16991709
bodyObj,
17001710
headers,
1701-
requestOptions
1711+
requestOptions,
1712+
false
17021713
);
17031714
Type returnType = new TypeToken<GetSearchesNoResultsResponse>() {}
17041715
.getType();
@@ -1817,7 +1828,8 @@ public CompletableFuture<GetStatusResponse> getStatusAsync(
18171828
queryParameters,
18181829
bodyObj,
18191830
headers,
1820-
requestOptions
1831+
requestOptions,
1832+
false
18211833
);
18221834
Type returnType = new TypeToken<GetStatusResponse>() {}.getType();
18231835
return this.executeAsync(call, returnType);
@@ -1985,7 +1997,8 @@ public CompletableFuture<GetTopCountriesResponse> getTopCountriesAsync(
19851997
queryParameters,
19861998
bodyObj,
19871999
headers,
1988-
requestOptions
2000+
requestOptions,
2001+
false
19892002
);
19902003
Type returnType = new TypeToken<GetTopCountriesResponse>() {}.getType();
19912004
return this.executeAsync(call, returnType);
@@ -2209,7 +2222,8 @@ public CompletableFuture<GetTopFilterAttributesResponse> getTopFilterAttributesA
22092222
queryParameters,
22102223
bodyObj,
22112224
headers,
2212-
requestOptions
2225+
requestOptions,
2226+
false
22132227
);
22142228
Type returnType = new TypeToken<GetTopFilterAttributesResponse>() {}
22152229
.getType();
@@ -2470,7 +2484,8 @@ public CompletableFuture<GetTopFilterForAttributeResponse> getTopFilterForAttrib
24702484
queryParameters,
24712485
bodyObj,
24722486
headers,
2473-
requestOptions
2487+
requestOptions,
2488+
false
24742489
);
24752490
Type returnType = new TypeToken<GetTopFilterForAttributeResponse>() {}
24762491
.getType();
@@ -2713,7 +2728,8 @@ public CompletableFuture<GetTopFiltersNoResultsResponse> getTopFiltersNoResultsA
27132728
queryParameters,
27142729
bodyObj,
27152730
headers,
2716-
requestOptions
2731+
requestOptions,
2732+
false
27172733
);
27182734
Type returnType = new TypeToken<GetTopFiltersNoResultsResponse>() {}
27192735
.getType();
@@ -2965,7 +2981,8 @@ public CompletableFuture<GetTopHitsResponse> getTopHitsAsync(
29652981
queryParameters,
29662982
bodyObj,
29672983
headers,
2968-
requestOptions
2984+
requestOptions,
2985+
false
29692986
);
29702987
Type returnType = new TypeToken<GetTopHitsResponse>() {}.getType();
29712988
return this.executeAsync(call, returnType);
@@ -3234,7 +3251,8 @@ public CompletableFuture<GetTopSearchesResponse> getTopSearchesAsync(
32343251
queryParameters,
32353252
bodyObj,
32363253
headers,
3237-
requestOptions
3254+
requestOptions,
3255+
false
32383256
);
32393257
Type returnType = new TypeToken<GetTopSearchesResponse>() {}.getType();
32403258
return this.executeAsync(call, returnType);
@@ -3413,7 +3431,8 @@ public CompletableFuture<GetUsersCountResponse> getUsersCountAsync(
34133431
queryParameters,
34143432
bodyObj,
34153433
headers,
3416-
requestOptions
3434+
requestOptions,
3435+
false
34173436
);
34183437
Type returnType = new TypeToken<GetUsersCountResponse>() {}.getType();
34193438
return this.executeAsync(call, returnType);
@@ -3528,7 +3547,8 @@ public CompletableFuture<Object> postAsync(
35283547
queryParameters,
35293548
bodyObj,
35303549
headers,
3531-
requestOptions
3550+
requestOptions,
3551+
false
35323552
);
35333553
Type returnType = new TypeToken<Object>() {}.getType();
35343554
return this.executeAsync(call, returnType);
@@ -3641,7 +3661,8 @@ public CompletableFuture<Object> putAsync(
36413661
queryParameters,
36423662
bodyObj,
36433663
headers,
3644-
requestOptions
3664+
requestOptions,
3665+
false
36453666
);
36463667
Type returnType = new TypeToken<Object>() {}.getType();
36473668
return this.executeAsync(call, returnType);

0 commit comments

Comments
 (0)