Skip to content

Commit e2932cd

Browse files
algolia-botFluf22millotp
committed
feat(clients): endpoint level timeout part 2 [skip-bc] (generated)
algolia/api-clients-automation#4318 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 81715b7 commit e2932cd

12 files changed

+946
-644
lines changed

algoliasearch/src/main/java/com/algolia/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import java.util.concurrent.ExecutorService;
1818
import java.util.stream.Collectors;
1919
import javax.annotation.Nonnull;
20-
import org.jetbrains.annotations.Nullable;
20+
import javax.annotation.Nullable;
2121

2222
/**
2323
* Represents a base client for making API requests. The client uses a {@link Requester} for

algoliasearch/src/main/java/com/algolia/api/AbtestingClient.java

Lines changed: 55 additions & 37 deletions
Large diffs are not rendered by default.

algoliasearch/src/main/java/com/algolia/api/AnalyticsClient.java

Lines changed: 138 additions & 102 deletions
Large diffs are not rendered by default.

algoliasearch/src/main/java/com/algolia/api/IngestionClient.java

Lines changed: 235 additions & 159 deletions
Large diffs are not rendered by default.

algoliasearch/src/main/java/com/algolia/api/InsightsClient.java

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.util.Map;
1818
import java.util.concurrent.CompletableFuture;
1919
import javax.annotation.Nonnull;
20+
import javax.annotation.Nullable;
2021

2122
public class InsightsClient extends ApiClient {
2223

@@ -79,7 +80,7 @@ private static List<Host> getDefaultHosts(String region) throws AlgoliaRuntimeEx
7980
* the transporter requestOptions.
8081
* @throws AlgoliaRuntimeException If it fails to process the API call
8182
*/
82-
public Object customDelete(@Nonnull String path, Map<String, Object> parameters, RequestOptions requestOptions)
83+
public Object customDelete(@Nonnull String path, Map<String, Object> parameters, @Nullable RequestOptions requestOptions)
8384
throws AlgoliaRuntimeException {
8485
return LaunderThrowable.await(customDeleteAsync(path, parameters, requestOptions));
8586
}
@@ -103,7 +104,7 @@ public Object customDelete(@Nonnull String path, Map<String, Object> parameters)
103104
* the transporter requestOptions.
104105
* @throws AlgoliaRuntimeException If it fails to process the API call
105106
*/
106-
public Object customDelete(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
107+
public Object customDelete(@Nonnull String path, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
107108
return this.customDelete(path, null, requestOptions);
108109
}
109110

@@ -126,8 +127,11 @@ public Object customDelete(@Nonnull String path) throws AlgoliaRuntimeException
126127
* the transporter requestOptions.
127128
* @throws AlgoliaRuntimeException If it fails to process the API call
128129
*/
129-
public CompletableFuture<Object> customDeleteAsync(@Nonnull String path, Map<String, Object> parameters, RequestOptions requestOptions)
130-
throws AlgoliaRuntimeException {
130+
public CompletableFuture<Object> customDeleteAsync(
131+
@Nonnull String path,
132+
Map<String, Object> parameters,
133+
@Nullable RequestOptions requestOptions
134+
) throws AlgoliaRuntimeException {
131135
Parameters.requireNonNull(path, "Parameter `path` is required when calling `customDelete`.");
132136

133137
HttpRequest request = HttpRequest.builder().setPathEncoded("/{path}", path).setMethod("DELETE").addQueryParameters(parameters).build();
@@ -153,7 +157,8 @@ public CompletableFuture<Object> customDeleteAsync(@Nonnull String path, Map<Str
153157
* the transporter requestOptions.
154158
* @throws AlgoliaRuntimeException If it fails to process the API call
155159
*/
156-
public CompletableFuture<Object> customDeleteAsync(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
160+
public CompletableFuture<Object> customDeleteAsync(@Nonnull String path, @Nullable RequestOptions requestOptions)
161+
throws AlgoliaRuntimeException {
157162
return this.customDeleteAsync(path, null, requestOptions);
158163
}
159164

@@ -176,7 +181,7 @@ public CompletableFuture<Object> customDeleteAsync(@Nonnull String path) throws
176181
* the transporter requestOptions.
177182
* @throws AlgoliaRuntimeException If it fails to process the API call
178183
*/
179-
public Object customGet(@Nonnull String path, Map<String, Object> parameters, RequestOptions requestOptions)
184+
public Object customGet(@Nonnull String path, Map<String, Object> parameters, @Nullable RequestOptions requestOptions)
180185
throws AlgoliaRuntimeException {
181186
return LaunderThrowable.await(customGetAsync(path, parameters, requestOptions));
182187
}
@@ -200,7 +205,7 @@ public Object customGet(@Nonnull String path, Map<String, Object> parameters) th
200205
* the transporter requestOptions.
201206
* @throws AlgoliaRuntimeException If it fails to process the API call
202207
*/
203-
public Object customGet(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
208+
public Object customGet(@Nonnull String path, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
204209
return this.customGet(path, null, requestOptions);
205210
}
206211

@@ -223,8 +228,11 @@ public Object customGet(@Nonnull String path) throws AlgoliaRuntimeException {
223228
* the transporter requestOptions.
224229
* @throws AlgoliaRuntimeException If it fails to process the API call
225230
*/
226-
public CompletableFuture<Object> customGetAsync(@Nonnull String path, Map<String, Object> parameters, RequestOptions requestOptions)
227-
throws AlgoliaRuntimeException {
231+
public CompletableFuture<Object> customGetAsync(
232+
@Nonnull String path,
233+
Map<String, Object> parameters,
234+
@Nullable RequestOptions requestOptions
235+
) throws AlgoliaRuntimeException {
228236
Parameters.requireNonNull(path, "Parameter `path` is required when calling `customGet`.");
229237

230238
HttpRequest request = HttpRequest.builder().setPathEncoded("/{path}", path).setMethod("GET").addQueryParameters(parameters).build();
@@ -250,7 +258,8 @@ public CompletableFuture<Object> customGetAsync(@Nonnull String path, Map<String
250258
* the transporter requestOptions.
251259
* @throws AlgoliaRuntimeException If it fails to process the API call
252260
*/
253-
public CompletableFuture<Object> customGetAsync(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
261+
public CompletableFuture<Object> customGetAsync(@Nonnull String path, @Nullable RequestOptions requestOptions)
262+
throws AlgoliaRuntimeException {
254263
return this.customGetAsync(path, null, requestOptions);
255264
}
256265

@@ -274,7 +283,7 @@ public CompletableFuture<Object> customGetAsync(@Nonnull String path) throws Alg
274283
* the transporter requestOptions.
275284
* @throws AlgoliaRuntimeException If it fails to process the API call
276285
*/
277-
public Object customPost(@Nonnull String path, Map<String, Object> parameters, Object body, RequestOptions requestOptions)
286+
public Object customPost(@Nonnull String path, Map<String, Object> parameters, Object body, @Nullable RequestOptions requestOptions)
278287
throws AlgoliaRuntimeException {
279288
return LaunderThrowable.await(customPostAsync(path, parameters, body, requestOptions));
280289
}
@@ -299,7 +308,7 @@ public Object customPost(@Nonnull String path, Map<String, Object> parameters, O
299308
* the transporter requestOptions.
300309
* @throws AlgoliaRuntimeException If it fails to process the API call
301310
*/
302-
public Object customPost(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
311+
public Object customPost(@Nonnull String path, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
303312
return this.customPost(path, null, null, requestOptions);
304313
}
305314

@@ -327,7 +336,7 @@ public CompletableFuture<Object> customPostAsync(
327336
@Nonnull String path,
328337
Map<String, Object> parameters,
329338
Object body,
330-
RequestOptions requestOptions
339+
@Nullable RequestOptions requestOptions
331340
) throws AlgoliaRuntimeException {
332341
Parameters.requireNonNull(path, "Parameter `path` is required when calling `customPost`.");
333342

@@ -361,7 +370,8 @@ public CompletableFuture<Object> customPostAsync(@Nonnull String path, Map<Strin
361370
* the transporter requestOptions.
362371
* @throws AlgoliaRuntimeException If it fails to process the API call
363372
*/
364-
public CompletableFuture<Object> customPostAsync(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
373+
public CompletableFuture<Object> customPostAsync(@Nonnull String path, @Nullable RequestOptions requestOptions)
374+
throws AlgoliaRuntimeException {
365375
return this.customPostAsync(path, null, null, requestOptions);
366376
}
367377

@@ -385,7 +395,7 @@ public CompletableFuture<Object> customPostAsync(@Nonnull String path) throws Al
385395
* the transporter requestOptions.
386396
* @throws AlgoliaRuntimeException If it fails to process the API call
387397
*/
388-
public Object customPut(@Nonnull String path, Map<String, Object> parameters, Object body, RequestOptions requestOptions)
398+
public Object customPut(@Nonnull String path, Map<String, Object> parameters, Object body, @Nullable RequestOptions requestOptions)
389399
throws AlgoliaRuntimeException {
390400
return LaunderThrowable.await(customPutAsync(path, parameters, body, requestOptions));
391401
}
@@ -410,7 +420,7 @@ public Object customPut(@Nonnull String path, Map<String, Object> parameters, Ob
410420
* the transporter requestOptions.
411421
* @throws AlgoliaRuntimeException If it fails to process the API call
412422
*/
413-
public Object customPut(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
423+
public Object customPut(@Nonnull String path, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
414424
return this.customPut(path, null, null, requestOptions);
415425
}
416426

@@ -438,7 +448,7 @@ public CompletableFuture<Object> customPutAsync(
438448
@Nonnull String path,
439449
Map<String, Object> parameters,
440450
Object body,
441-
RequestOptions requestOptions
451+
@Nullable RequestOptions requestOptions
442452
) throws AlgoliaRuntimeException {
443453
Parameters.requireNonNull(path, "Parameter `path` is required when calling `customPut`.");
444454

@@ -472,7 +482,8 @@ public CompletableFuture<Object> customPutAsync(@Nonnull String path, Map<String
472482
* the transporter requestOptions.
473483
* @throws AlgoliaRuntimeException If it fails to process the API call
474484
*/
475-
public CompletableFuture<Object> customPutAsync(@Nonnull String path, RequestOptions requestOptions) throws AlgoliaRuntimeException {
485+
public CompletableFuture<Object> customPutAsync(@Nonnull String path, @Nullable RequestOptions requestOptions)
486+
throws AlgoliaRuntimeException {
476487
return this.customPutAsync(path, null, null, requestOptions);
477488
}
478489

@@ -496,7 +507,7 @@ public CompletableFuture<Object> customPutAsync(@Nonnull String path) throws Alg
496507
* the transporter requestOptions.
497508
* @throws AlgoliaRuntimeException If it fails to process the API call
498509
*/
499-
public void deleteUserToken(@Nonnull String userToken, RequestOptions requestOptions) throws AlgoliaRuntimeException {
510+
public void deleteUserToken(@Nonnull String userToken, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
500511
LaunderThrowable.await(deleteUserTokenAsync(userToken, requestOptions));
501512
return;
502513
}
@@ -523,7 +534,7 @@ public void deleteUserToken(@Nonnull String userToken) throws AlgoliaRuntimeExce
523534
* the transporter requestOptions.
524535
* @throws AlgoliaRuntimeException If it fails to process the API call
525536
*/
526-
public CompletableFuture<Void> deleteUserTokenAsync(@Nonnull String userToken, RequestOptions requestOptions)
537+
public CompletableFuture<Void> deleteUserTokenAsync(@Nonnull String userToken, @Nullable RequestOptions requestOptions)
527538
throws AlgoliaRuntimeException {
528539
Parameters.requireNonNull(userToken, "Parameter `userToken` is required when calling `deleteUserToken`.");
529540

@@ -552,7 +563,8 @@ public CompletableFuture<Void> deleteUserTokenAsync(@Nonnull String userToken) t
552563
* the transporter requestOptions.
553564
* @throws AlgoliaRuntimeException If it fails to process the API call
554565
*/
555-
public EventsResponse pushEvents(@Nonnull InsightsEvents insightsEvents, RequestOptions requestOptions) throws AlgoliaRuntimeException {
566+
public EventsResponse pushEvents(@Nonnull InsightsEvents insightsEvents, @Nullable RequestOptions requestOptions)
567+
throws AlgoliaRuntimeException {
556568
return LaunderThrowable.await(pushEventsAsync(insightsEvents, requestOptions));
557569
}
558570

@@ -576,7 +588,7 @@ public EventsResponse pushEvents(@Nonnull InsightsEvents insightsEvents) throws
576588
* the transporter requestOptions.
577589
* @throws AlgoliaRuntimeException If it fails to process the API call
578590
*/
579-
public CompletableFuture<EventsResponse> pushEventsAsync(@Nonnull InsightsEvents insightsEvents, RequestOptions requestOptions)
591+
public CompletableFuture<EventsResponse> pushEventsAsync(@Nonnull InsightsEvents insightsEvents, @Nullable RequestOptions requestOptions)
580592
throws AlgoliaRuntimeException {
581593
Parameters.requireNonNull(insightsEvents, "Parameter `insightsEvents` is required when calling `pushEvents`.");
582594

0 commit comments

Comments
 (0)