Skip to content

Commit 1b0759d

Browse files
Generated code for commit cf25c6a. (#332)
Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: algolia-bot <[email protected]>
1 parent cf25c6a commit 1b0759d

File tree

26 files changed

+816
-958
lines changed

26 files changed

+816
-958
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java

Lines changed: 60 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ public Call clearRulesAsync(
14501450
*/
14511451
private Call delCall(
14521452
String path,
1453-
String parameters,
1453+
Map<String, Object> parameters,
14541454
Object body,
14551455
final ApiCallback<Object> _callback
14561456
) throws AlgoliaRuntimeException {
@@ -1463,7 +1463,14 @@ private Call delCall(
14631463
Map<String, String> headers = new HashMap<String, String>();
14641464

14651465
if (parameters != null) {
1466-
queryParams.addAll(this.parameterToPair("parameters", parameters));
1466+
for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
1467+
queryParams.addAll(
1468+
this.parameterToPair(
1469+
parameter.getKey(),
1470+
parameter.getValue().toString()
1471+
)
1472+
);
1473+
}
14671474
}
14681475

14691476
headers.put("Accept", "application/json");
@@ -1481,7 +1488,7 @@ private Call delCall(
14811488

14821489
private Call delValidateBeforeCall(
14831490
String path,
1484-
String parameters,
1491+
Map<String, Object> parameters,
14851492
Object body,
14861493
final ApiCallback<Object> _callback
14871494
) throws AlgoliaRuntimeException {
@@ -1500,14 +1507,13 @@ private Call delValidateBeforeCall(
15001507
*
15011508
* @param path The path of the API endpoint to target, anything after the /1 needs to be
15021509
* specified. (required)
1503-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
1504-
* query made with this API key. (optional)
1510+
* @param parameters Query parameters to be applied to the current query. (optional)
15051511
* @param body The parameters to send with the custom request. (optional)
15061512
* @return Object
15071513
* @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot
15081514
* deserialize the response body
15091515
*/
1510-
public Object del(String path, String parameters, Object body)
1516+
public Object del(String path, Map<String, Object> parameters, Object body)
15111517
throws AlgoliaRuntimeException {
15121518
Call req = delValidateBeforeCall(path, parameters, body, null);
15131519
if (req instanceof CallEcho) {
@@ -1520,16 +1526,15 @@ public Object del(String path, String parameters, Object body)
15201526
}
15211527

15221528
public Object del(String path) throws AlgoliaRuntimeException {
1523-
return this.del(path, null, null);
1529+
return this.del(path, new HashMap<>(), null);
15241530
}
15251531

15261532
/**
15271533
* (asynchronously) This method allow you to send requests to the Algolia REST API.
15281534
*
15291535
* @param path The path of the API endpoint to target, anything after the /1 needs to be
15301536
* specified. (required)
1531-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
1532-
* query made with this API key. (optional)
1537+
* @param parameters Query parameters to be applied to the current query. (optional)
15331538
* @param body The parameters to send with the custom request. (optional)
15341539
* @param _callback The callback to be executed when the API call finishes
15351540
* @return The request call
@@ -1538,7 +1543,7 @@ public Object del(String path) throws AlgoliaRuntimeException {
15381543
*/
15391544
public Call delAsync(
15401545
String path,
1541-
String parameters,
1546+
Map<String, Object> parameters,
15421547
Object body,
15431548
final ApiCallback<Object> _callback
15441549
) throws AlgoliaRuntimeException {
@@ -2309,7 +2314,7 @@ public Call deleteSynonymAsync(
23092314
*/
23102315
private Call getCall(
23112316
String path,
2312-
String parameters,
2317+
Map<String, Object> parameters,
23132318
final ApiCallback<Object> _callback
23142319
) throws AlgoliaRuntimeException {
23152320
Object bodyObj = null;
@@ -2321,7 +2326,14 @@ private Call getCall(
23212326
Map<String, String> headers = new HashMap<String, String>();
23222327

23232328
if (parameters != null) {
2324-
queryParams.addAll(this.parameterToPair("parameters", parameters));
2329+
for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
2330+
queryParams.addAll(
2331+
this.parameterToPair(
2332+
parameter.getKey(),
2333+
parameter.getValue().toString()
2334+
)
2335+
);
2336+
}
23252337
}
23262338

23272339
headers.put("Accept", "application/json");
@@ -2339,7 +2351,7 @@ private Call getCall(
23392351

23402352
private Call getValidateBeforeCall(
23412353
String path,
2342-
String parameters,
2354+
Map<String, Object> parameters,
23432355
final ApiCallback<Object> _callback
23442356
) throws AlgoliaRuntimeException {
23452357
// verify the required parameter 'path' is set
@@ -2357,13 +2369,12 @@ private Call getValidateBeforeCall(
23572369
*
23582370
* @param path The path of the API endpoint to target, anything after the /1 needs to be
23592371
* specified. (required)
2360-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
2361-
* query made with this API key. (optional)
2372+
* @param parameters Query parameters to be applied to the current query. (optional)
23622373
* @return Object
23632374
* @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot
23642375
* deserialize the response body
23652376
*/
2366-
public Object get(String path, String parameters)
2377+
public Object get(String path, Map<String, Object> parameters)
23672378
throws AlgoliaRuntimeException {
23682379
Call req = getValidateBeforeCall(path, parameters, null);
23692380
if (req instanceof CallEcho) {
@@ -2376,24 +2387,23 @@ public Object get(String path, String parameters)
23762387
}
23772388

23782389
public Object get(String path) throws AlgoliaRuntimeException {
2379-
return this.get(path, null);
2390+
return this.get(path, new HashMap<>());
23802391
}
23812392

23822393
/**
23832394
* (asynchronously) This method allow you to send requests to the Algolia REST API.
23842395
*
23852396
* @param path The path of the API endpoint to target, anything after the /1 needs to be
23862397
* specified. (required)
2387-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
2388-
* query made with this API key. (optional)
2398+
* @param parameters Query parameters to be applied to the current query. (optional)
23892399
* @param _callback The callback to be executed when the API call finishes
23902400
* @return The request call
23912401
* @throws AlgoliaRuntimeException If fail to process the API call, e.g. serializing the request
23922402
* body object
23932403
*/
23942404
public Call getAsync(
23952405
String path,
2396-
String parameters,
2406+
Map<String, Object> parameters,
23972407
final ApiCallback<Object> _callback
23982408
) throws AlgoliaRuntimeException {
23992409
Call call = getValidateBeforeCall(path, parameters, _callback);
@@ -4553,7 +4563,7 @@ public Call partialUpdateObjectAsync(
45534563
*/
45544564
private Call postCall(
45554565
String path,
4556-
String parameters,
4566+
Map<String, Object> parameters,
45574567
Object body,
45584568
final ApiCallback<Object> _callback
45594569
) throws AlgoliaRuntimeException {
@@ -4566,7 +4576,14 @@ private Call postCall(
45664576
Map<String, String> headers = new HashMap<String, String>();
45674577

45684578
if (parameters != null) {
4569-
queryParams.addAll(this.parameterToPair("parameters", parameters));
4579+
for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
4580+
queryParams.addAll(
4581+
this.parameterToPair(
4582+
parameter.getKey(),
4583+
parameter.getValue().toString()
4584+
)
4585+
);
4586+
}
45704587
}
45714588

45724589
headers.put("Accept", "application/json");
@@ -4584,7 +4601,7 @@ private Call postCall(
45844601

45854602
private Call postValidateBeforeCall(
45864603
String path,
4587-
String parameters,
4604+
Map<String, Object> parameters,
45884605
Object body,
45894606
final ApiCallback<Object> _callback
45904607
) throws AlgoliaRuntimeException {
@@ -4603,14 +4620,13 @@ private Call postValidateBeforeCall(
46034620
*
46044621
* @param path The path of the API endpoint to target, anything after the /1 needs to be
46054622
* specified. (required)
4606-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
4607-
* query made with this API key. (optional)
4623+
* @param parameters Query parameters to be applied to the current query. (optional)
46084624
* @param body The parameters to send with the custom request. (optional)
46094625
* @return Object
46104626
* @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot
46114627
* deserialize the response body
46124628
*/
4613-
public Object post(String path, String parameters, Object body)
4629+
public Object post(String path, Map<String, Object> parameters, Object body)
46144630
throws AlgoliaRuntimeException {
46154631
Call req = postValidateBeforeCall(path, parameters, body, null);
46164632
if (req instanceof CallEcho) {
@@ -4623,16 +4639,15 @@ public Object post(String path, String parameters, Object body)
46234639
}
46244640

46254641
public Object post(String path) throws AlgoliaRuntimeException {
4626-
return this.post(path, null, null);
4642+
return this.post(path, new HashMap<>(), null);
46274643
}
46284644

46294645
/**
46304646
* (asynchronously) This method allow you to send requests to the Algolia REST API.
46314647
*
46324648
* @param path The path of the API endpoint to target, anything after the /1 needs to be
46334649
* specified. (required)
4634-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
4635-
* query made with this API key. (optional)
4650+
* @param parameters Query parameters to be applied to the current query. (optional)
46364651
* @param body The parameters to send with the custom request. (optional)
46374652
* @param _callback The callback to be executed when the API call finishes
46384653
* @return The request call
@@ -4641,7 +4656,7 @@ public Object post(String path) throws AlgoliaRuntimeException {
46414656
*/
46424657
public Call postAsync(
46434658
String path,
4644-
String parameters,
4659+
Map<String, Object> parameters,
46454660
Object body,
46464661
final ApiCallback<Object> _callback
46474662
) throws AlgoliaRuntimeException {
@@ -4660,7 +4675,7 @@ public Call postAsync(
46604675
*/
46614676
private Call putCall(
46624677
String path,
4663-
String parameters,
4678+
Map<String, Object> parameters,
46644679
Object body,
46654680
final ApiCallback<Object> _callback
46664681
) throws AlgoliaRuntimeException {
@@ -4673,7 +4688,14 @@ private Call putCall(
46734688
Map<String, String> headers = new HashMap<String, String>();
46744689

46754690
if (parameters != null) {
4676-
queryParams.addAll(this.parameterToPair("parameters", parameters));
4691+
for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
4692+
queryParams.addAll(
4693+
this.parameterToPair(
4694+
parameter.getKey(),
4695+
parameter.getValue().toString()
4696+
)
4697+
);
4698+
}
46774699
}
46784700

46794701
headers.put("Accept", "application/json");
@@ -4691,7 +4713,7 @@ private Call putCall(
46914713

46924714
private Call putValidateBeforeCall(
46934715
String path,
4694-
String parameters,
4716+
Map<String, Object> parameters,
46954717
Object body,
46964718
final ApiCallback<Object> _callback
46974719
) throws AlgoliaRuntimeException {
@@ -4710,14 +4732,13 @@ private Call putValidateBeforeCall(
47104732
*
47114733
* @param path The path of the API endpoint to target, anything after the /1 needs to be
47124734
* specified. (required)
4713-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
4714-
* query made with this API key. (optional)
4735+
* @param parameters Query parameters to be applied to the current query. (optional)
47154736
* @param body The parameters to send with the custom request. (optional)
47164737
* @return Object
47174738
* @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot
47184739
* deserialize the response body
47194740
*/
4720-
public Object put(String path, String parameters, Object body)
4741+
public Object put(String path, Map<String, Object> parameters, Object body)
47214742
throws AlgoliaRuntimeException {
47224743
Call req = putValidateBeforeCall(path, parameters, body, null);
47234744
if (req instanceof CallEcho) {
@@ -4730,16 +4751,15 @@ public Object put(String path, String parameters, Object body)
47304751
}
47314752

47324753
public Object put(String path) throws AlgoliaRuntimeException {
4733-
return this.put(path, null, null);
4754+
return this.put(path, new HashMap<>(), null);
47344755
}
47354756

47364757
/**
47374758
* (asynchronously) This method allow you to send requests to the Algolia REST API.
47384759
*
47394760
* @param path The path of the API endpoint to target, anything after the /1 needs to be
47404761
* specified. (required)
4741-
* @param parameters URL-encoded query string. Force some query parameters to be applied for each
4742-
* query made with this API key. (optional)
4762+
* @param parameters Query parameters to be applied to the current query. (optional)
47434763
* @param body The parameters to send with the custom request. (optional)
47444764
* @param _callback The callback to be executed when the API call finishes
47454765
* @return The request call
@@ -4748,7 +4768,7 @@ public Object put(String path) throws AlgoliaRuntimeException {
47484768
*/
47494769
public Call putAsync(
47504770
String path,
4751-
String parameters,
4771+
Map<String, Object> parameters,
47524772
Object body,
47534773
final ApiCallback<Object> _callback
47544774
) throws AlgoliaRuntimeException {

0 commit comments

Comments
 (0)