Skip to content

Commit

Permalink
chore: generated code for commit 9320a5f. [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
algolia-bot and shortcuts committed May 17, 2022
1 parent 9320a5f commit 39b3025
Show file tree
Hide file tree
Showing 24 changed files with 442 additions and 2,336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public void onResponse(Call call, Response response)
public Call buildCall(
String path,
String method,
Map<String, String> queryParameters,
Map<String, Object> queryParameters,
Object body,
Map<String, String> headerParams,
RequestOptions requestOptions
Expand Down Expand Up @@ -317,7 +317,7 @@ public Call buildCall(
public Request buildRequest(
String path,
String method,
Map<String, String> queryParameters,
Map<String, Object> queryParameters,
Object body,
Map<String, String> headerParams,
RequestOptions requestOptions
Expand Down Expand Up @@ -363,37 +363,24 @@ public Request buildRequest(
*/
public String buildUrl(
String path,
Map<String, String> queryParameters,
Map<String, String> extraQueryParameters
Map<String, Object> queryParameters,
Map<String, Object> extraQueryParameters
) {
StringBuilder url = new StringBuilder();
if (extraQueryParameters != null) {
for (Entry<String, Object> param : extraQueryParameters.entrySet()) {
queryParameters.put(param.getKey(), param.getValue());
}
}

final StringBuilder url = new StringBuilder();

// The real host will be assigned by the retry strategy
url.append("http://temp.path").append(path);

url = parseQueryParameters(path, url, queryParameters);
url = parseQueryParameters(path, url, extraQueryParameters);

return url.toString();
}

/**
* Parses the given map of Query Parameters to a given URL.
*
* @param path The sub path
* @param url The url to add queryParameters to
* @param queryParameters The query parameters
* @return The URL
*/
public StringBuilder parseQueryParameters(
String path,
StringBuilder url,
Map<String, String> queryParameters
) {
if (queryParameters != null && !queryParameters.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
String prefix = path.contains("?") ? "&" : "?";
for (Entry<String, String> param : queryParameters.entrySet()) {
for (Entry<String, Object> param : queryParameters.entrySet()) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
Expand All @@ -410,7 +397,7 @@ public StringBuilder parseQueryParameters(
}
}

return url;
return url.toString();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public CompletableFuture<ABTestResponse> addABTestsAsync(
// create path and map variables
String requestPath = "/2/abtests";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

Call call =
Expand Down Expand Up @@ -217,7 +217,7 @@ public CompletableFuture<Object> delAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -310,7 +310,7 @@ public CompletableFuture<ABTestResponse> deleteABTestAsync(
this.escapeString(id.toString())
);

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

Call call =
Expand Down Expand Up @@ -393,7 +393,7 @@ public CompletableFuture<Object> getAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -485,7 +485,7 @@ public CompletableFuture<ABTest> getABTestAsync(
this.escapeString(id.toString())
);

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

Call call =
Expand Down Expand Up @@ -568,7 +568,7 @@ public CompletableFuture<ListABTestsResponse> listABTestsAsync(
// create path and map variables
String requestPath = "/2/abtests";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (offset != null) {
Expand Down Expand Up @@ -678,7 +678,7 @@ public CompletableFuture<Object> postAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -791,7 +791,7 @@ public CompletableFuture<Object> putAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -888,7 +888,7 @@ public CompletableFuture<ABTestResponse> stopABTestAsync(
this.escapeString(id.toString())
);

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

Call call =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public CompletableFuture<Object> delAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -248,7 +248,7 @@ public CompletableFuture<Object> getAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -391,7 +391,7 @@ public CompletableFuture<GetAverageClickPositionResponse> getAverageClickPositio
// create path and map variables
String requestPath = "/2/clicks/averageClickPosition";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -548,7 +548,7 @@ public CompletableFuture<GetClickPositionsResponse> getClickPositionsAsync(
// create path and map variables
String requestPath = "/2/clicks/positions";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -691,7 +691,7 @@ public CompletableFuture<GetClickThroughRateResponse> getClickThroughRateAsync(
// create path and map variables
String requestPath = "/2/clicks/clickThroughRate";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -840,7 +840,7 @@ public CompletableFuture<GetConversationRateResponse> getConversationRateAsync(
// create path and map variables
String requestPath = "/2/conversions/conversionRate";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -989,7 +989,7 @@ public CompletableFuture<GetNoClickRateResponse> getNoClickRateAsync(
// create path and map variables
String requestPath = "/2/searches/noClickRate";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -1132,7 +1132,7 @@ public CompletableFuture<GetNoResultsRateResponse> getNoResultsRateAsync(
// create path and map variables
String requestPath = "/2/searches/noResultRate";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -1273,7 +1273,7 @@ public CompletableFuture<GetSearchesCountResponse> getSearchesCountAsync(
// create path and map variables
String requestPath = "/2/searches/count";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -1452,7 +1452,7 @@ public CompletableFuture<GetSearchesNoClicksResponse> getSearchesNoClicksAsync(
// create path and map variables
String requestPath = "/2/searches/noClicks";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -1664,7 +1664,7 @@ public CompletableFuture<GetSearchesNoResultsResponse> getSearchesNoResultsAsync
// create path and map variables
String requestPath = "/2/searches/noResults";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -1803,7 +1803,7 @@ public CompletableFuture<GetStatusResponse> getStatusAsync(
// create path and map variables
String requestPath = "/2/status";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -1951,7 +1951,7 @@ public CompletableFuture<GetTopCountriesResponse> getTopCountriesAsync(
// create path and map variables
String requestPath = "/2/countries";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -2171,7 +2171,7 @@ public CompletableFuture<GetTopFilterAttributesResponse> getTopFilterAttributesA
// create path and map variables
String requestPath = "/2/filters";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -2432,7 +2432,7 @@ public CompletableFuture<GetTopFilterForAttributeResponse> getTopFilterForAttrib
this.escapeString(attribute.toString())
);

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -2675,7 +2675,7 @@ public CompletableFuture<GetTopFiltersNoResultsResponse> getTopFiltersNoResultsA
// create path and map variables
String requestPath = "/2/filters/noResults";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -2923,7 +2923,7 @@ public CompletableFuture<GetTopHitsResponse> getTopHitsAsync(
// create path and map variables
String requestPath = "/2/hits";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -3188,7 +3188,7 @@ public CompletableFuture<GetTopSearchesResponse> getTopSearchesAsync(
// create path and map variables
String requestPath = "/2/searches";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -3387,7 +3387,7 @@ public CompletableFuture<GetUsersCountResponse> getUsersCountAsync(
// create path and map variables
String requestPath = "/2/users/count";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (index != null) {
Expand Down Expand Up @@ -3509,7 +3509,7 @@ public CompletableFuture<Object> postAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -3622,7 +3622,7 @@ public CompletableFuture<Object> putAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public CompletableFuture<Object> delAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -248,7 +248,7 @@ public CompletableFuture<Object> getAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -360,7 +360,7 @@ public CompletableFuture<Object> postAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down Expand Up @@ -470,7 +470,7 @@ public CompletableFuture<PushEventsResponse> pushEventsAsync(
// create path and map variables
String requestPath = "/1/events";

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

Call call =
Expand Down Expand Up @@ -560,7 +560,7 @@ public CompletableFuture<Object> putAsync(
// create path and map variables
String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString());

Map<String, String> queryParameters = new HashMap<String, String>();
Map<String, Object> queryParameters = new HashMap<String, Object>();
Map<String, String> headers = new HashMap<String, String>();

if (parameters != null) {
Expand Down
Loading

0 comments on commit 39b3025

Please sign in to comment.