diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache
index 134e1443da..c1ba6610c7 100644
--- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache
@@ -155,11 +155,27 @@
jackson-databind
${jackson-version}
+ {{#joda}}
com.fasterxml.jackson.datatype
- jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}
+ jackson-datatype-joda
${jackson-version}
+ {{/joda}}
+ {{#java8}}
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+ {{/java8}}
+ {{#threetenbp}}
+
+ com.github.joschi.jackson
+ jackson-datatype-threetenbp
+ ${jackson-version}
+
+ {{/threetenbp}}
org.apache.oltu.oauth2
org.apache.oltu.oauth2.client
diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
index cfafe2d711..abec9ce20b 100644
--- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
@@ -132,13 +132,20 @@
gson
${gson-version}
- {{^java8}}
+ {{#joda}}
joda-time
joda-time
${jodatime-version}
- {{/java8}}
+ {{/joda}}
+ {{#threetenbp}}
+
+ org.threeten
+ threetenbp
+ ${threetenbp-version}
+
+ {{/threetenbp}}
{{#useBeanValidation}}
diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml
index 680c521fef..506906d891 100644
--- a/samples/client/petstore/java/feign/pom.xml
+++ b/samples/client/petstore/java/feign/pom.xml
@@ -156,8 +156,8 @@
${jackson-version}
- com.fasterxml.jackson.datatype
- jackson-datatype-joda
+ com.github.joschi.jackson
+ jackson-datatype-threetenbp
${jackson-version}
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.travis.yml b/samples/client/petstore/java/okhttp-gson-parcelableModel/.travis.yml
index 33e79472ab..70cb81a67c 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.travis.yml
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.travis.yml
@@ -1,18 +1,6 @@
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
language: java
jdk:
- oraclejdk8
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md
index deb1951c55..1746ccb273 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
+**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md
index be300aad73..651c9d0c43 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md
@@ -15,6 +15,8 @@ Method | HTTP request | Description
To test \"client\" model
+To test \"client\" model
+
### Example
```java
// Import classes:
@@ -137,6 +139,8 @@ null (empty response body)
To test enum parameters
+To test enum parameters
+
### Example
```java
// Import classes:
@@ -151,7 +155,7 @@ List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_exampl
String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array)
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
-BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double)
+Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
try {
apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
@@ -171,7 +175,7 @@ Name | Type | Description | Notes
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
- **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
+ **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
### Return type
@@ -184,6 +188,6 @@ No authorization required
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+ - **Content-Type**: */*
+ - **Accept**: */*
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml
index 4d9277215a..1ba5649a77 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml
@@ -15,6 +15,14 @@
2.2.0
+
+
+ Unlicense
+ http://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
@@ -129,7 +137,6 @@
threetenbp
${threetenbp-version}
-
junit
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiCallback.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiCallback.java
index a2460c37ee..be36cd4675 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiCallback.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiCallback.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java
index fd73902392..c960ab9195 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiException.java
index 02a967d837..d0b5cfc1e5 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiException.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiException.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiResponse.java
index b87ea49a02..6baa9120c6 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiResponse.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiResponse.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Configuration.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Configuration.java
index 57e53b2d59..cbf868efb8 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Configuration.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Configuration.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java
index 1938b3967d..992df6a322 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Pair.java
index 9ad2d24651..b75cd316ac 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Pair.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/Pair.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java
index fee9da83dd..a06ea04a4d 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressResponseBody.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressResponseBody.java
index 761a23a286..48c4bfa92d 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressResponseBody.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressResponseBody.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/StringUtil.java
index 31140c76df..339a3fb36d 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/StringUtil.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/StringUtil.java
@@ -8,18 +8,6 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java
index 4e881aed83..fd71abbad6 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java
@@ -8,488 +8,513 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
-
-
-package io.swagger.client.api;
-
-import io.swagger.client.ApiCallback;
-import io.swagger.client.ApiClient;
-import io.swagger.client.ApiException;
-import io.swagger.client.ApiResponse;
-import io.swagger.client.Configuration;
-import io.swagger.client.Pair;
-import io.swagger.client.ProgressRequestBody;
-import io.swagger.client.ProgressResponseBody;
-
-import com.google.gson.reflect.TypeToken;
-
-import java.io.IOException;
-
-import io.swagger.client.model.Client;
-import org.threeten.bp.OffsetDateTime;
-import org.threeten.bp.LocalDate;
-import java.math.BigDecimal;
-
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class FakeApi {
- private ApiClient apiClient;
-
- public FakeApi() {
- this(Configuration.getDefaultApiClient());
- }
-
- public FakeApi(ApiClient apiClient) {
- this.apiClient = apiClient;
- }
-
- public ApiClient getApiClient() {
- return apiClient;
- }
-
- public void setApiClient(ApiClient apiClient) {
- this.apiClient = apiClient;
- }
-
- /* Build call for testClientModel */
- private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = body;
-
- // verify the required parameter 'body' is set
- if (body == null) {
- throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/fake".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/json"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { };
- return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * To test \"client\" model
- *
- * @param body client model (required)
- * @return Client
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public Client testClientModel(Client body) throws ApiException {
- ApiResponse resp = testClientModelWithHttpInfo(body);
- return resp.getData();
- }
-
- /**
- * To test \"client\" model
- *
- * @param body client model (required)
- * @return ApiResponse<Client>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException {
- com.squareup.okhttp.Call call = testClientModelCall(body, null, null);
- Type localVarReturnType = new TypeToken(){}.getType();
- return apiClient.execute(call, localVarReturnType);
- }
-
- /**
- * To test \"client\" model (asynchronously)
- *
- * @param body client model (required)
- * @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 com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener);
- Type localVarReturnType = new TypeToken(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
- }
- /* Build call for testEndpointParameters */
- private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'number' is set
- if (number == null) {
- throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)");
- }
-
- // verify the required parameter '_double' is set
- if (_double == null) {
- throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)");
- }
-
- // verify the required parameter 'patternWithoutDelimiter' is set
- if (patternWithoutDelimiter == null) {
- throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)");
- }
-
- // verify the required parameter '_byte' is set
- if (_byte == null) {
- throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/fake".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
- if (integer != null)
- localVarFormParams.put("integer", integer);
- if (int32 != null)
- localVarFormParams.put("int32", int32);
- if (int64 != null)
- localVarFormParams.put("int64", int64);
- if (number != null)
- localVarFormParams.put("number", number);
- if (_float != null)
- localVarFormParams.put("float", _float);
- if (_double != null)
- localVarFormParams.put("double", _double);
- if (string != null)
- localVarFormParams.put("string", string);
- if (patternWithoutDelimiter != null)
- localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter);
- if (_byte != null)
- localVarFormParams.put("byte", _byte);
- if (binary != null)
- localVarFormParams.put("binary", binary);
- if (date != null)
- localVarFormParams.put("date", date);
- if (dateTime != null)
- localVarFormParams.put("dateTime", dateTime);
- if (password != null)
- localVarFormParams.put("password", password);
- if (paramCallback != null)
- localVarFormParams.put("callback", paramCallback);
-
- final String[] localVarAccepts = {
- "application/xml; charset=utf-8", "application/json; charset=utf-8"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/xml; charset=utf-8", "application/json; charset=utf-8"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "http_basic_test" };
- return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * @param number None (required)
- * @param _double None (required)
- * @param patternWithoutDelimiter None (required)
- * @param _byte None (required)
- * @param integer None (optional)
- * @param int32 None (optional)
- * @param int64 None (optional)
- * @param _float None (optional)
- * @param string None (optional)
- * @param binary None (optional)
- * @param date None (optional)
- * @param dateTime None (optional)
- * @param password None (optional)
- * @param paramCallback None (optional)
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
- testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
- }
-
- /**
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * @param number None (required)
- * @param _double None (required)
- * @param patternWithoutDelimiter None (required)
- * @param _byte None (required)
- * @param integer None (optional)
- * @param int32 None (optional)
- * @param int64 None (optional)
- * @param _float None (optional)
- * @param string None (optional)
- * @param binary None (optional)
- * @param date None (optional)
- * @param dateTime None (optional)
- * @param password None (optional)
- * @param paramCallback None (optional)
- * @return ApiResponse<Void>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
- com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null);
- return apiClient.execute(call);
- }
-
- /**
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously)
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * @param number None (required)
- * @param _double None (required)
- * @param patternWithoutDelimiter None (required)
- * @param _byte None (required)
- * @param integer None (optional)
- * @param int32 None (optional)
- * @param int64 None (optional)
- * @param _float None (optional)
- * @param string None (optional)
- * @param binary None (optional)
- * @param date None (optional)
- * @param dateTime None (optional)
- * @param password None (optional)
- * @param paramCallback None (optional)
- * @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 com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener);
- apiClient.executeAsync(call, callback);
- return call;
- }
- /* Build call for testEnumParameters */
- private com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
-
- // create path and map variables
- String localVarPath = "/fake".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
- if (enumQueryStringArray != null)
- localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray));
- if (enumQueryString != null)
- localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString));
- if (enumQueryInteger != null)
- localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger));
-
- Map localVarHeaderParams = new HashMap();
- if (enumHeaderStringArray != null)
- localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray));
- if (enumHeaderString != null)
- localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString));
-
- Map localVarFormParams = new HashMap();
- if (enumFormStringArray != null)
- localVarFormParams.put("enum_form_string_array", enumFormStringArray);
- if (enumFormString != null)
- localVarFormParams.put("enum_form_string", enumFormString);
- if (enumQueryDouble != null)
- localVarFormParams.put("enum_query_double", enumQueryDouble);
-
- final String[] localVarAccepts = {
- "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/json"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * To test enum parameters
- *
- * @param enumFormStringArray Form parameter enum test (string array) (optional)
- * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
- * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
- * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
- * @param enumQueryStringArray Query parameter enum test (string array) (optional)
- * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
- * @param enumQueryInteger Query parameter enum test (double) (optional)
- * @param enumQueryDouble Query parameter enum test (double) (optional)
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
- testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
- }
-
- /**
- * To test enum parameters
- *
- * @param enumFormStringArray Form parameter enum test (string array) (optional)
- * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
- * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
- * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
- * @param enumQueryStringArray Query parameter enum test (string array) (optional)
- * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
- * @param enumQueryInteger Query parameter enum test (double) (optional)
- * @param enumQueryDouble Query parameter enum test (double) (optional)
- * @return ApiResponse<Void>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
- com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null);
- return apiClient.execute(call);
- }
-
- /**
- * To test enum parameters (asynchronously)
- *
- * @param enumFormStringArray Form parameter enum test (string array) (optional)
- * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
- * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
- * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
- * @param enumQueryStringArray Query parameter enum test (string array) (optional)
- * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
- * @param enumQueryInteger Query parameter enum test (double) (optional)
- * @param enumQueryDouble Query parameter enum test (double) (optional)
- * @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 com.squareup.okhttp.Call testEnumParametersAsync(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
- apiClient.executeAsync(call, callback);
- return call;
- }
-}
+
+
+package io.swagger.client.api;
+
+import io.swagger.client.ApiCallback;
+import io.swagger.client.ApiClient;
+import io.swagger.client.ApiException;
+import io.swagger.client.ApiResponse;
+import io.swagger.client.Configuration;
+import io.swagger.client.Pair;
+import io.swagger.client.ProgressRequestBody;
+import io.swagger.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import java.math.BigDecimal;
+import io.swagger.client.model.Client;
+import org.threeten.bp.LocalDate;
+import org.threeten.bp.OffsetDateTime;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class FakeApi {
+ private ApiClient apiClient;
+
+ public FakeApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public FakeApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /* Build call for testClientModel */
+ private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ String localVarPath = "/fake".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * To test \"client\" model
+ * To test \"client\" model
+ * @param body client model (required)
+ * @return Client
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Client testClientModel(Client body) throws ApiException {
+ ApiResponse resp = testClientModelWithHttpInfo(body);
+ return resp.getData();
+ }
+
+ /**
+ * To test \"client\" model
+ * To test \"client\" model
+ * @param body client model (required)
+ * @return ApiResponse<Client>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException {
+ com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * To test \"client\" model (asynchronously)
+ * To test \"client\" model
+ * @param body client model (required)
+ * @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 com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /* Build call for testEndpointParameters */
+ private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/fake".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ if (integer != null)
+ localVarFormParams.put("integer", integer);
+ if (int32 != null)
+ localVarFormParams.put("int32", int32);
+ if (int64 != null)
+ localVarFormParams.put("int64", int64);
+ if (number != null)
+ localVarFormParams.put("number", number);
+ if (_float != null)
+ localVarFormParams.put("float", _float);
+ if (_double != null)
+ localVarFormParams.put("double", _double);
+ if (string != null)
+ localVarFormParams.put("string", string);
+ if (patternWithoutDelimiter != null)
+ localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter);
+ if (_byte != null)
+ localVarFormParams.put("byte", _byte);
+ if (binary != null)
+ localVarFormParams.put("binary", binary);
+ if (date != null)
+ localVarFormParams.put("date", date);
+ if (dateTime != null)
+ localVarFormParams.put("dateTime", dateTime);
+ if (password != null)
+ localVarFormParams.put("password", password);
+ if (paramCallback != null)
+ localVarFormParams.put("callback", paramCallback);
+
+ final String[] localVarAccepts = {
+ "application/xml; charset=utf-8", "application/json; charset=utf-8"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+ "application/xml; charset=utf-8", "application/json; charset=utf-8"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "http_basic_test" };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'number' is set
+ if (number == null) {
+ throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)");
+ }
+
+ // verify the required parameter '_double' is set
+ if (_double == null) {
+ throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)");
+ }
+
+ // verify the required parameter 'patternWithoutDelimiter' is set
+ if (patternWithoutDelimiter == null) {
+ throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)");
+ }
+
+ // verify the required parameter '_byte' is set
+ if (_byte == null) {
+ throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * @param number None (required)
+ * @param _double None (required)
+ * @param patternWithoutDelimiter None (required)
+ * @param _byte None (required)
+ * @param integer None (optional)
+ * @param int32 None (optional)
+ * @param int64 None (optional)
+ * @param _float None (optional)
+ * @param string None (optional)
+ * @param binary None (optional)
+ * @param date None (optional)
+ * @param dateTime None (optional)
+ * @param password None (optional)
+ * @param paramCallback None (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
+ testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
+ }
+
+ /**
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * @param number None (required)
+ * @param _double None (required)
+ * @param patternWithoutDelimiter None (required)
+ * @param _byte None (required)
+ * @param integer None (optional)
+ * @param int32 None (optional)
+ * @param int64 None (optional)
+ * @param _float None (optional)
+ * @param string None (optional)
+ * @param binary None (optional)
+ * @param date None (optional)
+ * @param dateTime None (optional)
+ * @param password None (optional)
+ * @param paramCallback None (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
+ com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously)
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * @param number None (required)
+ * @param _double None (required)
+ * @param patternWithoutDelimiter None (required)
+ * @param _byte None (required)
+ * @param integer None (optional)
+ * @param int32 None (optional)
+ * @param int64 None (optional)
+ * @param _float None (optional)
+ * @param string None (optional)
+ * @param binary None (optional)
+ * @param date None (optional)
+ * @param dateTime None (optional)
+ * @param password None (optional)
+ * @param paramCallback None (optional)
+ * @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 com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /* Build call for testEnumParameters */
+ private com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/fake".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+ if (enumQueryStringArray != null)
+ localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray));
+ if (enumQueryString != null)
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString));
+ if (enumQueryInteger != null)
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger));
+
+ Map localVarHeaderParams = new HashMap();
+ if (enumHeaderStringArray != null)
+ localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray));
+ if (enumHeaderString != null)
+ localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString));
+
+ Map localVarFormParams = new HashMap();
+ if (enumFormStringArray != null)
+ localVarFormParams.put("enum_form_string_array", enumFormStringArray);
+ if (enumFormString != null)
+ localVarFormParams.put("enum_form_string", enumFormString);
+ if (enumQueryDouble != null)
+ localVarFormParams.put("enum_query_double", enumQueryDouble);
+
+ final String[] localVarAccepts = {
+ "*/*"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+ "*/*"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+
+ com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * To test enum parameters
+ * To test enum parameters
+ * @param enumFormStringArray Form parameter enum test (string array) (optional)
+ * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
+ * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
+ * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryStringArray Query parameter enum test (string array) (optional)
+ * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryInteger Query parameter enum test (double) (optional)
+ * @param enumQueryDouble Query parameter enum test (double) (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException {
+ testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
+ }
+
+ /**
+ * To test enum parameters
+ * To test enum parameters
+ * @param enumFormStringArray Form parameter enum test (string array) (optional)
+ * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
+ * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
+ * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryStringArray Query parameter enum test (string array) (optional)
+ * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryInteger Query parameter enum test (double) (optional)
+ * @param enumQueryDouble Query parameter enum test (double) (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException {
+ com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * To test enum parameters (asynchronously)
+ * To test enum parameters
+ * @param enumFormStringArray Form parameter enum test (string array) (optional)
+ * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
+ * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
+ * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryStringArray Query parameter enum test (string array) (optional)
+ * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryInteger Query parameter enum test (double) (optional)
+ * @param enumQueryDouble Query parameter enum test (double) (optional)
+ * @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 com.squareup.okhttp.Call testEnumParametersAsync(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeclassnametagsApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeclassnametagsApi.java
deleted file mode 100644
index fbe101df53..0000000000
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeclassnametagsApi.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Swagger Petstore
- * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
- *
- * OpenAPI spec version: 1.0.0
- * Contact: apiteam@swagger.io
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git
- * Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package io.swagger.client.api;
-
-import io.swagger.client.ApiCallback;
-import io.swagger.client.ApiClient;
-import io.swagger.client.ApiException;
-import io.swagger.client.ApiResponse;
-import io.swagger.client.Configuration;
-import io.swagger.client.Pair;
-import io.swagger.client.ProgressRequestBody;
-import io.swagger.client.ProgressResponseBody;
-
-import com.google.gson.reflect.TypeToken;
-
-import java.io.IOException;
-
-import io.swagger.client.model.Client;
-
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class FakeclassnametagsApi {
- private ApiClient apiClient;
-
- public FakeclassnametagsApi() {
- this(Configuration.getDefaultApiClient());
- }
-
- public FakeclassnametagsApi(ApiClient apiClient) {
- this.apiClient = apiClient;
- }
-
- public ApiClient getApiClient() {
- return apiClient;
- }
-
- public void setApiClient(ApiClient apiClient) {
- this.apiClient = apiClient;
- }
-
- /* Build call for testClassname */
- private com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = body;
-
- // verify the required parameter 'body' is set
- if (body == null) {
- throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/json"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { };
- return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * To test class name in snake case
- *
- * @param body client model (required)
- * @return Client
- * @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 resp = testClassnameWithHttpInfo(body);
- return resp.getData();
- }
-
- /**
- * To test class name in snake case
- *
- * @param body client model (required)
- * @return ApiResponse<Client>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException {
- com.squareup.okhttp.Call call = testClassnameCall(body, null, null);
- Type localVarReturnType = new TypeToken(){}.getType();
- return apiClient.execute(call, localVarReturnType);
- }
-
- /**
- * To test class name in snake case (asynchronously)
- *
- * @param body client model (required)
- * @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 com.squareup.okhttp.Call testClassnameAsync(Client body, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = testClassnameCall(body, progressListener, progressRequestListener);
- Type localVarReturnType = new TypeToken(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
- }
-}
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java
index 6c45954070..d86cc92060 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java
@@ -8,928 +8,1013 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
*/
-
-
-package io.swagger.client.api;
-
-import io.swagger.client.ApiCallback;
-import io.swagger.client.ApiClient;
-import io.swagger.client.ApiException;
-import io.swagger.client.ApiResponse;
-import io.swagger.client.Configuration;
-import io.swagger.client.Pair;
-import io.swagger.client.ProgressRequestBody;
-import io.swagger.client.ProgressResponseBody;
-
-import com.google.gson.reflect.TypeToken;
-
-import java.io.IOException;
-
-import io.swagger.client.model.Pet;
-import io.swagger.client.model.ModelApiResponse;
-import java.io.File;
-
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class PetApi {
- private ApiClient apiClient;
-
- public PetApi() {
- this(Configuration.getDefaultApiClient());
- }
-
- public PetApi(ApiClient apiClient) {
- this.apiClient = apiClient;
- }
-
- public ApiClient getApiClient() {
- return apiClient;
- }
-
- public void setApiClient(ApiClient apiClient) {
- this.apiClient = apiClient;
- }
-
- /* Build call for addPet */
- private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = body;
-
- // verify the required parameter 'body' is set
- if (body == null) {
- throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/json", "application/xml"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Add a new pet to the store
- *
- * @param body Pet object that needs to be added to the store (required)
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public void addPet(Pet body) throws ApiException {
- addPetWithHttpInfo(body);
- }
-
- /**
- * Add a new pet to the store
- *
- * @param body Pet object that needs to be added to the store (required)
- * @return ApiResponse<Void>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException {
- com.squareup.okhttp.Call call = addPetCall(body, null, null);
- return apiClient.execute(call);
- }
-
- /**
- * Add a new pet to the store (asynchronously)
- *
- * @param body Pet object that needs to be added to the store (required)
- * @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 com.squareup.okhttp.Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener);
- apiClient.executeAsync(call, callback);
- return call;
- }
- /* Build call for deletePet */
- private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'petId' is set
- if (petId == null) {
- throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
- .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
- if (apiKey != null)
- localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
-
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Deletes a pet
- *
- * @param petId Pet id to delete (required)
- * @param apiKey (optional)
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public void deletePet(Long petId, String apiKey) throws ApiException {
- deletePetWithHttpInfo(petId, apiKey);
- }
-
- /**
- * Deletes a pet
- *
- * @param petId Pet id to delete (required)
- * @param apiKey (optional)
- * @return ApiResponse<Void>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
- com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, null, null);
- return apiClient.execute(call);
- }
-
- /**
- * Deletes a pet (asynchronously)
- *
- * @param petId Pet id to delete (required)
- * @param apiKey (optional)
- * @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 com.squareup.okhttp.Call deletePetAsync(Long petId, String apiKey, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, progressListener, progressRequestListener);
- apiClient.executeAsync(call, callback);
- return call;
- }
- /* Build call for findPetsByStatus */
- private com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'status' is set
- if (status == null) {
- throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
- if (status != null)
- localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status));
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
-
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * @param status Status values that need to be considered for filter (required)
- * @return List<Pet>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public List findPetsByStatus(List status) throws ApiException {
- ApiResponse> resp = findPetsByStatusWithHttpInfo(status);
- return resp.getData();
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * @param status Status values that need to be considered for filter (required)
- * @return ApiResponse<List<Pet>>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException {
- com.squareup.okhttp.Call call = findPetsByStatusCall(status, null, null);
- Type localVarReturnType = new TypeToken>(){}.getType();
- return apiClient.execute(call, localVarReturnType);
- }
-
- /**
- * Finds Pets by status (asynchronously)
- * Multiple status values can be provided with comma separated strings
- * @param status Status values that need to be considered for filter (required)
- * @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 com.squareup.okhttp.Call findPetsByStatusAsync(List status, final ApiCallback> callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
- Type localVarReturnType = new TypeToken>(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
- }
- /* Build call for findPetsByTags */
- private com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'tags' is set
- if (tags == null) {
- throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
- if (tags != null)
- localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags));
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
-
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * @param tags Tags to filter by (required)
- * @return List<Pet>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public List findPetsByTags(List tags) throws ApiException {
- ApiResponse> resp = findPetsByTagsWithHttpInfo(tags);
- return resp.getData();
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * @param tags Tags to filter by (required)
- * @return ApiResponse<List<Pet>>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException {
- com.squareup.okhttp.Call call = findPetsByTagsCall(tags, null, null);
- Type localVarReturnType = new TypeToken>(){}.getType();
- return apiClient.execute(call, localVarReturnType);
- }
-
- /**
- * Finds Pets by tags (asynchronously)
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * @param tags Tags to filter by (required)
- * @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 com.squareup.okhttp.Call findPetsByTagsAsync(List tags, final ApiCallback> callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
- Type localVarReturnType = new TypeToken>(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
- }
- /* Build call for getPetById */
- private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'petId' is set
- if (petId == null) {
- throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
- .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
-
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "api_key" };
- return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * @param petId ID of pet to return (required)
- * @return Pet
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public Pet getPetById(Long petId) throws ApiException {
- ApiResponse resp = getPetByIdWithHttpInfo(petId);
- return resp.getData();
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * @param petId ID of pet to return (required)
- * @return ApiResponse<Pet>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException {
- com.squareup.okhttp.Call call = getPetByIdCall(petId, null, null);
- Type localVarReturnType = new TypeToken(){}.getType();
- return apiClient.execute(call, localVarReturnType);
- }
-
- /**
- * Find pet by ID (asynchronously)
- * Returns a single pet
- * @param petId ID of pet to return (required)
- * @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 com.squareup.okhttp.Call getPetByIdAsync(Long petId, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
- Type localVarReturnType = new TypeToken(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
- }
- /* Build call for updatePet */
- private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = body;
-
- // verify the required parameter 'body' is set
- if (body == null) {
- throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet".replaceAll("\\{format\\}","json");
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/json", "application/xml"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Update an existing pet
- *
- * @param body Pet object that needs to be added to the store (required)
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public void updatePet(Pet body) throws ApiException {
- updatePetWithHttpInfo(body);
- }
-
- /**
- * Update an existing pet
- *
- * @param body Pet object that needs to be added to the store (required)
- * @return ApiResponse<Void>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException {
- com.squareup.okhttp.Call call = updatePetCall(body, null, null);
- return apiClient.execute(call);
- }
-
- /**
- * Update an existing pet (asynchronously)
- *
- * @param body Pet object that needs to be added to the store (required)
- * @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 com.squareup.okhttp.Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener);
- apiClient.executeAsync(call, callback);
- return call;
- }
- /* Build call for updatePetWithForm */
- private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'petId' is set
- if (petId == null) {
- throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
- .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
- if (name != null)
- localVarFormParams.put("name", name);
- if (status != null)
- localVarFormParams.put("status", status);
-
- final String[] localVarAccepts = {
- "application/xml", "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "application/x-www-form-urlencoded"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * Updates a pet in the store with form data
- *
- * @param petId ID of pet that needs to be updated (required)
- * @param name Updated name of the pet (optional)
- * @param status Updated status of the pet (optional)
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public void updatePetWithForm(Long petId, String name, String status) throws ApiException {
- updatePetWithFormWithHttpInfo(petId, name, status);
- }
-
- /**
- * Updates a pet in the store with form data
- *
- * @param petId ID of pet that needs to be updated (required)
- * @param name Updated name of the pet (optional)
- * @param status Updated status of the pet (optional)
- * @return ApiResponse<Void>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {
- com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, null, null);
- return apiClient.execute(call);
- }
-
- /**
- * Updates a pet in the store with form data (asynchronously)
- *
- * @param petId ID of pet that needs to be updated (required)
- * @param name Updated name of the pet (optional)
- * @param status Updated status of the pet (optional)
- * @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 com.squareup.okhttp.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, progressListener, progressRequestListener);
- apiClient.executeAsync(call, callback);
- return call;
- }
- /* Build call for uploadFile */
- private com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
- Object localVarPostBody = null;
-
- // verify the required parameter 'petId' is set
- if (petId == null) {
- throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)");
- }
-
-
- // create path and map variables
- String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
- .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
-
- List localVarQueryParams = new ArrayList();
-
- Map localVarHeaderParams = new HashMap();
-
- Map localVarFormParams = new HashMap();
- if (additionalMetadata != null)
- localVarFormParams.put("additionalMetadata", additionalMetadata);
- if (file != null)
- localVarFormParams.put("file", file);
-
- final String[] localVarAccepts = {
- "application/json"
- };
- final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
- if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
-
- final String[] localVarContentTypes = {
- "multipart/form-data"
- };
- final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
-
- if(progressListener != null) {
- apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
- return originalResponse.newBuilder()
- .body(new ProgressResponseBody(originalResponse.body(), progressListener))
- .build();
- }
- });
- }
-
- String[] localVarAuthNames = new String[] { "petstore_auth" };
- return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
- }
-
- /**
- * uploads an image
- *
- * @param petId ID of pet to update (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @param file file to upload (optional)
- * @return ModelApiResponse
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
- ApiResponse resp = uploadFileWithHttpInfo(petId, additionalMetadata, file);
- return resp.getData();
- }
-
- /**
- * uploads an image
- *
- * @param petId ID of pet to update (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @param file file to upload (optional)
- * @return ApiResponse<ModelApiResponse>
- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
- */
- public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
- com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, null, null);
- Type localVarReturnType = new TypeToken(){}.getType();
- return apiClient.execute(call, localVarReturnType);
- }
-
- /**
- * uploads an image (asynchronously)
- *
- * @param petId ID of pet to update (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @param file file to upload (optional)
- * @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 com.squareup.okhttp.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback callback) throws ApiException {
-
- ProgressResponseBody.ProgressListener progressListener = null;
- ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
-
- if (callback != null) {
- progressListener = new ProgressResponseBody.ProgressListener() {
- @Override
- public void update(long bytesRead, long contentLength, boolean done) {
- callback.onDownloadProgress(bytesRead, contentLength, done);
- }
- };
-
- progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
- @Override
- public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
- callback.onUploadProgress(bytesWritten, contentLength, done);
- }
- };
- }
-
- com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, progressListener, progressRequestListener);
- Type localVarReturnType = new TypeToken(){}.getType();
- apiClient.executeAsync(call, localVarReturnType, callback);
- return call;
- }
-}
+
+
+package io.swagger.client.api;
+
+import io.swagger.client.ApiCallback;
+import io.swagger.client.ApiClient;
+import io.swagger.client.ApiException;
+import io.swagger.client.ApiResponse;
+import io.swagger.client.Configuration;
+import io.swagger.client.Pair;
+import io.swagger.client.ProgressRequestBody;
+import io.swagger.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import java.io.File;
+import io.swagger.client.model.ModelApiResponse;
+import io.swagger.client.model.Pet;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PetApi {
+ private ApiClient apiClient;
+
+ public PetApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public PetApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /* Build call for addPet */
+ private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ String localVarPath = "/pet".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+ "application/json", "application/xml"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void addPet(Pet body) throws ApiException {
+ addPetWithHttpInfo(body);
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException {
+ com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Add a new pet to the store (asynchronously)
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @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 com.squareup.okhttp.Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /* Build call for deletePet */
+ private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+ if (apiKey != null)
+ localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Deletes a pet
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deletePet(Long petId, String apiKey) throws ApiException {
+ deletePetWithHttpInfo(petId, apiKey);
+ }
+
+ /**
+ * Deletes a pet
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
+ com.squareup.okhttp.Call call = deletePetValidateBeforeCall(petId, apiKey, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Deletes a pet (asynchronously)
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @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 com.squareup.okhttp.Call deletePetAsync(Long petId, String apiKey, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = deletePetValidateBeforeCall(petId, apiKey, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /* Build call for findPetsByStatus */
+ private com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+ if (status != null)
+ localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call findPetsByStatusValidateBeforeCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * @param status Status values that need to be considered for filter (required)
+ * @return List<Pet>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List findPetsByStatus(List status) throws ApiException {
+ ApiResponse> resp = findPetsByStatusWithHttpInfo(status);
+ return resp.getData();
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * @param status Status values that need to be considered for filter (required)
+ * @return ApiResponse<List<Pet>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException {
+ com.squareup.okhttp.Call call = findPetsByStatusValidateBeforeCall(status, null, null);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Finds Pets by status (asynchronously)
+ * Multiple status values can be provided with comma separated strings
+ * @param status Status values that need to be considered for filter (required)
+ * @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 com.squareup.okhttp.Call findPetsByStatusAsync(List status, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = findPetsByStatusValidateBeforeCall(status, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /* Build call for findPetsByTags */
+ private com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+ if (tags != null)
+ localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call findPetsByTagsValidateBeforeCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * @param tags Tags to filter by (required)
+ * @return List<Pet>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public List findPetsByTags(List tags) throws ApiException {
+ ApiResponse> resp = findPetsByTagsWithHttpInfo(tags);
+ return resp.getData();
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * @param tags Tags to filter by (required)
+ * @return ApiResponse<List<Pet>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException {
+ com.squareup.okhttp.Call call = findPetsByTagsValidateBeforeCall(tags, null, null);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Finds Pets by tags (asynchronously)
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * @param tags Tags to filter by (required)
+ * @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 com.squareup.okhttp.Call findPetsByTagsAsync(List tags, final ApiCallback> callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = findPetsByTagsValidateBeforeCall(tags, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /* Build call for getPetById */
+ private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * @param petId ID of pet to return (required)
+ * @return Pet
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Pet getPetById(Long petId) throws ApiException {
+ ApiResponse resp = getPetByIdWithHttpInfo(petId);
+ return resp.getData();
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * @param petId ID of pet to return (required)
+ * @return ApiResponse<Pet>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException {
+ com.squareup.okhttp.Call call = getPetByIdValidateBeforeCall(petId, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Find pet by ID (asynchronously)
+ * Returns a single pet
+ * @param petId ID of pet to return (required)
+ * @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 com.squareup.okhttp.Call getPetByIdAsync(Long petId, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = getPetByIdValidateBeforeCall(petId, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /* Build call for updatePet */
+ private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ String localVarPath = "/pet".replaceAll("\\{format\\}","json");
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+ "application/json", "application/xml"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+ return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Update an existing pet
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void updatePet(Pet body) throws ApiException {
+ updatePetWithHttpInfo(body);
+ }
+
+ /**
+ * Update an existing pet
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException {
+ com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Update an existing pet (asynchronously)
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @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 com.squareup.okhttp.Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException {
+
+ ProgressResponseBody.ProgressListener progressListener = null;
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
+
+ if (callback != null) {
+ progressListener = new ProgressResponseBody.ProgressListener() {
+ @Override
+ public void update(long bytesRead, long contentLength, boolean done) {
+ callback.onDownloadProgress(bytesRead, contentLength, done);
+ }
+ };
+
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
+ @Override
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
+ callback.onUploadProgress(bytesWritten, contentLength, done);
+ }
+ };
+ }
+
+ com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /* Build call for updatePetWithForm */
+ private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ if (name != null)
+ localVarFormParams.put("name", name);
+ if (status != null)
+ localVarFormParams.put("status", status);
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
+
+ final String[] localVarContentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ if(progressListener != null) {
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.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());
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+ .build();
+ }
+ });
+ }
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, progressListener, progressRequestListener);
+ return call;
+
+
+
+
+
+ }
+
+ /**
+ * Updates a pet in the store with form data
+ *
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void updatePetWithForm(Long petId, String name, String status) throws ApiException {
+ updatePetWithFormWithHttpInfo(petId, name, status);
+ }
+
+ /**
+ * Updates a pet in the store with form data
+ *
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse