From 706192980c68be9dcaac06b8314d2daa1c0fc57e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 26 Jan 2019 22:03:58 +0800 Subject: [PATCH] update samples --- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 ++-- .../org/openapitools/client/api/FakeApi.java | 24 +++++++++---------- .../org/openapitools/client/api/FakeApi.java | 24 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 51c8a68d93a..e1bac68cf7d 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -864,7 +864,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } @@ -942,7 +942,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 751f64d3e83..08aef7f973b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -70,7 +70,7 @@ public class FakeApi { * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call createXmlItemCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = xmlItem; // create path and map variables @@ -95,15 +95,15 @@ public class FakeApi { localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() { @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + 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)) - .build(); + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); } - }); + }).build()); } String[] localVarAuthNames = new String[] { }; @@ -111,7 +111,7 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'xmlItem' is set if (xmlItem == null) { @@ -119,7 +119,7 @@ public class FakeApi { } - com.squareup.okhttp.Call call = createXmlItemCall(xmlItem, progressListener, progressRequestListener); + okhttp3.Call call = createXmlItemCall(xmlItem, progressListener, progressRequestListener); return call; } @@ -142,7 +142,7 @@ public class FakeApi { * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { - com.squareup.okhttp.Call call = createXmlItemValidateBeforeCall(xmlItem, null, null); + okhttp3.Call call = createXmlItemValidateBeforeCall(xmlItem, null, null); return apiClient.execute(call); } @@ -154,7 +154,7 @@ public class FakeApi { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback callback) throws ApiException { + public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -175,7 +175,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = createXmlItemValidateBeforeCall(xmlItem, progressListener, progressRequestListener); + okhttp3.Call call = createXmlItemValidateBeforeCall(xmlItem, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 751f64d3e83..08aef7f973b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -70,7 +70,7 @@ public class FakeApi { * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call createXmlItemCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = xmlItem; // create path and map variables @@ -95,15 +95,15 @@ public class FakeApi { localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().addNetworkInterceptor(new okhttp3.Interceptor() { @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + 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)) - .build(); + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); } - }); + }).build()); } String[] localVarAuthNames = new String[] { }; @@ -111,7 +111,7 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private okhttp3.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'xmlItem' is set if (xmlItem == null) { @@ -119,7 +119,7 @@ public class FakeApi { } - com.squareup.okhttp.Call call = createXmlItemCall(xmlItem, progressListener, progressRequestListener); + okhttp3.Call call = createXmlItemCall(xmlItem, progressListener, progressRequestListener); return call; } @@ -142,7 +142,7 @@ public class FakeApi { * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { - com.squareup.okhttp.Call call = createXmlItemValidateBeforeCall(xmlItem, null, null); + okhttp3.Call call = createXmlItemValidateBeforeCall(xmlItem, null, null); return apiClient.execute(call); } @@ -154,7 +154,7 @@ public class FakeApi { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback callback) throws ApiException { + public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -175,7 +175,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = createXmlItemValidateBeforeCall(xmlItem, progressListener, progressRequestListener); + okhttp3.Call call = createXmlItemValidateBeforeCall(xmlItem, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; }