Skip to content

Commit 32cabcf

Browse files
committed
updated petstore with latest okhttp changes
1 parent 1ff18c4 commit 32cabcf

File tree

4 files changed

+126
-138
lines changed

4 files changed

+126
-138
lines changed

samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636

3737
import com.google.gson.reflect.TypeToken;
3838

39-
import com.squareup.okhttp.Call;
40-
import com.squareup.okhttp.Interceptor;
41-
4239
import java.io.IOException;
4340

4441
import java.util.Date;
@@ -70,7 +67,7 @@ public void setApiClient(ApiClient apiClient) {
7067
}
7168

7269
/* Build call for testEndpointParameters */
73-
private Call testEndpointParametersCall(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
70+
private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
7471
Object localVarPostBody = null;
7572

7673
// verify the required parameter 'number' is set
@@ -140,9 +137,9 @@ private Call testEndpointParametersCall(BigDecimal number, Double _double, Strin
140137
localVarHeaderParams.put("Content-Type", localVarContentType);
141138

142139
if(progressListener != null) {
143-
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
140+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
144141
@Override
145-
public com.squareup.okhttp.Response intercept(Interceptor.Chain chain) throws IOException {
142+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
146143
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
147144
return originalResponse.newBuilder()
148145
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
@@ -195,7 +192,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String str
195192
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
196193
*/
197194
public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
198-
Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, null, null);
195+
com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, null, null);
199196
return apiClient.execute(call);
200197
}
201198

@@ -218,7 +215,7 @@ public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, D
218215
* @return The request call
219216
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
220217
*/
221-
public Call testEndpointParametersAsync(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ApiCallback<Void> callback) throws ApiException {
218+
public com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ApiCallback<Void> callback) throws ApiException {
222219

223220
ProgressResponseBody.ProgressListener progressListener = null;
224221
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
@@ -239,7 +236,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
239236
};
240237
}
241238

242-
Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, progressListener, progressRequestListener);
239+
com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, progressListener, progressRequestListener);
243240
apiClient.executeAsync(call, callback);
244241
return call;
245242
}

0 commit comments

Comments
 (0)