forked from loafle/openapi-generator-original
Remove localVarPrefix from Java client (#2045)
* remove localVarPrefix from java client * rename local varaible * update samples
This commit is contained in:
@@ -36,33 +36,33 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AnotherFakeApi {
|
||||
private ApiClient apiClient;
|
||||
private ApiClient localVarApiClient;
|
||||
|
||||
public AnotherFakeApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public AnotherFakeApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
return localVarApiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build call for call123testSpecialTags
|
||||
* @param body client model (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @param _progressListener Progress listener
|
||||
* @param _progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public okhttp3.Call call123testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
public okhttp3.Call call123testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
@@ -75,7 +75,7 @@ public class AnotherFakeApi {
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
@@ -83,27 +83,27 @@ public class AnotherFakeApi {
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if (progressListener != null) {
|
||||
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
if (_progressListener != null) {
|
||||
localVarApiClient.setHttpClient(localVarApiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
@Override
|
||||
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
|
||||
okhttp3.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.body(new ProgressResponseBody(originalResponse.body(), _progressListener))
|
||||
.build();
|
||||
}
|
||||
}).build());
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
@@ -111,8 +111,8 @@ public class AnotherFakeApi {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call call = call123testSpecialTagsCall(body, progressListener, progressRequestListener);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = call123testSpecialTagsCall(body, _progressListener, _progressRequestListener);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ public class AnotherFakeApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public Client call123testSpecialTags(Client body) throws ApiException {
|
||||
ApiResponse<Client> resp = call123testSpecialTagsWithHttpInfo(body);
|
||||
return resp.getData();
|
||||
ApiResponse<Client> localVarResp = call123testSpecialTagsWithHttpInfo(body);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,43 +136,43 @@ public class AnotherFakeApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Client> call123testSpecialTagsWithHttpInfo(Client body) throws ApiException {
|
||||
okhttp3.Call call = call123testSpecialTagsValidateBeforeCall(body, null, null);
|
||||
okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, null, null);
|
||||
Type localVarReturnType = new TypeToken<Client>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags (asynchronously)
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param body client model (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public okhttp3.Call call123testSpecialTagsAsync(Client body, final ApiCallback<Client> callback) throws ApiException {
|
||||
public okhttp3.Call call123testSpecialTagsAsync(Client body, final ApiCallback<Client> _callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
ProgressResponseBody.ProgressListener _progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener _progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
if (_callback != null) {
|
||||
_progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
_callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
_progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
_callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
okhttp3.Call call = call123testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener);
|
||||
okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, _progressListener, _progressRequestListener);
|
||||
Type localVarReturnType = new TypeToken<Client>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,33 +36,33 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class FakeClassnameTags123Api {
|
||||
private ApiClient apiClient;
|
||||
private ApiClient localVarApiClient;
|
||||
|
||||
public FakeClassnameTags123Api() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public FakeClassnameTags123Api(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
return localVarApiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build call for testClassname
|
||||
* @param body client model (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @param _progressListener Progress listener
|
||||
* @param _progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public okhttp3.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
public okhttp3.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
@@ -75,7 +75,7 @@ public class FakeClassnameTags123Api {
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
@@ -83,27 +83,27 @@ public class FakeClassnameTags123Api {
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if (progressListener != null) {
|
||||
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
if (_progressListener != null) {
|
||||
localVarApiClient.setHttpClient(localVarApiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
@Override
|
||||
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
|
||||
okhttp3.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.body(new ProgressResponseBody(originalResponse.body(), _progressListener))
|
||||
.build();
|
||||
}
|
||||
}).build());
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key_query" };
|
||||
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
@@ -111,8 +111,8 @@ public class FakeClassnameTags123Api {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call call = testClassnameCall(body, progressListener, progressRequestListener);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = testClassnameCall(body, _progressListener, _progressRequestListener);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ public class FakeClassnameTags123Api {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public Client testClassname(Client body) throws ApiException {
|
||||
ApiResponse<Client> resp = testClassnameWithHttpInfo(body);
|
||||
return resp.getData();
|
||||
ApiResponse<Client> localVarResp = testClassnameWithHttpInfo(body);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,43 +136,43 @@ public class FakeClassnameTags123Api {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Client> testClassnameWithHttpInfo(Client body) throws ApiException {
|
||||
okhttp3.Call call = testClassnameValidateBeforeCall(body, null, null);
|
||||
okhttp3.Call localVarCall = testClassnameValidateBeforeCall(body, null, null);
|
||||
Type localVarReturnType = new TypeToken<Client>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case (asynchronously)
|
||||
* To test class name in snake case
|
||||
* @param body client model (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public okhttp3.Call testClassnameAsync(Client body, final ApiCallback<Client> callback) throws ApiException {
|
||||
public okhttp3.Call testClassnameAsync(Client body, final ApiCallback<Client> _callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
ProgressResponseBody.ProgressListener _progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener _progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
if (_callback != null) {
|
||||
_progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
_callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
_progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
_callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
okhttp3.Call call = testClassnameValidateBeforeCall(body, progressListener, progressRequestListener);
|
||||
okhttp3.Call localVarCall = testClassnameValidateBeforeCall(body, _progressListener, _progressRequestListener);
|
||||
Type localVarReturnType = new TypeToken<Client>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,38 +36,38 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class StoreApi {
|
||||
private ApiClient apiClient;
|
||||
private ApiClient localVarApiClient;
|
||||
|
||||
public StoreApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public StoreApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
return localVarApiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
this.localVarApiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build call for deleteOrder
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @param _progressListener Progress listener
|
||||
* @param _progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public okhttp3.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
public okhttp3.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = new Object();
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -76,7 +76,7 @@ public class StoreApi {
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
@@ -84,27 +84,27 @@ public class StoreApi {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if (progressListener != null) {
|
||||
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
if (_progressListener != null) {
|
||||
localVarApiClient.setHttpClient(localVarApiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
@Override
|
||||
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
|
||||
okhttp3.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.body(new ProgressResponseBody(originalResponse.body(), _progressListener))
|
||||
.build();
|
||||
}
|
||||
}).build());
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@@ -112,8 +112,8 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call call = deleteOrderCall(orderId, progressListener, progressRequestListener);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = deleteOrderCall(orderId, _progressListener, _progressRequestListener);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
@@ -135,51 +135,51 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
|
||||
okhttp3.Call call = deleteOrderValidateBeforeCall(orderId, null, null);
|
||||
return apiClient.execute(call);
|
||||
okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, null, null);
|
||||
return localVarApiClient.execute(localVarCall);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID (asynchronously)
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback<Void> callback) throws ApiException {
|
||||
public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback<Void> _callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
ProgressResponseBody.ProgressListener _progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener _progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
if (_callback != null) {
|
||||
_progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
_callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
_progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
_callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
okhttp3.Call call = deleteOrderValidateBeforeCall(orderId, progressListener, progressRequestListener);
|
||||
apiClient.executeAsync(call, callback);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, _progressListener, _progressRequestListener);
|
||||
localVarApiClient.executeAsync(localVarCall, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for getInventory
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @param _progressListener Progress listener
|
||||
* @param _progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public okhttp3.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
public okhttp3.Call getInventoryCall(final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = new Object();
|
||||
|
||||
// create path and map variables
|
||||
@@ -192,7 +192,7 @@ public class StoreApi {
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
@@ -200,31 +200,31 @@ public class StoreApi {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if (progressListener != null) {
|
||||
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
if (_progressListener != null) {
|
||||
localVarApiClient.setHttpClient(localVarApiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
@Override
|
||||
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
|
||||
okhttp3.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.body(new ProgressResponseBody(originalResponse.body(), _progressListener))
|
||||
.build();
|
||||
}
|
||||
}).build());
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key" };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call getInventoryValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
private okhttp3.Call getInventoryValidateBeforeCall(final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
|
||||
|
||||
okhttp3.Call call = getInventoryCall(progressListener, progressRequestListener);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = getInventoryCall(_progressListener, _progressRequestListener);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
@@ -235,8 +235,8 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public Map<String, Integer> getInventory() throws ApiException {
|
||||
ApiResponse<Map<String, Integer>> resp = getInventoryWithHttpInfo();
|
||||
return resp.getData();
|
||||
ApiResponse<Map<String, Integer>> localVarResp = getInventoryWithHttpInfo();
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,58 +246,58 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
|
||||
okhttp3.Call call = getInventoryValidateBeforeCall(null, null);
|
||||
okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null, null);
|
||||
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status (asynchronously)
|
||||
* Returns a map of status codes to quantities
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public okhttp3.Call getInventoryAsync(final ApiCallback<Map<String, Integer>> callback) throws ApiException {
|
||||
public okhttp3.Call getInventoryAsync(final ApiCallback<Map<String, Integer>> _callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
ProgressResponseBody.ProgressListener _progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener _progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
if (_callback != null) {
|
||||
_progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
_callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
_progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
_callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
okhttp3.Call call = getInventoryValidateBeforeCall(progressListener, progressRequestListener);
|
||||
okhttp3.Call localVarCall = getInventoryValidateBeforeCall(_progressListener, _progressRequestListener);
|
||||
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for getOrderById
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @param _progressListener Progress listener
|
||||
* @param _progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public okhttp3.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
public okhttp3.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = new Object();
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -306,7 +306,7 @@ public class StoreApi {
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
@@ -314,27 +314,27 @@ public class StoreApi {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if (progressListener != null) {
|
||||
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
if (_progressListener != null) {
|
||||
localVarApiClient.setHttpClient(localVarApiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
@Override
|
||||
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
|
||||
okhttp3.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.body(new ProgressResponseBody(originalResponse.body(), _progressListener))
|
||||
.build();
|
||||
}
|
||||
}).build());
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@@ -342,8 +342,8 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = getOrderByIdCall(orderId, _progressListener, _progressRequestListener);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
@@ -355,8 +355,8 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public Order getOrderById(Long orderId) throws ApiException {
|
||||
ApiResponse<Order> resp = getOrderByIdWithHttpInfo(orderId);
|
||||
return resp.getData();
|
||||
ApiResponse<Order> localVarResp = getOrderByIdWithHttpInfo(orderId);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,54 +367,54 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Order> getOrderByIdWithHttpInfo(Long orderId) throws ApiException {
|
||||
okhttp3.Call call = getOrderByIdValidateBeforeCall(orderId, null, null);
|
||||
okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null, null);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID (asynchronously)
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback<Order> callback) throws ApiException {
|
||||
public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback<Order> _callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
ProgressResponseBody.ProgressListener _progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener _progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
if (_callback != null) {
|
||||
_progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
_callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
_progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
_callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
okhttp3.Call call = getOrderByIdValidateBeforeCall(orderId, progressListener, progressRequestListener);
|
||||
okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, _progressListener, _progressRequestListener);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for placeOrder
|
||||
* @param body order placed for purchasing the pet (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @param _progressListener Progress listener
|
||||
* @param _progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public okhttp3.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
public okhttp3.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
@@ -427,7 +427,7 @@ public class StoreApi {
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
@@ -435,27 +435,27 @@ public class StoreApi {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if (progressListener != null) {
|
||||
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
if (_progressListener != null) {
|
||||
localVarApiClient.setHttpClient(localVarApiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() {
|
||||
@Override
|
||||
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
|
||||
okhttp3.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.body(new ProgressResponseBody(originalResponse.body(), _progressListener))
|
||||
.build();
|
||||
}
|
||||
}).build());
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ProgressResponseBody.ProgressListener _progressListener, final ProgressRequestBody.ProgressRequestListener _progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
@@ -463,8 +463,8 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call call = placeOrderCall(body, progressListener, progressRequestListener);
|
||||
return call;
|
||||
okhttp3.Call localVarCall = placeOrderCall(body, _progressListener, _progressRequestListener);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
@@ -476,8 +476,8 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public Order placeOrder(Order body) throws ApiException {
|
||||
ApiResponse<Order> resp = placeOrderWithHttpInfo(body);
|
||||
return resp.getData();
|
||||
ApiResponse<Order> localVarResp = placeOrderWithHttpInfo(body);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,43 +488,43 @@ public class StoreApi {
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Order> placeOrderWithHttpInfo(Order body) throws ApiException {
|
||||
okhttp3.Call call = placeOrderValidateBeforeCall(body, null, null);
|
||||
okhttp3.Call localVarCall = placeOrderValidateBeforeCall(body, null, null);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet (asynchronously)
|
||||
*
|
||||
* @param body order placed for purchasing the pet (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public okhttp3.Call placeOrderAsync(Order body, final ApiCallback<Order> callback) throws ApiException {
|
||||
public okhttp3.Call placeOrderAsync(Order body, final ApiCallback<Order> _callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
ProgressResponseBody.ProgressListener _progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener _progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
if (_callback != null) {
|
||||
_progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
_callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
_progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
_callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
okhttp3.Call call = placeOrderValidateBeforeCall(body, progressListener, progressRequestListener);
|
||||
okhttp3.Call localVarCall = placeOrderValidateBeforeCall(body, _progressListener, _progressRequestListener);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user