@@ -6,6 +6,7 @@ import {{invokerPackage}}.ApiClient;
6
6
import { {invokerPackage} }.config.ClientOptions;
7
7
8
8
import com.fasterxml.jackson.core.type.TypeReference;
9
+ import org.jetbrains.annotations.Nullable;
9
10
10
11
import okhttp3.Call;
11
12
import okhttp3.Request;
@@ -138,7 +139,7 @@ public class {{classname}} extends ApiClient {
138
139
{ {#vendorExtensions} }{ {#x-is-generic} }* @param innerType The class held by the index, could be your custom class or { @link Object} .{ {/x-is-generic} }{ {/vendorExtensions} }
139
140
* @param requestOptions The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
140
141
{ {> api_javadoc} }
141
- public { {> return_type} } { {operationId} }({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} }{ {^-last} }, { {/-last} }{ {/requiredParams} }{ {#hasRequiredParams} }{ {#hasOptionalParams} },{ {/hasOptionalParams} }{ {/hasRequiredParams} }{ {#optionalParams} } { {{dataType} }} { {paramName} }{ {^-last} }, { {/-last} }{ {/optionalParams} }{ {#vendorExtensions} }{ {#x-is-generic} }, Class<T > innerType{ {/x-is-generic} }{ {/vendorExtensions} }{ {#hasParams} }, { {/hasParams} }RequestOptions requestOptions) throws AlgoliaRuntimeException {
142
+ public { {> return_type} } { {operationId} }({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} }{ {^-last} }, { {/-last} }{ {/requiredParams} }{ {#hasRequiredParams} }{ {#hasOptionalParams} },{ {/hasOptionalParams} }{ {/hasRequiredParams} }{ {#optionalParams} } { {{dataType} }} { {paramName} }{ {^-last} }, { {/-last} }{ {/optionalParams} }{ {#vendorExtensions} }{ {#x-is-generic} }, Class<T > innerType{ {/x-is-generic} }{ {/vendorExtensions} }{ {#hasParams} }, { {/hasParams} }@Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
142
143
{{#returnType} }return { {/returnType} }LaunderThrowable.await({ {operationId} }Async({ {#allParams} }{ {paramName} }, { {/allParams} }{ {#vendorExtensions} }{ {#x-is-generic} }innerType, { {/x-is-generic} }{ {/vendorExtensions} }requestOptions));
143
144
{ {^returnType} }return ;{ {/returnType} }
144
145
}
@@ -161,7 +162,7 @@ public class {{classname}} extends ApiClient {
161
162
{ {#vendorExtensions} }{ {#x-is-generic} }* @param innerType The class held by the index, could be your custom class or { @link Object} .{ {/x-is-generic} }{ {/vendorExtensions} }
162
163
* @param requestOptions The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
163
164
{ {> api_javadoc} }
164
- public { {> return_type} } { {operationId} }({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} }, { {/requiredParams} }{ {#vendorExtensions} }{ {#x-is-generic} }Class<T > innerType, { {/x-is-generic} }{ {/vendorExtensions} }RequestOptions requestOptions) throws AlgoliaRuntimeException {
165
+ public { {> return_type} } { {operationId} }({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} }, { {/requiredParams} }{ {#vendorExtensions} }{ {#x-is-generic} }Class<T > innerType, { {/x-is-generic} }{ {/vendorExtensions} } @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
165
166
{{#returnType} }return { {/returnType} }this.{ {operationId} }({ {#requiredParams} }{ {paramName} }{ {^-last} }, { {/-last} }{ {/requiredParams} }{ {#requiredParams.0} },{ {/requiredParams.0} }{ {#optionalParams} }null{ {^-last} },{ {/-last} }{ {/optionalParams} }, { {#vendorExtensions} }{ {#x-is-generic} }innerType, { {/x-is-generic} }{ {/vendorExtensions} }requestOptions);
166
167
}
167
168
{ {/optionalParams.0} }
@@ -185,7 +186,7 @@ public class {{classname}} extends ApiClient {
185
186
* @param innerType The class held by the index, could be your custom class or { @link Object} .{ {/x-is-generic} }{ {/vendorExtensions} }
186
187
* @param requestOptions The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
187
188
{ {> api_javadoc} }
188
- public { {> return_type_async} } { {operationId} }Async({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} },{ {/requiredParams} }{ {#optionalParams} }{ {{dataType} }} { {paramName} }, { {/optionalParams} }{ {#vendorExtensions} }{ {#x-is-generic} }Class<T > innerType, { {/x-is-generic} }{ {/vendorExtensions} }RequestOptions requestOptions) throws AlgoliaRuntimeException {
189
+ public { {> return_type_async} } { {operationId} }Async({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} },{ {/requiredParams} }{ {#optionalParams} }{ {{dataType} }} { {paramName} }, { {/optionalParams} }{ {#vendorExtensions} }{ {#x-is-generic} }Class<T > innerType, { {/x-is-generic} }{ {/vendorExtensions} }@Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
189
190
{{#allParams} }{ {#required} }
190
191
Parameters.requireNonNull({ {paramName} }, "Parameter `{ {paramName} }` is required when calling `{ {operationId} }`.");
191
192
{ {/required} }{ {/allParams} }
@@ -198,7 +199,7 @@ public class {{classname}} extends ApiClient {
198
199
{ {#headerParams} }.addHeader("{ {baseName} }", { {paramName} }){ {/headerParams} }
199
200
{ {#vendorExtensions} }{ {#queryParams} }{ {^x-is-custom-request} }.addQueryParameter("{ {baseName} }", { {paramName} }){ {/x-is-custom-request} }{ {#x-is-custom-request} }.addQueryParameters(parameters){ {/x-is-custom-request} }{ {/queryParams} }{ {/vendorExtensions} }
200
201
.build();
201
- return executeAsync(request, requestOptions, { {#vendorExtensions} }{ {#x-is-generic} }{ {{returnType} }}.class, innerType{ {/x-is-generic} }{ {/vendorExtensions} }{ {^vendorExtensions.x-is-generic} }{ {^returnType} }null{ {/returnType} }{ {#returnType} }new TypeReference<{ {{.} }}>(){ } { {/returnType} }{ {/vendorExtensions.x-is-generic} });
202
+ return executeAsync(request, { {#vendorExtensions.x-timeouts } }new RequestOptions().setReadTimeout(Duration.ofMillis( { {{read } }}L)).setWriteTimeout(Duration.ofMillis( { {{write } }}L)).setConnectTimeout(Duration.ofMillis( { {{connect } }}L)).mergeRight( { {/vendorExtensions.x-timeouts } } requestOptions{ {#vendorExtensions.x-timeouts } }) { {/vendorExtensions.x-timeouts } } , { {#vendorExtensions} }{ {#x-is-generic} }{ {{returnType} }}.class, innerType{ {/x-is-generic} }{ {/vendorExtensions} }{ {^vendorExtensions.x-is-generic} }{ {^returnType} }null{ {/returnType} }{ {#returnType} }new TypeReference<{ {{.} }}>(){ } { {/returnType} }{ {/vendorExtensions.x-is-generic} });
202
203
}
203
204
204
205
{ {! This case only sets `requestOptions` as optional } }
@@ -221,7 +222,7 @@ public class {{classname}} extends ApiClient {
221
222
* @param innerType The class held by the index, could be your custom class or { @link Object} .{ {/x-is-generic} }{ {/vendorExtensions} }
222
223
* @param requestOptions The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
223
224
{ {> api_javadoc} }
224
- public { {> return_type_async} } { {operationId} }Async({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} }, { {/requiredParams} }{ {#vendorExtensions} }{ {#x-is-generic} }Class<T > innerType, { {/x-is-generic} }{ {/vendorExtensions} }RequestOptions requestOptions) throws AlgoliaRuntimeException {
225
+ public { {> return_type_async} } { {operationId} }Async({ {#requiredParams} }@Nonnull { {{dataType} }} { {paramName} }, { {/requiredParams} }{ {#vendorExtensions} }{ {#x-is-generic} }Class<T > innerType, { {/x-is-generic} }{ {/vendorExtensions} }@Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
225
226
return this.{{operationId} }Async({ {#requiredParams} }{ {paramName} }{ {^-last} }, { {/-last} }{ {/requiredParams} }{ {#requiredParams.0} },{ {/requiredParams.0} }{ {#optionalParams} }null{ {^-last} },{ {/-last} }{ {/optionalParams} }, { {#vendorExtensions} }{ {#x-is-generic} }innerType, { {/x-is-generic} }{ {/vendorExtensions} }requestOptions);
226
227
}
227
228
{ {/optionalParams.0} }
0 commit comments