Skip to content

Commit

Permalink
chore: generated code for commit bf42712. [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed May 23, 2022
1 parent bf42712 commit 5f041da
Show file tree
Hide file tree
Showing 26 changed files with 373 additions and 298 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.algolia;

import com.algolia.exceptions.*;
import com.algolia.utils.AlgoliaAgent;
import com.algolia.utils.JSON;
import com.algolia.utils.RequestOptions;
import com.algolia.utils.Requester;
import com.algolia.utils.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
Expand Down Expand Up @@ -277,6 +274,8 @@ public void onResponse(Call call, Response response)
* @param headerParams The header parameters
* @param requestOptions The requestOptions to send along with the query, they will be merged with
* the transporter requestOptions.
* @param useReadTransporter Some POST methods in the Algolia REST API uses the `read`
* transporter. This information is defined at the spec level.
* @return The HTTP call
* @throws AlgoliaRuntimeException If fail to serialize the request body object
*/
Expand All @@ -286,15 +285,17 @@ public Call buildCall(
Map<String, Object> queryParameters,
Object body,
Map<String, String> headerParams,
RequestOptions requestOptions
RequestOptions requestOptions,
Boolean useReadTransporter
) throws AlgoliaRuntimeException {
Request request = buildRequest(
path,
method,
queryParameters,
body,
headerParams,
requestOptions
requestOptions,
useReadTransporter
);

return requester.newCall(request);
Expand All @@ -311,6 +312,8 @@ public Call buildCall(
* @param headerParams The header parameters
* @param requestOptions The requestOptions to send along with the query, they will be merged with
* the transporter requestOptions.
* @param useReadTransporter Some POST methods in the Algolia REST API uses the `read`
* transporter. This information is defined at the spec level.
* @return The HTTP request
* @throws AlgoliaRuntimeException If fail to serialize the request body object
*/
Expand All @@ -320,7 +323,8 @@ public Request buildRequest(
Map<String, Object> queryParameters,
Object body,
Map<String, String> headerParams,
RequestOptions requestOptions
RequestOptions requestOptions,
Boolean useReadTransporter
) throws AlgoliaRuntimeException {
boolean hasRequestOptions = requestOptions != null;
final String url = buildUrl(
Expand Down Expand Up @@ -350,6 +354,10 @@ public Request buildRequest(
reqBody = serialize(body);
}

if (useReadTransporter) {
reqBuilder.tag(new UseReadTransporter());
}

return reqBuilder.method(method, reqBody).build();
}

Expand Down Expand Up @@ -435,20 +443,4 @@ public void processHeaderParams(
}
}
}

/**
* Build a form-encoding request body with the given form parameters.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyFormEncoding(
Map<String, Object> formParams
) {
okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
for (Entry<String, Object> param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
return formBuilder.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public CompletableFuture<ABTestResponse> addABTestsAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<ABTestResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -236,7 +237,8 @@ public CompletableFuture<Object> delAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -320,7 +322,8 @@ public CompletableFuture<ABTestResponse> deleteABTestAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<ABTestResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -412,7 +415,8 @@ public CompletableFuture<Object> getAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -495,7 +499,8 @@ public CompletableFuture<ABTest> getABTestAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<ABTest>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -586,7 +591,8 @@ public CompletableFuture<ListABTestsResponse> listABTestsAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<ListABTestsResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -697,7 +703,8 @@ public CompletableFuture<Object> postAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -810,7 +817,8 @@ public CompletableFuture<Object> putAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -898,7 +906,8 @@ public CompletableFuture<ABTestResponse> stopABTestAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<ABTestResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public CompletableFuture<Object> delAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -267,7 +268,8 @@ public CompletableFuture<Object> getAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -417,7 +419,8 @@ public CompletableFuture<GetAverageClickPositionResponse> getAverageClickPositio
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetAverageClickPositionResponse>() {}
.getType();
Expand Down Expand Up @@ -574,7 +577,8 @@ public CompletableFuture<GetClickPositionsResponse> getClickPositionsAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetClickPositionsResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -717,7 +721,8 @@ public CompletableFuture<GetClickThroughRateResponse> getClickThroughRateAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetClickThroughRateResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -866,7 +871,8 @@ public CompletableFuture<GetConversationRateResponse> getConversationRateAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetConversationRateResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -1015,7 +1021,8 @@ public CompletableFuture<GetNoClickRateResponse> getNoClickRateAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetNoClickRateResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -1158,7 +1165,8 @@ public CompletableFuture<GetNoResultsRateResponse> getNoResultsRateAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetNoResultsRateResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -1299,7 +1307,8 @@ public CompletableFuture<GetSearchesCountResponse> getSearchesCountAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetSearchesCountResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -1486,7 +1495,8 @@ public CompletableFuture<GetSearchesNoClicksResponse> getSearchesNoClicksAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetSearchesNoClicksResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -1698,7 +1708,8 @@ public CompletableFuture<GetSearchesNoResultsResponse> getSearchesNoResultsAsync
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetSearchesNoResultsResponse>() {}
.getType();
Expand Down Expand Up @@ -1817,7 +1828,8 @@ public CompletableFuture<GetStatusResponse> getStatusAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetStatusResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -1985,7 +1997,8 @@ public CompletableFuture<GetTopCountriesResponse> getTopCountriesAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetTopCountriesResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -2209,7 +2222,8 @@ public CompletableFuture<GetTopFilterAttributesResponse> getTopFilterAttributesA
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetTopFilterAttributesResponse>() {}
.getType();
Expand Down Expand Up @@ -2470,7 +2484,8 @@ public CompletableFuture<GetTopFilterForAttributeResponse> getTopFilterForAttrib
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetTopFilterForAttributeResponse>() {}
.getType();
Expand Down Expand Up @@ -2713,7 +2728,8 @@ public CompletableFuture<GetTopFiltersNoResultsResponse> getTopFiltersNoResultsA
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetTopFiltersNoResultsResponse>() {}
.getType();
Expand Down Expand Up @@ -2965,7 +2981,8 @@ public CompletableFuture<GetTopHitsResponse> getTopHitsAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetTopHitsResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -3234,7 +3251,8 @@ public CompletableFuture<GetTopSearchesResponse> getTopSearchesAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetTopSearchesResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -3413,7 +3431,8 @@ public CompletableFuture<GetUsersCountResponse> getUsersCountAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<GetUsersCountResponse>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -3528,7 +3547,8 @@ public CompletableFuture<Object> postAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down Expand Up @@ -3641,7 +3661,8 @@ public CompletableFuture<Object> putAsync(
queryParameters,
bodyObj,
headers,
requestOptions
requestOptions,
false
);
Type returnType = new TypeToken<Object>() {}.getType();
return this.executeAsync(call, returnType);
Expand Down
Loading

0 comments on commit 5f041da

Please sign in to comment.