From f54b5057044608742a97838e308a1d3a46e930d2 Mon Sep 17 00:00:00 2001 From: cbornet Date: Wed, 29 Jun 2016 16:02:50 +0200 Subject: [PATCH] use okttp builder instead of instance in retrofit2 Fix #3188 --- .../libraries/retrofit2/ApiClient.mustache | 30 ++- .../Java/libraries/retrofit2/README.mustache | 4 - .../Java/libraries/retrofit2/pom.mustache | 9 +- .../petstore/java/retrofit2/.travis.yml | 29 ++ .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../java/retrofit2/docs/ArrayOfNumberOnly.md | 10 + .../petstore/java/retrofit2/docs/ArrayTest.md | 7 + .../petstore/java/retrofit2/docs/FakeApi.md | 92 +++++++ .../java/retrofit2/docs/HasOnlyReadOnly.md | 11 + .../petstore/java/retrofit2/docs/MapTest.md | 17 ++ .../java/retrofit2/docs/NumberOnly.md | 10 + .../client/petstore/java/retrofit2/gradlew | 0 .../client/petstore/java/retrofit2/pom.xml | 7 +- .../java/io/swagger/client/ApiClient.java | 30 ++- .../java/io/swagger/client/StringUtil.java | 2 +- .../java/io/swagger/client/api/FakeApi.java | 28 ++ .../io/swagger/client/auth/OAuthFlow.java | 2 +- .../model/AdditionalPropertiesClass.java | 71 +++-- .../java/io/swagger/client/model/Animal.java | 71 +++-- .../io/swagger/client/model/AnimalFarm.java | 41 ++- .../model/ArrayOfArrayOfNumberOnly.java | 102 ++++++++ .../client/model/ArrayOfNumberOnly.java | 102 ++++++++ .../io/swagger/client/model/ArrayTest.java | 133 ++++++++-- .../java/io/swagger/client/model/Cat.java | 90 +++++-- .../io/swagger/client/model/Category.java | 71 +++-- .../java/io/swagger/client/model/Dog.java | 90 +++++-- .../io/swagger/client/model/EnumClass.java | 77 +++--- .../io/swagger/client/model/EnumTest.java | 96 +++++-- .../io/swagger/client/model/FormatTest.java | 247 +++++++++++++----- .../swagger/client/model/HasOnlyReadOnly.java | 104 ++++++++ .../java/io/swagger/client/model/MapTest.java | 147 +++++++++++ ...ropertiesAndAdditionalPropertiesClass.java | 87 ++++-- .../client/model/Model200Response.java | 71 +++-- .../client/model/ModelApiResponse.java | 87 ++++-- .../io/swagger/client/model/ModelReturn.java | 55 +++- .../java/io/swagger/client/model/Name.java | 91 +++++-- .../io/swagger/client/model/NumberOnly.java | 100 +++++++ .../java/io/swagger/client/model/Order.java | 139 +++++++--- .../java/io/swagger/client/model/Pet.java | 139 +++++++--- .../swagger/client/model/ReadOnlyFirst.java | 65 +++-- .../client/model/SpecialModelName.java | 55 +++- .../java/io/swagger/client/model/Tag.java | 71 +++-- .../java/io/swagger/client/model/User.java | 166 +++++++++--- .../petstore/java/retrofit2rx/.travis.yml | 29 ++ .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../retrofit2rx/docs/ArrayOfNumberOnly.md | 10 + .../java/retrofit2rx/docs/ArrayTest.md | 7 + .../petstore/java/retrofit2rx/docs/FakeApi.md | 92 +++++++ .../java/retrofit2rx/docs/HasOnlyReadOnly.md | 11 + .../petstore/java/retrofit2rx/docs/MapTest.md | 17 ++ .../java/retrofit2rx/docs/NumberOnly.md | 10 + .../client/petstore/java/retrofit2rx/gradlew | 0 .../client/petstore/java/retrofit2rx/pom.xml | 9 +- .../java/io/swagger/client/ApiClient.java | 30 ++- .../java/io/swagger/client/StringUtil.java | 2 +- .../java/io/swagger/client/api/FakeApi.java | 28 ++ .../io/swagger/client/auth/OAuthFlow.java | 2 +- .../model/AdditionalPropertiesClass.java | 71 +++-- .../java/io/swagger/client/model/Animal.java | 71 +++-- .../io/swagger/client/model/AnimalFarm.java | 41 ++- .../model/ArrayOfArrayOfNumberOnly.java | 102 ++++++++ .../client/model/ArrayOfNumberOnly.java | 102 ++++++++ .../io/swagger/client/model/ArrayTest.java | 133 ++++++++-- .../java/io/swagger/client/model/Cat.java | 90 +++++-- .../io/swagger/client/model/Category.java | 71 +++-- .../java/io/swagger/client/model/Dog.java | 90 +++++-- .../io/swagger/client/model/EnumClass.java | 77 +++--- .../io/swagger/client/model/EnumTest.java | 96 +++++-- .../io/swagger/client/model/FormatTest.java | 247 +++++++++++++----- .../swagger/client/model/HasOnlyReadOnly.java | 104 ++++++++ .../java/io/swagger/client/model/MapTest.java | 147 +++++++++++ ...ropertiesAndAdditionalPropertiesClass.java | 87 ++++-- .../client/model/Model200Response.java | 71 +++-- .../client/model/ModelApiResponse.java | 87 ++++-- .../io/swagger/client/model/ModelReturn.java | 55 +++- .../java/io/swagger/client/model/Name.java | 91 +++++-- .../io/swagger/client/model/NumberOnly.java | 100 +++++++ .../java/io/swagger/client/model/Order.java | 139 +++++++--- .../java/io/swagger/client/model/Pet.java | 139 +++++++--- .../swagger/client/model/ReadOnlyFirst.java | 65 +++-- .../client/model/SpecialModelName.java | 55 +++- .../java/io/swagger/client/model/Tag.java | 71 +++-- .../java/io/swagger/client/model/User.java | 166 +++++++++--- 83 files changed, 4687 insertions(+), 1004 deletions(-) create mode 100644 samples/client/petstore/java/retrofit2/.travis.yml create mode 100644 samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/retrofit2/docs/MapTest.md create mode 100644 samples/client/petstore/java/retrofit2/docs/NumberOnly.md mode change 100755 => 100644 samples/client/petstore/java/retrofit2/gradlew create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java/retrofit2rx/.travis.yml create mode 100644 samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/retrofit2rx/docs/MapTest.md create mode 100644 samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md mode change 100755 => 100644 samples/client/petstore/java/retrofit2rx/gradlew create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index ef07b82153f..9afdc5488b5 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -48,7 +48,7 @@ import {{invokerPackage}}.auth.OAuthFlow; public class ApiClient { private Map apiAuthorizations; - private OkHttpClient okClient; + private OkHttpClient.Builder okBuilder; private Retrofit.Builder adapterBuilder; public ApiClient() { @@ -118,7 +118,7 @@ public class ApiClient { .setPassword(password); } - public void createDefaultAdapter() { + public void createDefaultAdapter() { Gson gson = new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") {{^java8}} @@ -130,7 +130,7 @@ public class ApiClient { .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) .create(); - okClient = new OkHttpClient(); + okBuilder = new OkHttpClient.Builder(); String baseUrl = "{{{basePath}}}"; if(!baseUrl.endsWith("/")) @@ -139,14 +139,16 @@ public class ApiClient { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) - .client(okClient) {{#useRxJava}}.addCallAdapterFactory(RxJavaCallAdapterFactory.create()){{/useRxJava}} .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(gson)); } public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); + return adapterBuilder + .client(okBuilder.build()) + .build() + .create(serviceClass); } @@ -272,7 +274,7 @@ public class ApiClient { throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); } apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); + okBuilder.addInterceptor(authorization); } public Map getApiAuthorizations() { @@ -291,24 +293,24 @@ public class ApiClient { this.adapterBuilder = adapterBuilder; } - public OkHttpClient getOkClient() { - return okClient; + public OkHttpClient.Builder getOkBuilder() { + return okBuilder; } - public void addAuthsToOkClient(OkHttpClient okClient) { + public void addAuthsToOkBuilder(OkHttpClient.Builder okBuilder) { for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); + okBuilder.addInterceptor(apiAuthorization); } } /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the Retrofit + * Clones the okBuilder given in parameter, adds the auth interceptors and uses it to configure the Retrofit * @param okClient */ public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.newBuilder().build(); - addAuthsToOkClient(clone); - adapterBuilder.client(clone); + this.okBuilder = okClient.newBuilder(); + addAuthsToOkBuilder(this.okBuilder); + } } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/README.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/README.mustache index 50e2cf3fbe9..9d744b8589e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/README.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/README.mustache @@ -32,10 +32,6 @@ After the client library is installed/deployed, you can use it in your Maven pro ``` -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. - ## Author {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index eee3aa05802..a3e28ff4595 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -155,16 +155,15 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.8 - 2.0.2 + 1.5.9 + 2.1.0 {{#useRxJava}} - 1.1.3 + 1.1.6 {{/useRxJava}} {{^java8}} - 2.9.3 + 2.9.4 {{/java8}} 1.0.1 - 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2/.travis.yml b/samples/client/petstore/java/retrofit2/.travis.yml new file mode 100644 index 00000000000..33e79472abd --- /dev/null +++ b/samples/client/petstore/java/retrofit2/.travis.yml @@ -0,0 +1,29 @@ +# +# 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 + - oraclejdk7 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + - mvn test + # uncomment below to test using gradle + # - gradle test + # uncomment below to test using sbt + # - sbt test diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..77292549927 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..e8cc4cd36dc --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2/docs/ArrayTest.md index 9feee16427f..2cd4b9d33f9 100644 --- a/samples/client/petstore/java/retrofit2/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2/docs/ArrayTest.md @@ -7,6 +7,13 @@ Name | Type | Description | Notes **arrayOfString** | **List<String>** | | [optional] **arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] **arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] +**arrayOfEnum** | [**List<ArrayOfEnumEnum>**](#List<ArrayOfEnumEnum>) | | [optional] + + + +## Enum: List<ArrayOfEnumEnum> +Name | Value +---- | ----- diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index e077fa5c821..0e646d63479 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -4,9 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** fake | To test code injection =end [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** fake | To test enum query parameters + +# **testCodeInjectEnd** +> Void testCodeInjectEnd(testCodeInjectEnd) + +To test code injection =end + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String testCodeInjectEnd = "testCodeInjectEnd_example"; // String | To test code injection =end +try { + Void result = apiInstance.testCodeInjectEnd(testCodeInjectEnd); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testCodeInjectEnd"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testCodeInjectEnd** | **String**| To test code injection =end | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, */ =end'));(phpinfo(' + - **Accept**: application/json, */ end + # **testEndpointParameters** > Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) @@ -74,3 +119,50 @@ No authorization required - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +# **testEnumQueryParameters** +> Void testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble) + +To test enum query parameters + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String enumQueryString = "-efg"; // String | Query parameter enum test (string) +BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double) +Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +try { + Void result = apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumQueryParameters"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..c1d0aac5672 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/MapTest.md b/samples/client/petstore/java/retrofit2/docs/MapTest.md new file mode 100644 index 00000000000..c671e97ffbc --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/MapTest.md @@ -0,0 +1,17 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + + + +## Enum: Map<String, InnerEnum> +Name | Value +---- | ----- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2/docs/NumberOnly.md new file mode 100644 index 00000000000..a3feac7fadc --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/gradlew b/samples/client/petstore/java/retrofit2/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index ef0fdc18d8a..3af9daa695e 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -141,11 +141,10 @@ 1.7 ${java.version} ${java.version} - 1.5.8 - 2.0.2 - 2.9.3 + 1.5.9 + 2.1.0 + 2.9.4 1.0.1 - 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java index 69e14b0b52d..ffb4c11be1d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java @@ -41,7 +41,7 @@ import io.swagger.client.auth.OAuthFlow; public class ApiClient { private Map apiAuthorizations; - private OkHttpClient okClient; + private OkHttpClient.Builder okBuilder; private Retrofit.Builder adapterBuilder; public ApiClient() { @@ -110,14 +110,14 @@ public class ApiClient { .setPassword(password); } - public void createDefaultAdapter() { + public void createDefaultAdapter() { Gson gson = new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) .create(); - okClient = new OkHttpClient(); + okBuilder = new OkHttpClient.Builder(); String baseUrl = "http://petstore.swagger.io/v2"; if(!baseUrl.endsWith("/")) @@ -126,14 +126,16 @@ public class ApiClient { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) - .client(okClient) .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(gson)); } public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); + return adapterBuilder + .client(okBuilder.build()) + .build() + .create(serviceClass); } @@ -259,7 +261,7 @@ public class ApiClient { throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); } apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); + okBuilder.addInterceptor(authorization); } public Map getApiAuthorizations() { @@ -278,24 +280,24 @@ public class ApiClient { this.adapterBuilder = adapterBuilder; } - public OkHttpClient getOkClient() { - return okClient; + public OkHttpClient.Builder getOkBuilder() { + return okBuilder; } - public void addAuthsToOkClient(OkHttpClient okClient) { + public void addAuthsToOkBuilder(OkHttpClient.Builder okBuilder) { for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); + okBuilder.addInterceptor(apiAuthorization); } } /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the Retrofit + * Clones the okBuilder given in parameter, adds the auth interceptors and uses it to configure the Retrofit * @param okClient */ public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.newBuilder().build(); - addAuthsToOkClient(clone); - adapterBuilder.client(clone); + this.okBuilder = okClient.newBuilder(); + addAuthsToOkBuilder(this.okBuilder); + } } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java index 03c6c81e434..fdcef6b1010 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ /** * 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: \" \\ + * 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 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index 91bd85c1b33..004ba1916a5 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -18,6 +18,19 @@ import java.util.List; import java.util.Map; public interface FakeApi { + /** + * To test code injection =end + * + * @param testCodeInjectEnd To test code injection =end (optional) + * @return Call + */ + + @FormUrlEncoded + @PUT("fake") + Call testCodeInjectEnd( + @Field("test code inject */ =end") String testCodeInjectEnd + ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -42,4 +55,19 @@ public interface FakeApi { @Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") LocalDate date, @Field("dateTime") DateTime dateTime, @Field("password") String password ); + /** + * To test enum query parameters + * + * @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 Call + */ + + @FormUrlEncoded + @GET("fake") + Call testEnumQueryParameters( + @Field("enum_query_string") String enumQueryString, @Query("enum_query_integer") BigDecimal enumQueryInteger, @Field("enum_query_double") Double enumQueryDouble + ); + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthFlow.java index ec1f942b0f2..50d5260cfd9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /** * 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: \" \\ + * 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 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 839b04aa6c5..1943e013fa1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -1,49 +1,89 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.google.gson.annotations.SerializedName; - - - +/** + * AdditionalPropertiesClass + */ public class AdditionalPropertiesClass { - @SerializedName("map_property") private Map mapProperty = new HashMap(); @SerializedName("map_of_map_property") private Map> mapOfMapProperty = new HashMap>(); - /** - **/ - @ApiModelProperty(value = "") + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @ApiModelProperty(example = "null", value = "") public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - /** - **/ - @ApiModelProperty(value = "") + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @ApiModelProperty(example = "null", value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -51,8 +91,8 @@ public class AdditionalPropertiesClass { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override @@ -75,10 +115,11 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java index 9a14a1289fe..ba3806dc875 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java @@ -1,46 +1,86 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * Animal + */ public class Animal { - @SerializedName("className") private String className = null; @SerializedName("color") private String color = "red"; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } - /** - **/ - @ApiModelProperty(value = "") + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(example = "null", value = "") public String getColor() { return color; } + public void setColor(String color) { this.color = color; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -48,8 +88,8 @@ public class Animal { return false; } Animal animal = (Animal) o; - return Objects.equals(className, animal.className) && - Objects.equals(color, animal.color); + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); } @Override @@ -72,10 +112,11 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java index c7d37b1512c..b54adb09d7b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -1,3 +1,28 @@ +/** + * 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.model; import java.util.Objects; @@ -5,30 +30,27 @@ import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; -import com.google.gson.annotations.SerializedName; - - - +/** + * AnimalFarm + */ public class AnimalFarm extends ArrayList { - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - AnimalFarm animalFarm = (AnimalFarm) o; return true; } @Override public int hashCode() { - return Objects.hash(); + return Objects.hash(super.hashCode()); } @Override @@ -44,10 +66,11 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..5446c2c439b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,102 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +/** + * ArrayOfArrayOfNumberOnly + */ + +public class ArrayOfArrayOfNumberOnly { + @SerializedName("ArrayArrayNumber") + private List> arrayArrayNumber = new ArrayList>(); + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @ApiModelProperty(example = "null", value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..c9257a5d3ee --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,102 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +/** + * ArrayOfNumberOnly + */ + +public class ArrayOfNumberOnly { + @SerializedName("ArrayNumber") + private List arrayNumber = new ArrayList(); + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @ApiModelProperty(example = "null", value = "") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java index 92337cc0246..b853a0b035a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -1,19 +1,44 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; -import com.google.gson.annotations.SerializedName; - - - +/** + * ArrayTest + */ public class ArrayTest { - @SerializedName("array_of_string") private List arrayOfString = new ArrayList(); @@ -24,38 +49,105 @@ public class ArrayTest { private List> arrayArrayOfModel = new ArrayList>(); /** - **/ - @ApiModelProperty(value = "") + * Gets or Sets arrayOfEnum + */ + public enum ArrayOfEnumEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + ArrayOfEnumEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("array_of_enum") + private List arrayOfEnum = new ArrayList(); + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @ApiModelProperty(example = "null", value = "") public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - /** - **/ - @ApiModelProperty(value = "") + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @ApiModelProperty(example = "null", value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - /** - **/ - @ApiModelProperty(value = "") + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @ApiModelProperty(example = "null", value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest arrayOfEnum(List arrayOfEnum) { + this.arrayOfEnum = arrayOfEnum; + return this; + } + + /** + * Get arrayOfEnum + * @return arrayOfEnum + **/ + @ApiModelProperty(example = "null", value = "") + public List getArrayOfEnum() { + return arrayOfEnum; + } + + public void setArrayOfEnum(List arrayOfEnum) { + this.arrayOfEnum = arrayOfEnum; + } + @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -63,14 +155,15 @@ public class ArrayTest { return false; } ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(arrayOfString, arrayTest.arrayOfString) && - Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel) && + Objects.equals(this.arrayOfEnum, arrayTest.arrayOfEnum); } @Override public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel, arrayOfEnum); } @Override @@ -81,6 +174,7 @@ public class ArrayTest { sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append(" arrayOfEnum: ").append(toIndentedString(arrayOfEnum)).append("\n"); sb.append("}"); return sb.toString(); } @@ -89,10 +183,11 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java index 287d6a4d94c..21ed0f4c26b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java @@ -1,18 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; -import com.google.gson.annotations.SerializedName; - - - +/** + * Cat + */ public class Cat extends Animal { - @SerializedName("className") private String className = null; @@ -22,39 +46,63 @@ public class Cat extends Animal { @SerializedName("declawed") private Boolean declawed = null; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Cat className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } - /** - **/ - @ApiModelProperty(value = "") + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(example = "null", value = "") public String getColor() { return color; } + public void setColor(String color) { this.color = color; } - /** - **/ - @ApiModelProperty(value = "") + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @ApiModelProperty(example = "null", value = "") public Boolean getDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -62,14 +110,15 @@ public class Cat extends Animal { return false; } Cat cat = (Cat) o; - return Objects.equals(className, cat.className) && - Objects.equals(color, cat.color) && - Objects.equals(declawed, cat.declawed); + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(className, color, declawed); + return Objects.hash(className, color, declawed, super.hashCode()); } @Override @@ -88,10 +137,11 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java index 93ec7bd0877..2178a866f62 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java @@ -1,46 +1,86 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * Category + */ public class Category { - @SerializedName("id") private Long id = null; @SerializedName("name") private String name = null; - /** - **/ - @ApiModelProperty(value = "") + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", value = "") public String getName() { return name; } + public void setName(String name) { this.name = name; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -48,8 +88,8 @@ public class Category { return false; } Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); } @Override @@ -72,10 +112,11 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java index 5d2ead15f07..4ba5804553f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java @@ -1,18 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; -import com.google.gson.annotations.SerializedName; - - - +/** + * Dog + */ public class Dog extends Animal { - @SerializedName("className") private String className = null; @@ -22,39 +46,63 @@ public class Dog extends Animal { @SerializedName("breed") private String breed = null; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Dog className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } - /** - **/ - @ApiModelProperty(value = "") + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(example = "null", value = "") public String getColor() { return color; } + public void setColor(String color) { this.color = color; } - /** - **/ - @ApiModelProperty(value = "") + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @ApiModelProperty(example = "null", value = "") public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -62,14 +110,15 @@ public class Dog extends Animal { return false; } Dog dog = (Dog) o; - return Objects.equals(className, dog.className) && - Objects.equals(color, dog.color) && - Objects.equals(breed, dog.breed); + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(className, color, breed); + return Objects.hash(className, color, breed, super.hashCode()); } @Override @@ -88,10 +137,11 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java index 8f9357fbd32..73484907229 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java @@ -1,50 +1,57 @@ +/** + * 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.model; import java.util.Objects; - import com.google.gson.annotations.SerializedName; - - - -public class EnumClass { +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + @SerializedName("_abc") + _ABC("_abc"), + + @SerializedName("-efg") + _EFG("-efg"), + + @SerializedName("(xyz)") + _XYZ_("(xyz)"); - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumClass enumClass = (EnumClass) o; - return true; - } + private String value; - @Override - public int hashCode() { - return Objects.hash(); + EnumClass(String value) { + this.value = value; } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumClass {\n"); - - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return String.valueOf(value); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java index 8db392afccc..9aad1223215 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java @@ -1,25 +1,48 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * EnumTest + */ public class EnumTest { - - /** * Gets or Sets enumString */ public enum EnumStringEnum { @SerializedName("UPPER") UPPER("UPPER"), - + @SerializedName("lower") LOWER("lower"); @@ -38,14 +61,13 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; - /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { @SerializedName("1") NUMBER_1(1), - + @SerializedName("-1") NUMBER_MINUS_1(-1); @@ -64,14 +86,13 @@ public class EnumTest { @SerializedName("enum_integer") private EnumIntegerEnum enumInteger = null; - /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { @SerializedName("1.1") NUMBER_1_DOT_1(1.1), - + @SerializedName("-1.2") NUMBER_MINUS_1_DOT_2(-1.2); @@ -90,39 +111,63 @@ public class EnumTest { @SerializedName("enum_number") private EnumNumberEnum enumNumber = null; - /** - **/ - @ApiModelProperty(value = "") + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @ApiModelProperty(example = "null", value = "") public EnumStringEnum getEnumString() { return enumString; } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - /** - **/ - @ApiModelProperty(value = "") + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @ApiModelProperty(example = "null", value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - /** - **/ - @ApiModelProperty(value = "") + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @ApiModelProperty(example = "null", value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -130,9 +175,9 @@ public class EnumTest { return false; } EnumTest enumTest = (EnumTest) o; - return Objects.equals(enumString, enumTest.enumString) && - Objects.equals(enumInteger, enumTest.enumInteger) && - Objects.equals(enumNumber, enumTest.enumNumber); + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber); } @Override @@ -156,10 +201,11 @@ public class EnumTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java index 6063cf33f77..91109681509 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java @@ -1,20 +1,44 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.joda.time.DateTime; import org.joda.time.LocalDate; -import com.google.gson.annotations.SerializedName; - - - +/** + * FormatTest + */ public class FormatTest { - @SerializedName("integer") private Integer integer = null; @@ -54,149 +78,253 @@ public class FormatTest { @SerializedName("password") private String password = null; - /** + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer * minimum: 10.0 * maximum: 100.0 - **/ - @ApiModelProperty(value = "") + * @return integer + **/ + @ApiModelProperty(example = "null", value = "") public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } - /** + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 * minimum: 20.0 * maximum: 200.0 - **/ - @ApiModelProperty(value = "") + * @return int32 + **/ + @ApiModelProperty(example = "null", value = "") public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @ApiModelProperty(example = "null", value = "") public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } - /** + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number * minimum: 32.1 * maximum: 543.2 - **/ - @ApiModelProperty(required = true, value = "") + * @return number + **/ + @ApiModelProperty(example = "null", required = true, value = "") public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } - /** + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float * minimum: 54.3 * maximum: 987.6 - **/ - @ApiModelProperty(value = "") + * @return _float + **/ + @ApiModelProperty(example = "null", value = "") public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } - /** + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double * minimum: 67.8 * maximum: 123.4 - **/ - @ApiModelProperty(value = "") + * @return _double + **/ + @ApiModelProperty(example = "null", value = "") public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @ApiModelProperty(example = "null", value = "") public String getString() { return string; } + public void setString(String string) { this.string = string; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @ApiModelProperty(example = "null", required = true, value = "") public byte[] getByte() { return _byte; } + public void setByte(byte[] _byte) { this._byte = _byte; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @ApiModelProperty(example = "null", value = "") public byte[] getBinary() { return binary; } + public void setBinary(byte[] binary) { this.binary = binary; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @ApiModelProperty(example = "null", required = true, value = "") public LocalDate getDate() { return date; } + public void setDate(LocalDate date) { this.date = date; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(example = "null", value = "") public DateTime getDateTime() { return dateTime; } + public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(example = "null", value = "") public String getUuid() { return uuid; } + public void setUuid(String uuid) { this.uuid = uuid; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -204,19 +332,19 @@ public class FormatTest { return false; } FormatTest formatTest = (FormatTest) o; - return Objects.equals(integer, formatTest.integer) && - Objects.equals(int32, formatTest.int32) && - Objects.equals(int64, formatTest.int64) && - Objects.equals(number, formatTest.number) && - Objects.equals(_float, formatTest._float) && - Objects.equals(_double, formatTest._double) && - Objects.equals(string, formatTest.string) && - Objects.equals(_byte, formatTest._byte) && - Objects.equals(binary, formatTest.binary) && - Objects.equals(date, formatTest.date) && - Objects.equals(dateTime, formatTest.dateTime) && - Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Objects.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password); } @Override @@ -250,10 +378,11 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..d77fc7ac36b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -0,0 +1,104 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +/** + * HasOnlyReadOnly + */ + +public class HasOnlyReadOnly { + @SerializedName("bar") + private String bar = null; + + @SerializedName("foo") + private String foo = null; + + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(example = "null", value = "") + public String getBar() { + return bar; + } + + /** + * Get foo + * @return foo + **/ + @ApiModelProperty(example = "null", value = "") + public String getFoo() { + return foo; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java new file mode 100644 index 00000000000..61bdb6b2c65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java @@ -0,0 +1,147 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * MapTest + */ + +public class MapTest { + @SerializedName("map_map_of_string") + private Map> mapMapOfString = new HashMap>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("map_of_enum_string") + private Map mapOfEnumString = new HashMap(); + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @ApiModelProperty(example = "null", value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @ApiModelProperty(example = "null", value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index cf7f73c705f..6e587b1bf97 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,6 +1,32 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; @@ -9,14 +35,12 @@ import java.util.List; import java.util.Map; import org.joda.time.DateTime; -import com.google.gson.annotations.SerializedName; - - - +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ public class MixedPropertiesAndAdditionalPropertiesClass { - @SerializedName("uuid") private String uuid = null; @@ -26,39 +50,63 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("map") private Map map = new HashMap(); - /** - **/ - @ApiModelProperty(value = "") + public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(example = "null", value = "") public String getUuid() { return uuid; } + public void setUuid(String uuid) { this.uuid = uuid; } - /** - **/ - @ApiModelProperty(value = "") + public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(example = "null", value = "") public DateTime getDateTime() { return dateTime; } + public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } - /** - **/ - @ApiModelProperty(value = "") + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + /** + * Get map + * @return map + **/ + @ApiModelProperty(example = "null", value = "") public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -66,9 +114,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return false; } MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override @@ -92,10 +140,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java index 22d2bbd763d..d8da58aca9c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java @@ -1,49 +1,87 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - /** * Model for testing model name starting with number - **/ + */ @ApiModel(description = "Model for testing model name starting with number") + public class Model200Response { - @SerializedName("name") private Integer name = null; @SerializedName("class") private String PropertyClass = null; - /** - **/ - @ApiModelProperty(value = "") + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", value = "") public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } - /** - **/ - @ApiModelProperty(value = "") + public Model200Response PropertyClass(String PropertyClass) { + this.PropertyClass = PropertyClass; + return this; + } + + /** + * Get PropertyClass + * @return PropertyClass + **/ + @ApiModelProperty(example = "null", value = "") public String getPropertyClass() { return PropertyClass; } + public void setPropertyClass(String PropertyClass) { this.PropertyClass = PropertyClass; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -51,8 +89,8 @@ public class Model200Response { return false; } Model200Response _200Response = (Model200Response) o; - return Objects.equals(name, _200Response.name) && - Objects.equals(PropertyClass, _200Response.PropertyClass); + return Objects.equals(this.name, _200Response.name) && + Objects.equals(this.PropertyClass, _200Response.PropertyClass); } @Override @@ -75,10 +113,11 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java index bb5313b42d4..2a823298323 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -1,17 +1,41 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * ModelApiResponse + */ public class ModelApiResponse { - @SerializedName("code") private Integer code = null; @@ -21,39 +45,63 @@ public class ModelApiResponse { @SerializedName("message") private String message = null; - /** - **/ - @ApiModelProperty(value = "") + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @ApiModelProperty(example = "null", value = "") public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } - /** - **/ - @ApiModelProperty(value = "") + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(example = "null", value = "") public String getType() { return type; } + public void setType(String type) { this.type = type; } - /** - **/ - @ApiModelProperty(value = "") + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @ApiModelProperty(example = "null", value = "") public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -61,9 +109,9 @@ public class ModelApiResponse { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); } @Override @@ -87,10 +135,11 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java index a3ecfb92156..024a9c0df1c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -1,36 +1,66 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - /** * Model for testing reserved words - **/ + */ @ApiModel(description = "Model for testing reserved words") + public class ModelReturn { - @SerializedName("return") private Integer _return = null; - /** - **/ - @ApiModelProperty(value = "") + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @ApiModelProperty(example = "null", value = "") public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -38,7 +68,7 @@ public class ModelReturn { return false; } ModelReturn _return = (ModelReturn) o; - return Objects.equals(_return, _return._return); + return Objects.equals(this._return, _return._return); } @Override @@ -60,10 +90,11 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java index 5aa60a1f6f1..318a2ddd50e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java @@ -1,20 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - /** * Model for testing model name same as property name - **/ + */ @ApiModel(description = "Model for testing model name same as property name") + public class Name { - @SerializedName("name") private Integer name = null; @@ -27,43 +49,63 @@ public class Name { @SerializedName("123Number") private Integer _123Number = null; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", required = true, value = "") public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } - /** - **/ - @ApiModelProperty(value = "") + /** + * Get snakeCase + * @return snakeCase + **/ + @ApiModelProperty(example = "null", value = "") public Integer getSnakeCase() { return snakeCase; } - /** - **/ - @ApiModelProperty(value = "") + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @ApiModelProperty(example = "null", value = "") public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } - /** - **/ - @ApiModelProperty(value = "") + /** + * Get _123Number + * @return _123Number + **/ + @ApiModelProperty(example = "null", value = "") public Integer get123Number() { return _123Number; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -71,10 +113,10 @@ public class Name { return false; } Name name = (Name) o; - return Objects.equals(name, name.name) && - Objects.equals(snakeCase, name.snakeCase) && - Objects.equals(property, name.property) && - Objects.equals(_123Number, name._123Number); + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123Number, name._123Number); } @Override @@ -99,10 +141,11 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java new file mode 100644 index 00000000000..9b9ca048dfb --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -0,0 +1,100 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + + +/** + * NumberOnly + */ + +public class NumberOnly { + @SerializedName("JustNumber") + private BigDecimal justNumber = null; + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @ApiModelProperty(example = "null", value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index 569d1c0fe46..90cfd2f3892 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -1,18 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; -import com.google.gson.annotations.SerializedName; - - - +/** + * Order + */ public class Order { - @SerializedName("id") private Long id = null; @@ -25,17 +49,16 @@ public class Order { @SerializedName("shipDate") private DateTime shipDate = null; - /** * Order Status */ public enum StatusEnum { @SerializedName("placed") PLACED("placed"), - + @SerializedName("approved") APPROVED("approved"), - + @SerializedName("delivered") DELIVERED("delivered"); @@ -57,70 +80,117 @@ public class Order { @SerializedName("complete") private Boolean complete = false; - /** - **/ - @ApiModelProperty(value = "") + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @ApiModelProperty(example = "null", value = "") public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } - /** - **/ - @ApiModelProperty(value = "") + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @ApiModelProperty(example = "null", value = "") public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } - /** - **/ - @ApiModelProperty(value = "") + public Order shipDate(DateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @ApiModelProperty(example = "null", value = "") public DateTime getShipDate() { return shipDate; } + public void setShipDate(DateTime shipDate) { this.shipDate = shipDate; } - /** + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** * Order Status - **/ - @ApiModelProperty(value = "Order Status") + * @return status + **/ + @ApiModelProperty(example = "null", value = "Order Status") public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } - /** - **/ - @ApiModelProperty(value = "") + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @ApiModelProperty(example = "null", value = "") public Boolean getComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -128,12 +198,12 @@ public class Order { return false; } Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); } @Override @@ -160,10 +230,11 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index 8efc46bc471..b80fdeaf923 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -1,6 +1,32 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Category; @@ -8,14 +34,12 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; -import com.google.gson.annotations.SerializedName; - - - +/** + * Pet + */ public class Pet { - @SerializedName("id") private Long id = null; @@ -31,17 +55,16 @@ public class Pet { @SerializedName("tags") private List tags = new ArrayList(); - /** * pet status in the store */ public enum StatusEnum { @SerializedName("available") AVAILABLE("available"), - + @SerializedName("pending") PENDING("pending"), - + @SerializedName("sold") SOLD("sold"); @@ -60,70 +83,117 @@ public class Pet { @SerializedName("status") private StatusEnum status = null; - /** - **/ - @ApiModelProperty(value = "") + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @ApiModelProperty(example = "null", value = "") public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } + public void setName(String name) { this.name = name; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @ApiModelProperty(example = "null", required = true, value = "") public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - /** - **/ - @ApiModelProperty(value = "") + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get tags + * @return tags + **/ + @ApiModelProperty(example = "null", value = "") public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } - /** + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** * pet status in the store - **/ - @ApiModelProperty(value = "pet status in the store") + * @return status + **/ + @ApiModelProperty(example = "null", value = "pet status in the store") public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -131,12 +201,12 @@ public class Pet { return false; } Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); } @Override @@ -163,10 +233,11 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 32e4f515bce..13b729bb94d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -1,43 +1,77 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * ReadOnlyFirst + */ public class ReadOnlyFirst { - @SerializedName("bar") private String bar = null; @SerializedName("baz") private String baz = null; - /** - **/ - @ApiModelProperty(value = "") + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(example = "null", value = "") public String getBar() { return bar; } - /** - **/ - @ApiModelProperty(value = "") + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @ApiModelProperty(example = "null", value = "") public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -45,8 +79,8 @@ public class ReadOnlyFirst { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(bar, readOnlyFirst.bar) && - Objects.equals(baz, readOnlyFirst.baz); + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); } @Override @@ -69,10 +103,11 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java index e2354b064b2..b46b8367a01 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -1,33 +1,65 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * SpecialModelName + */ public class SpecialModelName { - @SerializedName("$special[property.name]") private Long specialPropertyName = null; - /** - **/ - @ApiModelProperty(value = "") + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + /** + * Get specialPropertyName + * @return specialPropertyName + **/ + @ApiModelProperty(example = "null", value = "") public Long getSpecialPropertyName() { return specialPropertyName; } + public void setSpecialPropertyName(Long specialPropertyName) { this.specialPropertyName = specialPropertyName; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -35,7 +67,7 @@ public class SpecialModelName { return false; } SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); } @Override @@ -57,10 +89,11 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java index 9c5ac6cf9a7..e56eb535d1e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java @@ -1,46 +1,86 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * Tag + */ public class Tag { - @SerializedName("id") private Long id = null; @SerializedName("name") private String name = null; - /** - **/ - @ApiModelProperty(value = "") + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", value = "") public String getName() { return name; } + public void setName(String name) { this.name = name; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -48,8 +88,8 @@ public class Tag { return false; } Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); } @Override @@ -72,10 +112,11 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java index 39e40837a6a..6c1ed6ceacc 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java @@ -1,17 +1,41 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * User + */ public class User { - @SerializedName("id") private Long id = null; @@ -36,90 +60,153 @@ public class User { @SerializedName("userStatus") private Integer userStatus = null; - /** - **/ - @ApiModelProperty(value = "") + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @ApiModelProperty(example = "null", value = "") public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } - /** - **/ - @ApiModelProperty(value = "") + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @ApiModelProperty(example = "null", value = "") public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } - /** - **/ - @ApiModelProperty(value = "") + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @ApiModelProperty(example = "null", value = "") public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } - /** - **/ - @ApiModelProperty(value = "") + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @ApiModelProperty(example = "null", value = "") public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } - /** - **/ - @ApiModelProperty(value = "") + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(example = "null", value = "") public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } - /** - **/ - @ApiModelProperty(value = "") + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @ApiModelProperty(example = "null", value = "") public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } - /** + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** * User Status - **/ - @ApiModelProperty(value = "User Status") + * @return userStatus + **/ + @ApiModelProperty(example = "null", value = "User Status") public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -127,14 +214,14 @@ public class User { return false; } User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); } @Override @@ -163,10 +250,11 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/.travis.yml b/samples/client/petstore/java/retrofit2rx/.travis.yml new file mode 100644 index 00000000000..33e79472abd --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/.travis.yml @@ -0,0 +1,29 @@ +# +# 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 + - oraclejdk7 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + - mvn test + # uncomment below to test using gradle + # - gradle test + # uncomment below to test using sbt + # - sbt test diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..77292549927 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..e8cc4cd36dc --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md index 9feee16427f..2cd4b9d33f9 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md @@ -7,6 +7,13 @@ Name | Type | Description | Notes **arrayOfString** | **List<String>** | | [optional] **arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] **arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] +**arrayOfEnum** | [**List<ArrayOfEnumEnum>**](#List<ArrayOfEnumEnum>) | | [optional] + + + +## Enum: List<ArrayOfEnumEnum> +Name | Value +---- | ----- diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index e077fa5c821..0e646d63479 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -4,9 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** fake | To test code injection =end [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** fake | To test enum query parameters + +# **testCodeInjectEnd** +> Void testCodeInjectEnd(testCodeInjectEnd) + +To test code injection =end + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String testCodeInjectEnd = "testCodeInjectEnd_example"; // String | To test code injection =end +try { + Void result = apiInstance.testCodeInjectEnd(testCodeInjectEnd); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testCodeInjectEnd"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testCodeInjectEnd** | **String**| To test code injection =end | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, */ =end'));(phpinfo(' + - **Accept**: application/json, */ end + # **testEndpointParameters** > Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) @@ -74,3 +119,50 @@ No authorization required - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +# **testEnumQueryParameters** +> Void testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble) + +To test enum query parameters + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String enumQueryString = "-efg"; // String | Query parameter enum test (string) +BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double) +Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +try { + Void result = apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumQueryParameters"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..c1d0aac5672 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md new file mode 100644 index 00000000000..c671e97ffbc --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md @@ -0,0 +1,17 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + + + +## Enum: Map<String, InnerEnum> +Name | Value +---- | ----- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md new file mode 100644 index 00000000000..a3feac7fadc --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/gradlew b/samples/client/petstore/java/retrofit2rx/gradlew old mode 100755 new mode 100644 diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index d2049248533..a56d38dc759 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -151,12 +151,11 @@ 1.7 ${java.version} ${java.version} - 1.5.8 - 2.0.2 - 1.1.3 - 2.9.3 + 1.5.9 + 2.1.0 + 1.1.6 + 2.9.4 1.0.1 - 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java index 0255d7c0e91..ea73efea029 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java @@ -41,7 +41,7 @@ import io.swagger.client.auth.OAuthFlow; public class ApiClient { private Map apiAuthorizations; - private OkHttpClient okClient; + private OkHttpClient.Builder okBuilder; private Retrofit.Builder adapterBuilder; public ApiClient() { @@ -110,14 +110,14 @@ public class ApiClient { .setPassword(password); } - public void createDefaultAdapter() { + public void createDefaultAdapter() { Gson gson = new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) .create(); - okClient = new OkHttpClient(); + okBuilder = new OkHttpClient.Builder(); String baseUrl = "http://petstore.swagger.io/v2"; if(!baseUrl.endsWith("/")) @@ -126,14 +126,16 @@ public class ApiClient { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) - .client(okClient) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(gson)); } public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); + return adapterBuilder + .client(okBuilder.build()) + .build() + .create(serviceClass); } @@ -259,7 +261,7 @@ public class ApiClient { throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); } apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); + okBuilder.addInterceptor(authorization); } public Map getApiAuthorizations() { @@ -278,24 +280,24 @@ public class ApiClient { this.adapterBuilder = adapterBuilder; } - public OkHttpClient getOkClient() { - return okClient; + public OkHttpClient.Builder getOkBuilder() { + return okBuilder; } - public void addAuthsToOkClient(OkHttpClient okClient) { + public void addAuthsToOkBuilder(OkHttpClient.Builder okBuilder) { for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); + okBuilder.addInterceptor(apiAuthorization); } } /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the Retrofit + * Clones the okBuilder given in parameter, adds the auth interceptors and uses it to configure the Retrofit * @param okClient */ public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.newBuilder().build(); - addAuthsToOkClient(clone); - adapterBuilder.client(clone); + this.okBuilder = okClient.newBuilder(); + addAuthsToOkBuilder(this.okBuilder); + } } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java index 03c6c81e434..fdcef6b1010 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ /** * 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: \" \\ + * 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 diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index 5e0511922fb..fd700761fac 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -18,6 +18,19 @@ import java.util.List; import java.util.Map; public interface FakeApi { + /** + * To test code injection =end + * + * @param testCodeInjectEnd To test code injection =end (optional) + * @return Call + */ + + @FormUrlEncoded + @PUT("fake") + Observable testCodeInjectEnd( + @Field("test code inject */ =end") String testCodeInjectEnd + ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -42,4 +55,19 @@ public interface FakeApi { @Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") LocalDate date, @Field("dateTime") DateTime dateTime, @Field("password") String password ); + /** + * To test enum query parameters + * + * @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 Call + */ + + @FormUrlEncoded + @GET("fake") + Observable testEnumQueryParameters( + @Field("enum_query_string") String enumQueryString, @Query("enum_query_integer") BigDecimal enumQueryInteger, @Field("enum_query_double") Double enumQueryDouble + ); + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthFlow.java index ec1f942b0f2..50d5260cfd9 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /** * 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: \" \\ + * 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 diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 839b04aa6c5..1943e013fa1 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -1,49 +1,89 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.google.gson.annotations.SerializedName; - - - +/** + * AdditionalPropertiesClass + */ public class AdditionalPropertiesClass { - @SerializedName("map_property") private Map mapProperty = new HashMap(); @SerializedName("map_of_map_property") private Map> mapOfMapProperty = new HashMap>(); - /** - **/ - @ApiModelProperty(value = "") + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @ApiModelProperty(example = "null", value = "") public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - /** - **/ - @ApiModelProperty(value = "") + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @ApiModelProperty(example = "null", value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -51,8 +91,8 @@ public class AdditionalPropertiesClass { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override @@ -75,10 +115,11 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java index 9a14a1289fe..ba3806dc875 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java @@ -1,46 +1,86 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * Animal + */ public class Animal { - @SerializedName("className") private String className = null; @SerializedName("color") private String color = "red"; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } - /** - **/ - @ApiModelProperty(value = "") + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(example = "null", value = "") public String getColor() { return color; } + public void setColor(String color) { this.color = color; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -48,8 +88,8 @@ public class Animal { return false; } Animal animal = (Animal) o; - return Objects.equals(className, animal.className) && - Objects.equals(color, animal.color); + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); } @Override @@ -72,10 +112,11 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java index c7d37b1512c..b54adb09d7b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -1,3 +1,28 @@ +/** + * 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.model; import java.util.Objects; @@ -5,30 +30,27 @@ import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; -import com.google.gson.annotations.SerializedName; - - - +/** + * AnimalFarm + */ public class AnimalFarm extends ArrayList { - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - AnimalFarm animalFarm = (AnimalFarm) o; return true; } @Override public int hashCode() { - return Objects.hash(); + return Objects.hash(super.hashCode()); } @Override @@ -44,10 +66,11 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..5446c2c439b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,102 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +/** + * ArrayOfArrayOfNumberOnly + */ + +public class ArrayOfArrayOfNumberOnly { + @SerializedName("ArrayArrayNumber") + private List> arrayArrayNumber = new ArrayList>(); + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @ApiModelProperty(example = "null", value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..c9257a5d3ee --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,102 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +/** + * ArrayOfNumberOnly + */ + +public class ArrayOfNumberOnly { + @SerializedName("ArrayNumber") + private List arrayNumber = new ArrayList(); + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @ApiModelProperty(example = "null", value = "") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java index 92337cc0246..b853a0b035a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -1,19 +1,44 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; -import com.google.gson.annotations.SerializedName; - - - +/** + * ArrayTest + */ public class ArrayTest { - @SerializedName("array_of_string") private List arrayOfString = new ArrayList(); @@ -24,38 +49,105 @@ public class ArrayTest { private List> arrayArrayOfModel = new ArrayList>(); /** - **/ - @ApiModelProperty(value = "") + * Gets or Sets arrayOfEnum + */ + public enum ArrayOfEnumEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + ArrayOfEnumEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("array_of_enum") + private List arrayOfEnum = new ArrayList(); + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @ApiModelProperty(example = "null", value = "") public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - /** - **/ - @ApiModelProperty(value = "") + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @ApiModelProperty(example = "null", value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - /** - **/ - @ApiModelProperty(value = "") + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @ApiModelProperty(example = "null", value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest arrayOfEnum(List arrayOfEnum) { + this.arrayOfEnum = arrayOfEnum; + return this; + } + + /** + * Get arrayOfEnum + * @return arrayOfEnum + **/ + @ApiModelProperty(example = "null", value = "") + public List getArrayOfEnum() { + return arrayOfEnum; + } + + public void setArrayOfEnum(List arrayOfEnum) { + this.arrayOfEnum = arrayOfEnum; + } + @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -63,14 +155,15 @@ public class ArrayTest { return false; } ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(arrayOfString, arrayTest.arrayOfString) && - Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel) && + Objects.equals(this.arrayOfEnum, arrayTest.arrayOfEnum); } @Override public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel, arrayOfEnum); } @Override @@ -81,6 +174,7 @@ public class ArrayTest { sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append(" arrayOfEnum: ").append(toIndentedString(arrayOfEnum)).append("\n"); sb.append("}"); return sb.toString(); } @@ -89,10 +183,11 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java index 287d6a4d94c..21ed0f4c26b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java @@ -1,18 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; -import com.google.gson.annotations.SerializedName; - - - +/** + * Cat + */ public class Cat extends Animal { - @SerializedName("className") private String className = null; @@ -22,39 +46,63 @@ public class Cat extends Animal { @SerializedName("declawed") private Boolean declawed = null; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Cat className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } - /** - **/ - @ApiModelProperty(value = "") + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(example = "null", value = "") public String getColor() { return color; } + public void setColor(String color) { this.color = color; } - /** - **/ - @ApiModelProperty(value = "") + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @ApiModelProperty(example = "null", value = "") public Boolean getDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -62,14 +110,15 @@ public class Cat extends Animal { return false; } Cat cat = (Cat) o; - return Objects.equals(className, cat.className) && - Objects.equals(color, cat.color) && - Objects.equals(declawed, cat.declawed); + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(className, color, declawed); + return Objects.hash(className, color, declawed, super.hashCode()); } @Override @@ -88,10 +137,11 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java index 93ec7bd0877..2178a866f62 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java @@ -1,46 +1,86 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * Category + */ public class Category { - @SerializedName("id") private Long id = null; @SerializedName("name") private String name = null; - /** - **/ - @ApiModelProperty(value = "") + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", value = "") public String getName() { return name; } + public void setName(String name) { this.name = name; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -48,8 +88,8 @@ public class Category { return false; } Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); } @Override @@ -72,10 +112,11 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java index 5d2ead15f07..4ba5804553f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java @@ -1,18 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; -import com.google.gson.annotations.SerializedName; - - - +/** + * Dog + */ public class Dog extends Animal { - @SerializedName("className") private String className = null; @@ -22,39 +46,63 @@ public class Dog extends Animal { @SerializedName("breed") private String breed = null; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Dog className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } - /** - **/ - @ApiModelProperty(value = "") + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(example = "null", value = "") public String getColor() { return color; } + public void setColor(String color) { this.color = color; } - /** - **/ - @ApiModelProperty(value = "") + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @ApiModelProperty(example = "null", value = "") public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -62,14 +110,15 @@ public class Dog extends Animal { return false; } Dog dog = (Dog) o; - return Objects.equals(className, dog.className) && - Objects.equals(color, dog.color) && - Objects.equals(breed, dog.breed); + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(className, color, breed); + return Objects.hash(className, color, breed, super.hashCode()); } @Override @@ -88,10 +137,11 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java index 8f9357fbd32..73484907229 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java @@ -1,50 +1,57 @@ +/** + * 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.model; import java.util.Objects; - import com.google.gson.annotations.SerializedName; - - - -public class EnumClass { +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + @SerializedName("_abc") + _ABC("_abc"), + + @SerializedName("-efg") + _EFG("-efg"), + + @SerializedName("(xyz)") + _XYZ_("(xyz)"); - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumClass enumClass = (EnumClass) o; - return true; - } + private String value; - @Override - public int hashCode() { - return Objects.hash(); + EnumClass(String value) { + this.value = value; } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumClass {\n"); - - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return String.valueOf(value); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java index 8db392afccc..9aad1223215 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java @@ -1,25 +1,48 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * EnumTest + */ public class EnumTest { - - /** * Gets or Sets enumString */ public enum EnumStringEnum { @SerializedName("UPPER") UPPER("UPPER"), - + @SerializedName("lower") LOWER("lower"); @@ -38,14 +61,13 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; - /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { @SerializedName("1") NUMBER_1(1), - + @SerializedName("-1") NUMBER_MINUS_1(-1); @@ -64,14 +86,13 @@ public class EnumTest { @SerializedName("enum_integer") private EnumIntegerEnum enumInteger = null; - /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { @SerializedName("1.1") NUMBER_1_DOT_1(1.1), - + @SerializedName("-1.2") NUMBER_MINUS_1_DOT_2(-1.2); @@ -90,39 +111,63 @@ public class EnumTest { @SerializedName("enum_number") private EnumNumberEnum enumNumber = null; - /** - **/ - @ApiModelProperty(value = "") + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @ApiModelProperty(example = "null", value = "") public EnumStringEnum getEnumString() { return enumString; } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - /** - **/ - @ApiModelProperty(value = "") + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @ApiModelProperty(example = "null", value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - /** - **/ - @ApiModelProperty(value = "") + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @ApiModelProperty(example = "null", value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -130,9 +175,9 @@ public class EnumTest { return false; } EnumTest enumTest = (EnumTest) o; - return Objects.equals(enumString, enumTest.enumString) && - Objects.equals(enumInteger, enumTest.enumInteger) && - Objects.equals(enumNumber, enumTest.enumNumber); + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber); } @Override @@ -156,10 +201,11 @@ public class EnumTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java index 6063cf33f77..91109681509 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java @@ -1,20 +1,44 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.joda.time.DateTime; import org.joda.time.LocalDate; -import com.google.gson.annotations.SerializedName; - - - +/** + * FormatTest + */ public class FormatTest { - @SerializedName("integer") private Integer integer = null; @@ -54,149 +78,253 @@ public class FormatTest { @SerializedName("password") private String password = null; - /** + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer * minimum: 10.0 * maximum: 100.0 - **/ - @ApiModelProperty(value = "") + * @return integer + **/ + @ApiModelProperty(example = "null", value = "") public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } - /** + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 * minimum: 20.0 * maximum: 200.0 - **/ - @ApiModelProperty(value = "") + * @return int32 + **/ + @ApiModelProperty(example = "null", value = "") public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @ApiModelProperty(example = "null", value = "") public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } - /** + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number * minimum: 32.1 * maximum: 543.2 - **/ - @ApiModelProperty(required = true, value = "") + * @return number + **/ + @ApiModelProperty(example = "null", required = true, value = "") public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } - /** + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float * minimum: 54.3 * maximum: 987.6 - **/ - @ApiModelProperty(value = "") + * @return _float + **/ + @ApiModelProperty(example = "null", value = "") public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } - /** + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double * minimum: 67.8 * maximum: 123.4 - **/ - @ApiModelProperty(value = "") + * @return _double + **/ + @ApiModelProperty(example = "null", value = "") public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @ApiModelProperty(example = "null", value = "") public String getString() { return string; } + public void setString(String string) { this.string = string; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @ApiModelProperty(example = "null", required = true, value = "") public byte[] getByte() { return _byte; } + public void setByte(byte[] _byte) { this._byte = _byte; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @ApiModelProperty(example = "null", value = "") public byte[] getBinary() { return binary; } + public void setBinary(byte[] binary) { this.binary = binary; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @ApiModelProperty(example = "null", required = true, value = "") public LocalDate getDate() { return date; } + public void setDate(LocalDate date) { this.date = date; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(example = "null", value = "") public DateTime getDateTime() { return dateTime; } + public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } - /** - **/ - @ApiModelProperty(value = "") + public FormatTest uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(example = "null", value = "") public String getUuid() { return uuid; } + public void setUuid(String uuid) { this.uuid = uuid; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(example = "null", required = true, value = "") public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -204,19 +332,19 @@ public class FormatTest { return false; } FormatTest formatTest = (FormatTest) o; - return Objects.equals(integer, formatTest.integer) && - Objects.equals(int32, formatTest.int32) && - Objects.equals(int64, formatTest.int64) && - Objects.equals(number, formatTest.number) && - Objects.equals(_float, formatTest._float) && - Objects.equals(_double, formatTest._double) && - Objects.equals(string, formatTest.string) && - Objects.equals(_byte, formatTest._byte) && - Objects.equals(binary, formatTest.binary) && - Objects.equals(date, formatTest.date) && - Objects.equals(dateTime, formatTest.dateTime) && - Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Objects.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password); } @Override @@ -250,10 +378,11 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..d77fc7ac36b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -0,0 +1,104 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +/** + * HasOnlyReadOnly + */ + +public class HasOnlyReadOnly { + @SerializedName("bar") + private String bar = null; + + @SerializedName("foo") + private String foo = null; + + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(example = "null", value = "") + public String getBar() { + return bar; + } + + /** + * Get foo + * @return foo + **/ + @ApiModelProperty(example = "null", value = "") + public String getFoo() { + return foo; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java new file mode 100644 index 00000000000..61bdb6b2c65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java @@ -0,0 +1,147 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * MapTest + */ + +public class MapTest { + @SerializedName("map_map_of_string") + private Map> mapMapOfString = new HashMap>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("map_of_enum_string") + private Map mapOfEnumString = new HashMap(); + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @ApiModelProperty(example = "null", value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @ApiModelProperty(example = "null", value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index cf7f73c705f..6e587b1bf97 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,6 +1,32 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; @@ -9,14 +35,12 @@ import java.util.List; import java.util.Map; import org.joda.time.DateTime; -import com.google.gson.annotations.SerializedName; - - - +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ public class MixedPropertiesAndAdditionalPropertiesClass { - @SerializedName("uuid") private String uuid = null; @@ -26,39 +50,63 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("map") private Map map = new HashMap(); - /** - **/ - @ApiModelProperty(value = "") + public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(example = "null", value = "") public String getUuid() { return uuid; } + public void setUuid(String uuid) { this.uuid = uuid; } - /** - **/ - @ApiModelProperty(value = "") + public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(example = "null", value = "") public DateTime getDateTime() { return dateTime; } + public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } - /** - **/ - @ApiModelProperty(value = "") + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + /** + * Get map + * @return map + **/ + @ApiModelProperty(example = "null", value = "") public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -66,9 +114,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return false; } MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override @@ -92,10 +140,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java index 22d2bbd763d..d8da58aca9c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java @@ -1,49 +1,87 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - /** * Model for testing model name starting with number - **/ + */ @ApiModel(description = "Model for testing model name starting with number") + public class Model200Response { - @SerializedName("name") private Integer name = null; @SerializedName("class") private String PropertyClass = null; - /** - **/ - @ApiModelProperty(value = "") + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", value = "") public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } - /** - **/ - @ApiModelProperty(value = "") + public Model200Response PropertyClass(String PropertyClass) { + this.PropertyClass = PropertyClass; + return this; + } + + /** + * Get PropertyClass + * @return PropertyClass + **/ + @ApiModelProperty(example = "null", value = "") public String getPropertyClass() { return PropertyClass; } + public void setPropertyClass(String PropertyClass) { this.PropertyClass = PropertyClass; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -51,8 +89,8 @@ public class Model200Response { return false; } Model200Response _200Response = (Model200Response) o; - return Objects.equals(name, _200Response.name) && - Objects.equals(PropertyClass, _200Response.PropertyClass); + return Objects.equals(this.name, _200Response.name) && + Objects.equals(this.PropertyClass, _200Response.PropertyClass); } @Override @@ -75,10 +113,11 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java index bb5313b42d4..2a823298323 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -1,17 +1,41 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * ModelApiResponse + */ public class ModelApiResponse { - @SerializedName("code") private Integer code = null; @@ -21,39 +45,63 @@ public class ModelApiResponse { @SerializedName("message") private String message = null; - /** - **/ - @ApiModelProperty(value = "") + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @ApiModelProperty(example = "null", value = "") public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } - /** - **/ - @ApiModelProperty(value = "") + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(example = "null", value = "") public String getType() { return type; } + public void setType(String type) { this.type = type; } - /** - **/ - @ApiModelProperty(value = "") + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @ApiModelProperty(example = "null", value = "") public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -61,9 +109,9 @@ public class ModelApiResponse { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); } @Override @@ -87,10 +135,11 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java index a3ecfb92156..024a9c0df1c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java @@ -1,36 +1,66 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - /** * Model for testing reserved words - **/ + */ @ApiModel(description = "Model for testing reserved words") + public class ModelReturn { - @SerializedName("return") private Integer _return = null; - /** - **/ - @ApiModelProperty(value = "") + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @ApiModelProperty(example = "null", value = "") public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -38,7 +68,7 @@ public class ModelReturn { return false; } ModelReturn _return = (ModelReturn) o; - return Objects.equals(_return, _return._return); + return Objects.equals(this._return, _return._return); } @Override @@ -60,10 +90,11 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java index 5aa60a1f6f1..318a2ddd50e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java @@ -1,20 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - /** * Model for testing model name same as property name - **/ + */ @ApiModel(description = "Model for testing model name same as property name") + public class Name { - @SerializedName("name") private Integer name = null; @@ -27,43 +49,63 @@ public class Name { @SerializedName("123Number") private Integer _123Number = null; - /** - **/ - @ApiModelProperty(required = true, value = "") + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", required = true, value = "") public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } - /** - **/ - @ApiModelProperty(value = "") + /** + * Get snakeCase + * @return snakeCase + **/ + @ApiModelProperty(example = "null", value = "") public Integer getSnakeCase() { return snakeCase; } - /** - **/ - @ApiModelProperty(value = "") + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @ApiModelProperty(example = "null", value = "") public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } - /** - **/ - @ApiModelProperty(value = "") + /** + * Get _123Number + * @return _123Number + **/ + @ApiModelProperty(example = "null", value = "") public Integer get123Number() { return _123Number; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -71,10 +113,10 @@ public class Name { return false; } Name name = (Name) o; - return Objects.equals(name, name.name) && - Objects.equals(snakeCase, name.snakeCase) && - Objects.equals(property, name.property) && - Objects.equals(_123Number, name._123Number); + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123Number, name._123Number); } @Override @@ -99,10 +141,11 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java new file mode 100644 index 00000000000..9b9ca048dfb --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java @@ -0,0 +1,100 @@ +/** + * 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.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + + +/** + * NumberOnly + */ + +public class NumberOnly { + @SerializedName("JustNumber") + private BigDecimal justNumber = null; + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @ApiModelProperty(example = "null", value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index 569d1c0fe46..90cfd2f3892 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -1,18 +1,42 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; -import com.google.gson.annotations.SerializedName; - - - +/** + * Order + */ public class Order { - @SerializedName("id") private Long id = null; @@ -25,17 +49,16 @@ public class Order { @SerializedName("shipDate") private DateTime shipDate = null; - /** * Order Status */ public enum StatusEnum { @SerializedName("placed") PLACED("placed"), - + @SerializedName("approved") APPROVED("approved"), - + @SerializedName("delivered") DELIVERED("delivered"); @@ -57,70 +80,117 @@ public class Order { @SerializedName("complete") private Boolean complete = false; - /** - **/ - @ApiModelProperty(value = "") + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @ApiModelProperty(example = "null", value = "") public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } - /** - **/ - @ApiModelProperty(value = "") + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @ApiModelProperty(example = "null", value = "") public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } - /** - **/ - @ApiModelProperty(value = "") + public Order shipDate(DateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @ApiModelProperty(example = "null", value = "") public DateTime getShipDate() { return shipDate; } + public void setShipDate(DateTime shipDate) { this.shipDate = shipDate; } - /** + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** * Order Status - **/ - @ApiModelProperty(value = "Order Status") + * @return status + **/ + @ApiModelProperty(example = "null", value = "Order Status") public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } - /** - **/ - @ApiModelProperty(value = "") + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @ApiModelProperty(example = "null", value = "") public Boolean getComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -128,12 +198,12 @@ public class Order { return false; } Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); } @Override @@ -160,10 +230,11 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index 8efc46bc471..b80fdeaf923 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -1,6 +1,32 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Category; @@ -8,14 +34,12 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; -import com.google.gson.annotations.SerializedName; - - - +/** + * Pet + */ public class Pet { - @SerializedName("id") private Long id = null; @@ -31,17 +55,16 @@ public class Pet { @SerializedName("tags") private List tags = new ArrayList(); - /** * pet status in the store */ public enum StatusEnum { @SerializedName("available") AVAILABLE("available"), - + @SerializedName("pending") PENDING("pending"), - + @SerializedName("sold") SOLD("sold"); @@ -60,70 +83,117 @@ public class Pet { @SerializedName("status") private StatusEnum status = null; - /** - **/ - @ApiModelProperty(value = "") + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @ApiModelProperty(example = "null", value = "") public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } + public void setName(String name) { this.name = name; } - /** - **/ - @ApiModelProperty(required = true, value = "") + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @ApiModelProperty(example = "null", required = true, value = "") public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - /** - **/ - @ApiModelProperty(value = "") + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get tags + * @return tags + **/ + @ApiModelProperty(example = "null", value = "") public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } - /** + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** * pet status in the store - **/ - @ApiModelProperty(value = "pet status in the store") + * @return status + **/ + @ApiModelProperty(example = "null", value = "pet status in the store") public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -131,12 +201,12 @@ public class Pet { return false; } Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); } @Override @@ -163,10 +233,11 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 32e4f515bce..13b729bb94d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -1,43 +1,77 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * ReadOnlyFirst + */ public class ReadOnlyFirst { - @SerializedName("bar") private String bar = null; @SerializedName("baz") private String baz = null; - /** - **/ - @ApiModelProperty(value = "") + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(example = "null", value = "") public String getBar() { return bar; } - /** - **/ - @ApiModelProperty(value = "") + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @ApiModelProperty(example = "null", value = "") public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -45,8 +79,8 @@ public class ReadOnlyFirst { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(bar, readOnlyFirst.bar) && - Objects.equals(baz, readOnlyFirst.baz); + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); } @Override @@ -69,10 +103,11 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java index e2354b064b2..b46b8367a01 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -1,33 +1,65 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * SpecialModelName + */ public class SpecialModelName { - @SerializedName("$special[property.name]") private Long specialPropertyName = null; - /** - **/ - @ApiModelProperty(value = "") + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + /** + * Get specialPropertyName + * @return specialPropertyName + **/ + @ApiModelProperty(example = "null", value = "") public Long getSpecialPropertyName() { return specialPropertyName; } + public void setSpecialPropertyName(Long specialPropertyName) { this.specialPropertyName = specialPropertyName; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -35,7 +67,7 @@ public class SpecialModelName { return false; } SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); } @Override @@ -57,10 +89,11 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java index 9c5ac6cf9a7..e56eb535d1e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java @@ -1,46 +1,86 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * Tag + */ public class Tag { - @SerializedName("id") private Long id = null; @SerializedName("name") private String name = null; - /** - **/ - @ApiModelProperty(value = "") + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "null", value = "") public String getName() { return name; } + public void setName(String name) { this.name = name; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -48,8 +88,8 @@ public class Tag { return false; } Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); } @Override @@ -72,10 +112,11 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java index 39e40837a6a..6c1ed6ceacc 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java @@ -1,17 +1,41 @@ +/** + * 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.model; import java.util.Objects; +import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.google.gson.annotations.SerializedName; - - - +/** + * User + */ public class User { - @SerializedName("id") private Long id = null; @@ -36,90 +60,153 @@ public class User { @SerializedName("userStatus") private Integer userStatus = null; - /** - **/ - @ApiModelProperty(value = "") + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } + public void setId(Long id) { this.id = id; } - /** - **/ - @ApiModelProperty(value = "") + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @ApiModelProperty(example = "null", value = "") public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } - /** - **/ - @ApiModelProperty(value = "") + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @ApiModelProperty(example = "null", value = "") public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } - /** - **/ - @ApiModelProperty(value = "") + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @ApiModelProperty(example = "null", value = "") public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } - /** - **/ - @ApiModelProperty(value = "") + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @ApiModelProperty(example = "null", value = "") public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } - /** - **/ - @ApiModelProperty(value = "") + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(example = "null", value = "") public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } - /** - **/ - @ApiModelProperty(value = "") + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @ApiModelProperty(example = "null", value = "") public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } - /** + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** * User Status - **/ - @ApiModelProperty(value = "User Status") + * @return userStatus + **/ + @ApiModelProperty(example = "null", value = "User Status") public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -127,14 +214,14 @@ public class User { return false; } User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); } @Override @@ -163,10 +250,11 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } } +