|
6 | 6 | import com.algolia.utils.*;
|
7 | 7 | import com.algolia.utils.retry.CallType;
|
8 | 8 | import com.algolia.utils.retry.StatefulHost;
|
9 |
| -import com.google.gson.reflect.TypeToken; |
10 |
| -import java.lang.reflect.Type; |
| 9 | +import com.fasterxml.jackson.core.type.TypeReference; |
11 | 10 | import java.util.ArrayList;
|
12 | 11 | import java.util.EnumSet;
|
13 | 12 | import java.util.HashMap;
|
@@ -153,8 +152,7 @@ public CompletableFuture<Object> delAsync(String path, Map<String, Object> param
|
153 | 152 | }
|
154 | 153 |
|
155 | 154 | Call call = this.buildCall(requestPath, "DELETE", queryParameters, bodyObj, headers, requestOptions, false);
|
156 |
| - Type returnType = new TypeToken<Object>() {}.getType(); |
157 |
| - return this.executeAsync(call, returnType); |
| 155 | + return this.executeAsync(call, new TypeReference<Object>() {}); |
158 | 156 | }
|
159 | 157 |
|
160 | 158 | /**
|
@@ -283,8 +281,7 @@ public CompletableFuture<Object> getAsync(String path, Map<String, Object> param
|
283 | 281 | }
|
284 | 282 |
|
285 | 283 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
286 |
| - Type returnType = new TypeToken<Object>() {}.getType(); |
287 |
| - return this.executeAsync(call, returnType); |
| 284 | + return this.executeAsync(call, new TypeReference<Object>() {}); |
288 | 285 | }
|
289 | 286 |
|
290 | 287 | /**
|
@@ -454,8 +451,7 @@ public CompletableFuture<GetAverageClickPositionResponse> getAverageClickPositio
|
454 | 451 | }
|
455 | 452 |
|
456 | 453 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
457 |
| - Type returnType = new TypeToken<GetAverageClickPositionResponse>() {}.getType(); |
458 |
| - return this.executeAsync(call, returnType); |
| 454 | + return this.executeAsync(call, new TypeReference<GetAverageClickPositionResponse>() {}); |
459 | 455 | }
|
460 | 456 |
|
461 | 457 | /**
|
@@ -642,8 +638,7 @@ public CompletableFuture<GetClickPositionsResponse> getClickPositionsAsync(
|
642 | 638 | }
|
643 | 639 |
|
644 | 640 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
645 |
| - Type returnType = new TypeToken<GetClickPositionsResponse>() {}.getType(); |
646 |
| - return this.executeAsync(call, returnType); |
| 641 | + return this.executeAsync(call, new TypeReference<GetClickPositionsResponse>() {}); |
647 | 642 | }
|
648 | 643 |
|
649 | 644 | /**
|
@@ -831,8 +826,7 @@ public CompletableFuture<GetClickThroughRateResponse> getClickThroughRateAsync(
|
831 | 826 | }
|
832 | 827 |
|
833 | 828 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
834 |
| - Type returnType = new TypeToken<GetClickThroughRateResponse>() {}.getType(); |
835 |
| - return this.executeAsync(call, returnType); |
| 829 | + return this.executeAsync(call, new TypeReference<GetClickThroughRateResponse>() {}); |
836 | 830 | }
|
837 | 831 |
|
838 | 832 | /**
|
@@ -1021,8 +1015,7 @@ public CompletableFuture<GetConversationRateResponse> getConversationRateAsync(
|
1021 | 1015 | }
|
1022 | 1016 |
|
1023 | 1017 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
1024 |
| - Type returnType = new TypeToken<GetConversationRateResponse>() {}.getType(); |
1025 |
| - return this.executeAsync(call, returnType); |
| 1018 | + return this.executeAsync(call, new TypeReference<GetConversationRateResponse>() {}); |
1026 | 1019 | }
|
1027 | 1020 |
|
1028 | 1021 | /**
|
@@ -1205,8 +1198,7 @@ public CompletableFuture<GetNoClickRateResponse> getNoClickRateAsync(
|
1205 | 1198 | }
|
1206 | 1199 |
|
1207 | 1200 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
1208 |
| - Type returnType = new TypeToken<GetNoClickRateResponse>() {}.getType(); |
1209 |
| - return this.executeAsync(call, returnType); |
| 1201 | + return this.executeAsync(call, new TypeReference<GetNoClickRateResponse>() {}); |
1210 | 1202 | }
|
1211 | 1203 |
|
1212 | 1204 | /**
|
@@ -1391,8 +1383,7 @@ public CompletableFuture<GetNoResultsRateResponse> getNoResultsRateAsync(
|
1391 | 1383 | }
|
1392 | 1384 |
|
1393 | 1385 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
1394 |
| - Type returnType = new TypeToken<GetNoResultsRateResponse>() {}.getType(); |
1395 |
| - return this.executeAsync(call, returnType); |
| 1386 | + return this.executeAsync(call, new TypeReference<GetNoResultsRateResponse>() {}); |
1396 | 1387 | }
|
1397 | 1388 |
|
1398 | 1389 | /**
|
@@ -1572,8 +1563,7 @@ public CompletableFuture<GetSearchesCountResponse> getSearchesCountAsync(
|
1572 | 1563 | }
|
1573 | 1564 |
|
1574 | 1565 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
1575 |
| - Type returnType = new TypeToken<GetSearchesCountResponse>() {}.getType(); |
1576 |
| - return this.executeAsync(call, returnType); |
| 1566 | + return this.executeAsync(call, new TypeReference<GetSearchesCountResponse>() {}); |
1577 | 1567 | }
|
1578 | 1568 |
|
1579 | 1569 | /**
|
@@ -1780,8 +1770,7 @@ public CompletableFuture<GetSearchesNoClicksResponse> getSearchesNoClicksAsync(
|
1780 | 1770 | }
|
1781 | 1771 |
|
1782 | 1772 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
1783 |
| - Type returnType = new TypeToken<GetSearchesNoClicksResponse>() {}.getType(); |
1784 |
| - return this.executeAsync(call, returnType); |
| 1773 | + return this.executeAsync(call, new TypeReference<GetSearchesNoClicksResponse>() {}); |
1785 | 1774 | }
|
1786 | 1775 |
|
1787 | 1776 | /**
|
@@ -1994,8 +1983,7 @@ public CompletableFuture<GetSearchesNoResultsResponse> getSearchesNoResultsAsync
|
1994 | 1983 | }
|
1995 | 1984 |
|
1996 | 1985 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
1997 |
| - Type returnType = new TypeToken<GetSearchesNoResultsResponse>() {}.getType(); |
1998 |
| - return this.executeAsync(call, returnType); |
| 1986 | + return this.executeAsync(call, new TypeReference<GetSearchesNoResultsResponse>() {}); |
1999 | 1987 | }
|
2000 | 1988 |
|
2001 | 1989 | /**
|
@@ -2111,8 +2099,7 @@ public CompletableFuture<GetStatusResponse> getStatusAsync(String index, Request
|
2111 | 2099 | }
|
2112 | 2100 |
|
2113 | 2101 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
2114 |
| - Type returnType = new TypeToken<GetStatusResponse>() {}.getType(); |
2115 |
| - return this.executeAsync(call, returnType); |
| 2102 | + return this.executeAsync(call, new TypeReference<GetStatusResponse>() {}); |
2116 | 2103 | }
|
2117 | 2104 |
|
2118 | 2105 | /**
|
@@ -2280,8 +2267,7 @@ public CompletableFuture<GetTopCountriesResponse> getTopCountriesAsync(
|
2280 | 2267 | }
|
2281 | 2268 |
|
2282 | 2269 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
2283 |
| - Type returnType = new TypeToken<GetTopCountriesResponse>() {}.getType(); |
2284 |
| - return this.executeAsync(call, returnType); |
| 2270 | + return this.executeAsync(call, new TypeReference<GetTopCountriesResponse>() {}); |
2285 | 2271 | }
|
2286 | 2272 |
|
2287 | 2273 | /**
|
@@ -2500,8 +2486,7 @@ public CompletableFuture<GetTopFilterAttributesResponse> getTopFilterAttributesA
|
2500 | 2486 | }
|
2501 | 2487 |
|
2502 | 2488 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
2503 |
| - Type returnType = new TypeToken<GetTopFilterAttributesResponse>() {}.getType(); |
2504 |
| - return this.executeAsync(call, returnType); |
| 2489 | + return this.executeAsync(call, new TypeReference<GetTopFilterAttributesResponse>() {}); |
2505 | 2490 | }
|
2506 | 2491 |
|
2507 | 2492 | /**
|
@@ -2738,8 +2723,7 @@ public CompletableFuture<GetTopFilterForAttributeResponse> getTopFilterForAttrib
|
2738 | 2723 | }
|
2739 | 2724 |
|
2740 | 2725 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
2741 |
| - Type returnType = new TypeToken<GetTopFilterForAttributeResponse>() {}.getType(); |
2742 |
| - return this.executeAsync(call, returnType); |
| 2726 | + return this.executeAsync(call, new TypeReference<GetTopFilterForAttributeResponse>() {}); |
2743 | 2727 | }
|
2744 | 2728 |
|
2745 | 2729 | /**
|
@@ -2971,8 +2955,7 @@ public CompletableFuture<GetTopFiltersNoResultsResponse> getTopFiltersNoResultsA
|
2971 | 2955 | }
|
2972 | 2956 |
|
2973 | 2957 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
2974 |
| - Type returnType = new TypeToken<GetTopFiltersNoResultsResponse>() {}.getType(); |
2975 |
| - return this.executeAsync(call, returnType); |
| 2958 | + return this.executeAsync(call, new TypeReference<GetTopFiltersNoResultsResponse>() {}); |
2976 | 2959 | }
|
2977 | 2960 |
|
2978 | 2961 | /**
|
@@ -3206,8 +3189,7 @@ public CompletableFuture<GetTopHitsResponse> getTopHitsAsync(
|
3206 | 3189 | }
|
3207 | 3190 |
|
3208 | 3191 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
3209 |
| - Type returnType = new TypeToken<GetTopHitsResponse>() {}.getType(); |
3210 |
| - return this.executeAsync(call, returnType); |
| 3192 | + return this.executeAsync(call, new TypeReference<GetTopHitsResponse>() {}); |
3211 | 3193 | }
|
3212 | 3194 |
|
3213 | 3195 | /**
|
@@ -3460,8 +3442,7 @@ public CompletableFuture<GetTopSearchesResponse> getTopSearchesAsync(
|
3460 | 3442 | }
|
3461 | 3443 |
|
3462 | 3444 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
3463 |
| - Type returnType = new TypeToken<GetTopSearchesResponse>() {}.getType(); |
3464 |
| - return this.executeAsync(call, returnType); |
| 3445 | + return this.executeAsync(call, new TypeReference<GetTopSearchesResponse>() {}); |
3465 | 3446 | }
|
3466 | 3447 |
|
3467 | 3448 | /**
|
@@ -3649,8 +3630,7 @@ public CompletableFuture<GetUsersCountResponse> getUsersCountAsync(
|
3649 | 3630 | }
|
3650 | 3631 |
|
3651 | 3632 | Call call = this.buildCall(requestPath, "GET", queryParameters, bodyObj, headers, requestOptions, false);
|
3652 |
| - Type returnType = new TypeToken<GetUsersCountResponse>() {}.getType(); |
3653 |
| - return this.executeAsync(call, returnType); |
| 3633 | + return this.executeAsync(call, new TypeReference<GetUsersCountResponse>() {}); |
3654 | 3634 | }
|
3655 | 3635 |
|
3656 | 3636 | /**
|
@@ -3791,8 +3771,7 @@ public CompletableFuture<Object> postAsync(String path, Map<String, Object> para
|
3791 | 3771 | }
|
3792 | 3772 |
|
3793 | 3773 | Call call = this.buildCall(requestPath, "POST", queryParameters, bodyObj, headers, requestOptions, false);
|
3794 |
| - Type returnType = new TypeToken<Object>() {}.getType(); |
3795 |
| - return this.executeAsync(call, returnType); |
| 3774 | + return this.executeAsync(call, new TypeReference<Object>() {}); |
3796 | 3775 | }
|
3797 | 3776 |
|
3798 | 3777 | /**
|
@@ -3926,8 +3905,7 @@ public CompletableFuture<Object> putAsync(String path, Map<String, Object> param
|
3926 | 3905 | }
|
3927 | 3906 |
|
3928 | 3907 | Call call = this.buildCall(requestPath, "PUT", queryParameters, bodyObj, headers, requestOptions, false);
|
3929 |
| - Type returnType = new TypeToken<Object>() {}.getType(); |
3930 |
| - return this.executeAsync(call, returnType); |
| 3908 | + return this.executeAsync(call, new TypeReference<Object>() {}); |
3931 | 3909 | }
|
3932 | 3910 |
|
3933 | 3911 | /**
|
|
0 commit comments