mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 10:26:10 +00:00
adding "Read Timeout" getters and setters for the Jersey and OkHttp (#6853)
* adding "Read Timeout" getters and setters for the Jersey and OkHttp based ApiClients adding "Write Timeout" getters and setters for the OkHttp based ApiClient adding tests for the OkHttpClient covering the new getters and setters * generated files from the bin scripts
This commit is contained in:
@@ -406,7 +406,7 @@ public class ApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tempoaray folder path (for downloading files)
|
||||
* Set the temporary folder path (for downloading files)
|
||||
*
|
||||
* @param tempFolderPath Temporary folder path
|
||||
* @return ApiClient
|
||||
@@ -428,6 +428,7 @@ public class ApiClient {
|
||||
/**
|
||||
* Sets the connect timeout (in milliseconds).
|
||||
* A value of 0 means no timeout, otherwise values must be between 1 and
|
||||
* {@link Integer#MAX_VALUE}.
|
||||
*
|
||||
* @param connectionTimeout connection timeout in milliseconds
|
||||
* @return Api client
|
||||
@@ -437,6 +438,50 @@ public class ApiClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get read timeout (in milliseconds).
|
||||
*
|
||||
* @return Timeout in milliseconds
|
||||
*/
|
||||
public int getReadTimeout() {
|
||||
return httpClient.getReadTimeout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the read timeout (in milliseconds).
|
||||
* A value of 0 means no timeout, otherwise values must be between 1 and
|
||||
* {@link Integer#MAX_VALUE}.
|
||||
*
|
||||
* @param readTimeout read timeout in milliseconds
|
||||
* @return Api client
|
||||
*/
|
||||
public ApiClient setReadTimeout(int readTimeout) {
|
||||
httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get write timeout (in milliseconds).
|
||||
*
|
||||
* @return Timeout in milliseconds
|
||||
*/
|
||||
public int getWriteTimeout() {
|
||||
return httpClient.getWriteTimeout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the write timeout (in milliseconds).
|
||||
* A value of 0 means no timeout, otherwise values must be between 1 and
|
||||
* {@link Integer#MAX_VALUE}.
|
||||
*
|
||||
* @param writeTimeout connection timeout in milliseconds
|
||||
* @return Api client
|
||||
*/
|
||||
public ApiClient setWriteTimeout(int writeTimeout) {
|
||||
httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the given parameter object into string.
|
||||
*
|
||||
|
||||
@@ -63,7 +63,7 @@ public class FakeApi {
|
||||
*/
|
||||
public com.squareup.okhttp.Call testCodeInjectEndRnNRCall(String testCodeInjectEndRnNR, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
@@ -103,18 +103,14 @@ public class FakeApi {
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private com.squareup.okhttp.Call testCodeInjectEndRnNRValidateBeforeCall(String testCodeInjectEndRnNR, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
|
||||
|
||||
|
||||
com.squareup.okhttp.Call call = testCodeInjectEndRnNRCall(testCodeInjectEndRnNR, progressListener, progressRequestListener);
|
||||
return call;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user