[Java] Play! Framework 2.4 WS client support + retrofit2 (#4270)

* implemented core integration with play 2.4 ws

* added shell script to test on CI

* added shell script to composite file for all java generators

* added some comments
changed promise param to Response<T> to allow access to http status code and raw response if needed

* removed unnecessary whitespace changes

* added java7 compatibility, play ws deps to pom.xml

* added generated play24 client

* fixed imports
This commit is contained in:
lukoyanov 2016-12-14 12:32:49 +03:00 committed by wing328
parent 0df8bd2140
commit a13dee7167
107 changed files with 8713 additions and 18 deletions

View File

@ -9,3 +9,4 @@
./bin/java-petstore-retrofit2.sh
./bin/java-petstore-retrofit2rx.sh
./bin/java8-petstore-jersey2.sh
./bin/java-petstore-retrofit2-play24.sh

View File

@ -0,0 +1 @@
{"useBeanValidation":"true","enableBuilderSupport":"true","library":"retrofit2", "usePlay24WS":"true"}

View File

@ -0,0 +1,34 @@
#!/bin/sh
SCRIPT="$0"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play24.json -o samples/client/petstore/java/retrofit2-play24"
echo "Removing files and folders under samples/client/petstore/java/retrofit2-play24/src/main"
rm -rf samples/client/petstore/java/retrofit2-play24/src/main
find samples/client/petstore/java/retrofit2-play24 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
java $JAVA_OPTS -jar $executable $ags

View File

@ -1,26 +1,16 @@
package io.swagger.codegen.languages;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import io.swagger.codegen.*;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.PerformBeanValidationFeatures;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.SupportingFile;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.PerformBeanValidationFeatures;
import java.io.File;
import java.util.*;
import java.util.regex.Pattern;
public class JavaClientCodegen extends AbstractJavaCodegen
implements BeanValidationFeatures, PerformBeanValidationFeatures {
@ -30,6 +20,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
private static final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class);
public static final String USE_RX_JAVA = "useRxJava";
public static final String USE_PLAY24_WS = "usePlay24WS";
public static final String PARCELABLE_MODEL = "parcelableModel";
public static final String RETROFIT_1 = "retrofit";
@ -37,6 +28,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
protected String gradleWrapperPackage = "gradle.wrapper";
protected boolean useRxJava = false;
protected boolean usePlay24WS = false;
protected boolean parcelableModel = false;
protected boolean useBeanValidation = false;
protected boolean performBeanValidation = false;
@ -52,6 +44,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library."));
cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library."));
cliOptions.add(CliOption.newBoolean(USE_PLAY24_WS, "Use Play! 2.4 Async HTTP client (Play WS API)"));
cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library."));
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation"));
@ -94,6 +87,11 @@ public class JavaClientCodegen extends AbstractJavaCodegen
if (additionalProperties.containsKey(USE_RX_JAVA)) {
this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString()));
}
if (additionalProperties.containsKey(USE_PLAY24_WS)) {
this.setUsePlay24WS(Boolean.valueOf(additionalProperties.get(USE_PLAY24_WS).toString()));
}
additionalProperties.put(USE_PLAY24_WS, usePlay24WS);
if (additionalProperties.containsKey(PARCELABLE_MODEL)) {
this.setParcelableModel(Boolean.valueOf(additionalProperties.get(PARCELABLE_MODEL).toString()));
}
@ -177,6 +175,33 @@ public class JavaClientCodegen extends AbstractJavaCodegen
LOGGER.error("Unknown library option (-l/--library): " + getLibrary());
}
if (Boolean.TRUE.equals(additionalProperties.get(USE_PLAY24_WS))) {
// remove unsupported auth
Iterator<SupportingFile> iter = supportingFiles.iterator();
while (iter.hasNext()) {
SupportingFile sf = iter.next();
if (sf.templateFile.startsWith("auth/")) {
iter.remove();
}
}
// auth
supportingFiles.add(new SupportingFile("play24/auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
// api client
supportingFiles.add(new SupportingFile("play24/ApiClient.mustache", invokerFolder, "ApiClient.java"));
// adapters
supportingFiles
.add(new SupportingFile("play24/Play24CallFactory.mustache", invokerFolder, "Play24CallFactory.java"));
supportingFiles.add(new SupportingFile("play24/Play24CallAdapterFactory.mustache", invokerFolder,
"Play24CallAdapterFactory.java"));
additionalProperties.put("jackson", "true");
additionalProperties.remove("gson");
}
if (additionalProperties.containsKey("jackson") ) {
supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder, "RFC3339DateFormat.java"));
}
@ -312,6 +337,11 @@ public class JavaClientCodegen extends AbstractJavaCodegen
this.useRxJava = useRxJava;
}
public void setUsePlay24WS(boolean usePlay24WS) {
this.usePlay24WS = usePlay24WS;
}
public void setParcelableModel(boolean parcelableModel) {
this.parcelableModel = parcelableModel;
}

View File

@ -18,6 +18,11 @@ import java.util.List;
import java.util.Map;
{{/fullJavaUtil}}
{{#usePlay24WS}}
import play.libs.F;
import retrofit2.Response;
{{/usePlay24WS}}
{{#operations}}
public interface {{classname}} {
{{#operation}}
@ -39,7 +44,7 @@ public interface {{classname}} {
{{/prioritizedContentTypes}}
{{/formParams}}
@{{httpMethod}}("{{path}}")
{{#useRxJava}}Observable{{/useRxJava}}{{^useRxJava}}Call{{/useRxJava}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}({{^allParams}});{{/allParams}}
{{^usePlay24WS}}{{#useRxJava}}Observable{{/useRxJava}}{{^useRxJava}}Call{{/useRxJava}}{{/usePlay24WS}}{{#usePlay24WS}}F.Promise<Response{{/usePlay24WS}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>{{#usePlay24WS}}>{{/usePlay24WS}} {{operationId}}({{^allParams}});{{/allParams}}
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
);{{/hasMore}}{{/allParams}}

View File

@ -0,0 +1,136 @@
package {{invokerPackage}};
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.*;
import retrofit2.Retrofit;
import retrofit2.converter.scalars.ScalarsConverterFactory;
import retrofit2.converter.jackson.JacksonConverterFactory;
import play.libs.Json;
import play.libs.ws.WSClient;
import {{invokerPackage}}.Play24CallAdapterFactory;
import {{invokerPackage}}.Play24CallFactory;
import okhttp3.Interceptor;
import {{invokerPackage}}.auth.ApiKeyAuth;
import {{invokerPackage}}.auth.Authentication;
/**
* API client
*/
public class ApiClient {
/** Underlying HTTP-client */
private WSClient wsClient;
/** Supported auths */
private Map<String, Authentication> authentications;
/** API base path */
private String basePath = "{{{basePath}}}";
public ApiClient(WSClient wsClient) {
this();
this.wsClient = wsClient;
}
public ApiClient() {
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}
// authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}}
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
// authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
/**
* Creates a retrofit2 client for given API interface
*/
public <S> S createService(Class<S> serviceClass) {
if(!basePath.endsWith("/")) {
basePath = basePath + "/";
}
Map<String, String> extraHeaders = new HashMap<>();
List<Pair> extraQueryParams = new ArrayList<>();
for (String authName : authentications.keySet()) {
Authentication auth = authentications.get(authName);
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
auth.applyToParams(extraQueryParams, extraHeaders);
}
return new Retrofit.Builder()
.baseUrl(basePath)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(JacksonConverterFactory.create(Json.mapper()))
.callFactory(new Play24CallFactory(wsClient, extraHeaders, extraQueryParams))
.addCallAdapterFactory(new Play24CallAdapterFactory())
.build()
.create(serviceClass);
}
/**
* Helper method to set API base path
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
return this;
}
/**
* Get authentications (key: authentication name, value: authentication).
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
}
/**
* Get authentication for the given name.
*
* @param authName The authentication name
* @return The authentication, null if not found
*/
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
/**
* Helper method to set API key value for the first API key authentication.
*/
public ApiClient setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set API key prefix for the first API key authentication.
*/
public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
}

View File

@ -0,0 +1,90 @@
package {{invokerPackage}};
import play.libs.F;
import retrofit2.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.WildcardType;
/**
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link play.libs.F.Promise}
*/
public class Play24CallAdapterFactory extends CallAdapter.Factory {
@Override
public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
if (!(returnType instanceof ParameterizedType)) {
return null;
}
ParameterizedType type = (ParameterizedType) returnType;
if (type.getRawType() != F.Promise.class) {
return null;
}
return createAdapter((ParameterizedType) returnType);
}
private Type getTypeParam(ParameterizedType type) {
Type[] types = type.getActualTypeArguments();
if (types.length != 1) {
throw new IllegalStateException("Must be exactly one type parameter");
}
Type paramType = types[0];
if (paramType instanceof WildcardType) {
return ((WildcardType) paramType).getUpperBounds()[0];
}
return paramType;
}
private CallAdapter<F.Promise<?>> createAdapter(ParameterizedType returnType) {
Type parameterType = getTypeParam(returnType);
return new ValueAdapter(parameterType);
}
/**
* Adpater that coverts values returned by API interface into Play promises
*/
static final class ValueAdapter implements CallAdapter<F.Promise<?>> {
private final Type responseType;
ValueAdapter(Type responseType) {
this.responseType = responseType;
}
@Override
public Type responseType() {
return responseType;
}
@Override
public <R> F.Promise<R> adapt(final Call<R> call) {
final F.RedeemablePromise<R> promise = F.RedeemablePromise.empty();
call.enqueue(new Callback<R>() {
@Override
public void onResponse(Call<R> call, Response<R> response) {
if (response.isSuccessful()) {
promise.success(response.body());
} else {
promise.failure(new Exception(response.errorBody().toString()));
}
}
@Override
public void onFailure(Call<R> call, Throwable t) {
promise.failure(t);
}
});
return promise;
}
}
}

View File

@ -0,0 +1,210 @@
package {{invokerPackage}};
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSource;
import play.libs.F;
import play.libs.ws.WSClient;
import play.libs.ws.WSRequest;
import play.libs.ws.WSResponse;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Creates {@link Call} instances that invoke underlying {@link WSClient}
*/
public class Play24CallFactory implements okhttp3.Call.Factory {
/** PlayWS http client */
private final WSClient wsClient;
/** Extra headers to add to request */
private Map<String, String> extraHeaders = new HashMap<>();
/** Extra query parameters to add to request */
private List<Pair> extraQueryParams = new ArrayList<>();
public Play24CallFactory(WSClient wsClient) {
this.wsClient = wsClient;
}
public Play24CallFactory(WSClient wsClient, Map<String, String> extraHeaders,
List<Pair> extraQueryParams) {
this.wsClient = wsClient;
this.extraHeaders.putAll(extraHeaders);
this.extraQueryParams.addAll(extraQueryParams);
}
@Override
public Call newCall(Request request) {
// add extra headers
Request.Builder rb = request.newBuilder();
for (Map.Entry<String, String> header : this.extraHeaders.entrySet()) {
rb.addHeader(header.getKey(), header.getValue());
}
// add extra query params
if (!this.extraQueryParams.isEmpty()) {
String newQuery = request.url().uri().getQuery();
for (Pair queryParam : this.extraQueryParams) {
String param = String.format("%s=%s", queryParam.getName(), queryParam.getValue());
if (newQuery == null) {
newQuery = param;
} else {
newQuery += "&" + param;
}
}
URI newUri;
try {
newUri = new URI(request.url().uri().getScheme(), request.url().uri().getAuthority(),
request.url().uri().getPath(), newQuery, request.url().uri().getFragment());
rb.url(newUri.toURL());
} catch (MalformedURLException | URISyntaxException e) {
throw new RuntimeException("Error while updating an url", e);
}
}
return new PlayWSCall(wsClient, rb.build());
}
/**
* Call implementation that delegates to Play WS Client
*/
static class PlayWSCall implements Call {
private final WSClient wsClient;
private WSRequest wsRequest;
private final Request request;
public PlayWSCall(WSClient wsClient, Request request) {
this.wsClient = wsClient;
this.request = request;
}
@Override
public Request request() {
return request;
}
@Override
public void enqueue(final okhttp3.Callback responseCallback) {
final Call call = this;
final F.Promise<WSResponse> promise = executeAsync();
promise.onRedeem(new F.Callback<WSResponse>() {
@Override
public void invoke(WSResponse wsResponse) throws Throwable {
responseCallback.onResponse(call, PlayWSCall.this.toWSResponse(wsResponse));
}
});
promise.onFailure(new F.Callback<Throwable>() {
@Override
public void invoke(Throwable throwable) throws Throwable {
if (throwable instanceof IOException) {
responseCallback.onFailure(call, (IOException) throwable);
} else {
responseCallback.onFailure(call, new IOException(throwable));
}
}
});
}
F.Promise<WSResponse> executeAsync() {
try {
wsRequest = wsClient.url(request.url().uri().toString());
addHeaders(wsRequest);
if (request.body() != null) {
addBody(wsRequest);
}
return wsRequest.execute(request.method());
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
private void addHeaders(WSRequest wsRequest) {
for(Map.Entry<String, List<String>> entry : request.headers().toMultimap().entrySet()) {
List<String> values = entry.getValue();
for (String value : values) {
wsRequest.setHeader(entry.getKey(), value);
}
}
}
private void addBody(WSRequest wsRequest) throws IOException {
Buffer buffer = new Buffer();
request.body().writeTo(buffer);
wsRequest.setBody(buffer.inputStream());
wsRequest.setContentType(request.body().contentType().toString());
}
private Response toWSResponse(final WSResponse r) {
final Response.Builder builder = new Response.Builder();
builder.request(request)
.code(r.getStatus())
.body(new ResponseBody() {
@Override
public MediaType contentType() {
return MediaType.parse(r.getHeader("Content-Type"));
}
@Override
public long contentLength() {
return r.getBody().getBytes().length;
}
@Override
public BufferedSource source() {
return new Buffer().write(r.getBody().getBytes());
}
});
for (Map.Entry<String, List<String>> entry : r.getAllHeaders().entrySet()) {
for (String value : entry.getValue()) {
builder.addHeader(entry.getKey(), value);
}
}
builder.protocol(Protocol.HTTP_1_1);
return builder.build();
}
@Override
public Response execute() throws IOException {
throw new UnsupportedOperationException("Not supported");
}
@Override
public void cancel() {
throw new UnsupportedOperationException("Not supported");
}
@Override
public boolean isExecuted() {
return false;
}
@Override
public boolean isCanceled() {
return false;
}
}
}

View File

@ -0,0 +1,67 @@
{{>licenseInfo}}
package {{invokerPackage}}.auth;
import {{invokerPackage}}.Pair;
import java.util.Map;
import java.util.List;
/**
* Holds ApiKey auth info
*/
{{>generatedAnnotation}}
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
}
}
}

View File

@ -148,6 +148,40 @@
<version>${retrofit-version}</version>
</dependency>
{{/useRxJava}}
{{#usePlay24WS}}
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-java-ws_2.10</artifactId>
<version>2.4.6</version>
</dependency>
{{/usePlay24WS}}
<!-- test dependencies -->
<dependency>
@ -164,6 +198,9 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.9</swagger-core-version>
<retrofit-version>2.1.0</retrofit-version>
{{#usePlay24WS}}
<jackson-version>2.7.5</jackson-version>
{{/usePlay24WS}}
{{#useRxJava}}
<rxjava-version>1.1.6</rxjava-version>
{{/useRxJava}}

View File

@ -1,6 +1,5 @@
package io.swagger.codegen.options;
import com.google.common.collect.ImmutableMap;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.languages.JavaClientCodegen;
@ -18,6 +17,7 @@ public class JavaClientOptionsProvider extends JavaOptionsProvider {
Map<String, String> options = new HashMap<String, String>(super.createOptions());
options.put(CodegenConstants.LIBRARY, DEFAULT_LIBRARY_VALUE);
options.put(JavaClientCodegen.USE_RX_JAVA, "false");
options.put(JavaClientCodegen.USE_PLAY24_WS, "false");
options.put(JavaClientCodegen.PARCELABLE_MODEL, "false");
options.put(JavaClientCodegen.SUPPORT_JAVA6, "false");
options.put(JavaClientCodegen.USE_BEANVALIDATION, "false");

View File

@ -0,0 +1,21 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# exclude jar for gradle wrapper
!gradle/wrapper/*.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# build files
**/target
target
.gradle
build

View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,17 @@
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#
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

View File

@ -0,0 +1,39 @@
# swagger-java-client
## Requirements
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
## Installation & Usage
To install the API client library to your local Maven repository, simply execute:
```shell
mvn install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn deploy
```
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
```xml
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
```
## Author
apiteam@swagger.io

View File

@ -0,0 +1,113 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'io.swagger'
version = '1.0.0'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
repositories {
jcenter()
}
if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
dependencies {
provided 'javax.annotation:jsr250-api:1.0'
}
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
} else {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-java-client'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}
ext {
oltu_version = "1.0.1"
retrofit_version = "2.0.2"
swagger_annotations_version = "1.5.8"
junit_version = "4.12"
jodatime_version = "2.9.3"
}
dependencies {
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
compile "com.squareup.retrofit2:converter-scalars:$retrofit_version"
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
compile "joda-time:joda-time:$jodatime_version"
testCompile "junit:junit:$junit_version"
}

View File

@ -0,0 +1,21 @@
lazy val root = (project in file(".")).
settings(
organization := "io.swagger",
name := "swagger-java-client",
version := "1.0.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"com.squareup.retrofit2" % "retrofit" % "2.0.2" % "compile",
"com.squareup.retrofit2" % "converter-scalars" % "2.0.2" % "compile",
"com.squareup.retrofit2" % "converter-gson" % "2.0.2" % "compile",
"io.swagger" % "swagger-annotations" % "1.5.8" % "compile",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile",
"joda-time" % "joda-time" % "2.9.3" % "compile",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
)

View File

@ -0,0 +1,11 @@
# AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapProperty** | **Map&lt;String, String&gt;** | | [optional]
**mapOfMapProperty** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]

View File

@ -0,0 +1,11 @@
# Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional]

View File

@ -0,0 +1,9 @@
# AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -0,0 +1,10 @@
# ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayArrayNumber** | [**List&lt;List&lt;BigDecimal&gt;&gt;**](List.md) | | [optional]

View File

@ -0,0 +1,10 @@
# ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayNumber** | [**List&lt;BigDecimal&gt;**](BigDecimal.md) | | [optional]

View File

@ -0,0 +1,12 @@
# ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayOfString** | **List&lt;String&gt;** | | [optional]
**arrayArrayOfInteger** | [**List&lt;List&lt;Long&gt;&gt;**](List.md) | | [optional]
**arrayArrayOfModel** | [**List&lt;List&lt;ReadOnlyFirst&gt;&gt;**](List.md) | | [optional]

View File

@ -0,0 +1,10 @@
# Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **Boolean** | | [optional]

View File

@ -0,0 +1,11 @@
# Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**name** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# ClassModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**propertyClass** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **String** | | [optional]

View File

@ -0,0 +1,27 @@
# EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
**arrayEnum** | [**List&lt;ArrayEnumEnum&gt;**](#List&lt;ArrayEnumEnum&gt;) | | [optional]
<a name="JustSymbolEnum"></a>
## Enum: JustSymbolEnum
Name | Value
---- | -----
GREATER_THAN_OR_EQUAL_TO | &quot;&gt;&#x3D;&quot;
DOLLAR | &quot;$&quot;
<a name="List<ArrayEnumEnum>"></a>
## Enum: List&lt;ArrayEnumEnum&gt;
Name | Value
---- | -----
FISH | &quot;fish&quot;
CRAB | &quot;crab&quot;

View File

@ -0,0 +1,14 @@
# EnumClass
## Enum
* `_ABC` (value: `"_abc"`)
* `_EFG` (value: `"-efg"`)
* `_XYZ_` (value: `"(xyz)"`)

View File

@ -0,0 +1,37 @@
# EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
<a name="EnumStringEnum"></a>
## Enum: EnumStringEnum
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
<a name="EnumIntegerEnum"></a>
## Enum: EnumIntegerEnum
Name | Value
---- | -----
NUMBER_1 | 1
NUMBER_MINUS_1 | -1
<a name="EnumNumberEnum"></a>
## Enum: EnumNumberEnum
Name | Value
---- | -----
NUMBER_1_DOT_1 | 1.1
NUMBER_MINUS_1_DOT_2 | -1.2

View File

@ -0,0 +1,191 @@
# FakeApi
All URIs are relative to **
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters
<a name="testClientModel"></a>
# **testClientModel**
> Client testClientModel(body)
To test \&quot;client\&quot; model
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClientModel(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testClientModel");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FakeApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: http_basic_test
HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
http_basic_test.setUsername("YOUR USERNAME");
http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = B; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None
Float _float = 3.4F; // Float | None
String string = "string_example"; // String | None
byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None
String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None
try {
Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEndpointParameters");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **BigDecimal**| None |
**_double** | **Double**| None |
**patternWithoutDelimiter** | **String**| None |
**_byte** | **byte[]**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Long**| None | [optional]
**_float** | **Float**| None | [optional]
**string** | **String**| None | [optional]
**binary** | **byte[]**| None | [optional]
**date** | **LocalDate**| None | [optional]
**dateTime** | **DateTime**| None | [optional]
**password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional]
### Return type
[**Void**](.md)
### Authorization
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/xml; charset=utf-8application/json; charset=utf-8,
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
<a name="testEnumParameters"></a>
# **testEnumParameters**
> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble)
To test enum parameters
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
List<String> enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List<String> | Form parameter enum test (string array)
String enumFormString = "-efg"; // String | Form parameter enum test (string)
List<String> enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List<String> | Header parameter enum test (string array)
String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
List<String> enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List<String> | Query parameter enum test (string array)
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double)
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
try {
Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEnumParameters");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | [**List&lt;String&gt;**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $]
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumHeaderStringArray** | [**List&lt;String&gt;**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**List&lt;String&gt;**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: */*
- **Accept**: */*

View File

@ -0,0 +1,22 @@
# FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer** | **Integer** | | [optional]
**int32** | **Integer** | | [optional]
**int64** | **Long** | | [optional]
**number** | [**BigDecimal**](BigDecimal.md) | |
**_float** | **Float** | | [optional]
**_double** | **Double** | | [optional]
**string** | **String** | | [optional]
**_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional]
**date** | [**LocalDate**](LocalDate.md) | |
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**uuid** | **String** | | [optional]
**password** | **String** | |

View File

@ -0,0 +1,11 @@
# HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional]
**foo** | **String** | | [optional]

View File

@ -0,0 +1,19 @@
# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapMapOfString** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]
**mapOfEnumString** | [**Map&lt;String, InnerEnum&gt;**](#Map&lt;String, InnerEnum&gt;) | | [optional]
<a name="Map<String, InnerEnum>"></a>
## Enum: Map&lt;String, InnerEnum&gt;
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;

View File

@ -0,0 +1,12 @@
# MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **String** | | [optional]
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -0,0 +1,11 @@
# Model200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
**propertyClass** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# ModelApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# ModelReturn
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_return** | **Integer** | | [optional]

View File

@ -0,0 +1,13 @@
# Name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | |
**snakeCase** | **Integer** | | [optional]
**property** | **String** | | [optional]
**_123Number** | **Integer** | | [optional]

View File

@ -0,0 +1,10 @@
# NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]

View File

@ -0,0 +1,24 @@
# Order
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**petId** | **Long** | | [optional]
**quantity** | **Integer** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
**complete** | **Boolean** | | [optional]
<a name="StatusEnum"></a>
## Enum: StatusEnum
Name | Value
---- | -----
PLACED | &quot;placed&quot;
APPROVED | &quot;approved&quot;
DELIVERED | &quot;delivered&quot;

View File

@ -0,0 +1,14 @@
# OuterEnum
## Enum
* `PLACED` (value: `"placed"`)
* `APPROVED` (value: `"approved"`)
* `DELIVERED` (value: `"delivered"`)

View File

@ -0,0 +1,24 @@
# Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **List&lt;String&gt;** | |
**tags** | [**List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
<a name="StatusEnum"></a>
## Enum: StatusEnum
Name | Value
---- | -----
AVAILABLE | &quot;available&quot;
PENDING | &quot;pending&quot;
SOLD | &quot;sold&quot;

View File

@ -0,0 +1,452 @@
# PetApi
All URIs are relative to **
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](PetApi.md#addPet) | **POST** pet | Add a new pet to the store
[**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID
[**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image
<a name="addPet"></a>
# **addPet**
> Void addPet(body)
Add a new pet to the store
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
try {
Void result = apiInstance.addPet(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#addPet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
[**Void**](.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="deletePet"></a>
# **deletePet**
> Void deletePet(petId, apiKey)
Deletes a pet
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
Long petId = 789L; // Long | Pet id to delete
String apiKey = "apiKey_example"; // String |
try {
Void result = apiInstance.deletePet(petId, apiKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#deletePet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| Pet id to delete |
**apiKey** | **String**| | [optional]
### Return type
[**Void**](.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
> List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
List<String> status = Arrays.asList("status_example"); // List<String> | Status values that need to be considered for filter
try {
List<Pet> result = apiInstance.findPetsByStatus(status);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#findPetsByStatus");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List&lt;String&gt;**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="findPetsByTags"></a>
# **findPetsByTags**
> List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
List<String> tags = Arrays.asList("tags_example"); // List<String> | Tags to filter by
try {
List<Pet> result = apiInstance.findPetsByTags(tags);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#findPetsByTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by |
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="getPetById"></a>
# **getPetById**
> Pet getPetById(petId)
Find pet by ID
Returns a single pet
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
PetApi apiInstance = new PetApi();
Long petId = 789L; // Long | ID of pet to return
try {
Pet result = apiInstance.getPetById(petId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#getPetById");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to return |
### Return type
[**Pet**](Pet.md)
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="updatePet"></a>
# **updatePet**
> Void updatePet(body)
Update an existing pet
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
try {
Void result = apiInstance.updatePet(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#updatePet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
[**Void**](.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="updatePetWithForm"></a>
# **updatePetWithForm**
> Void updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
Long petId = 789L; // Long | ID of pet that needs to be updated
String name = "name_example"; // String | Updated name of the pet
String status = "status_example"; // String | Updated status of the pet
try {
Void result = apiInstance.updatePetWithForm(petId, name, status);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#updatePetWithForm");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]
### Return type
[**Void**](.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/xml, application/json
<a name="uploadFile"></a>
# **uploadFile**
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PetApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: petstore_auth
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi();
Long petId = 789L; // Long | ID of pet to update
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
File file = new File("/path/to/file.txt"); // File | file to upload
try {
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#uploadFile");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **File**| file to upload | [optional]
### Return type
[**ModelApiResponse**](ModelApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json

View File

@ -0,0 +1,11 @@
# ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional]
**baz** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# SpecialModelName
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**specialPropertyName** | **Long** | | [optional]

View File

@ -0,0 +1,198 @@
# StoreApi
All URIs are relative to **
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet
<a name="deleteOrder"></a>
# **deleteOrder**
> Void deleteOrder(orderId)
Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.StoreApi;
StoreApi apiInstance = new StoreApi();
String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
try {
Void result = apiInstance.deleteOrder(orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#deleteOrder");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **String**| ID of the order that needs to be deleted |
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="getInventory"></a>
# **getInventory**
> Map&lt;String, Integer&gt; getInventory()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.StoreApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
StoreApi apiInstance = new StoreApi();
try {
Map<String, Integer> result = apiInstance.getInventory();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#getInventory");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Map&lt;String, Integer&gt;**](Map.md)
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getOrderById"></a>
# **getOrderById**
> Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.StoreApi;
StoreApi apiInstance = new StoreApi();
Long orderId = 789L; // Long | ID of pet that needs to be fetched
try {
Order result = apiInstance.getOrderById(orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#getOrderById");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **Long**| ID of pet that needs to be fetched |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="placeOrder"></a>
# **placeOrder**
> Order placeOrder(body)
Place an order for a pet
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.StoreApi;
StoreApi apiInstance = new StoreApi();
Order body = new Order(); // Order | order placed for purchasing the pet
try {
Order result = apiInstance.placeOrder(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#placeOrder");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json

View File

@ -0,0 +1,11 @@
# Tag
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**name** | **String** | | [optional]

View File

@ -0,0 +1,17 @@
# User
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**username** | **String** | | [optional]
**firstName** | **String** | | [optional]
**lastName** | **String** | | [optional]
**email** | **String** | | [optional]
**password** | **String** | | [optional]
**phone** | **String** | | [optional]
**userStatus** | **Integer** | User Status | [optional]

View File

@ -0,0 +1,376 @@
# UserApi
All URIs are relative to **
Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UserApi.md#createUser) | **POST** user | Create user
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** user/createWithArray | Creates list of users with given input array
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** user/createWithList | Creates list of users with given input array
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{username} | Delete user
[**getUserByName**](UserApi.md#getUserByName) | **GET** user/{username} | Get user by user name
[**loginUser**](UserApi.md#loginUser) | **GET** user/login | Logs user into the system
[**logoutUser**](UserApi.md#logoutUser) | **GET** user/logout | Logs out current logged in user session
[**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user
<a name="createUser"></a>
# **createUser**
> Void createUser(body)
Create user
This can only be done by the logged in user.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
User body = new User(); // User | Created user object
try {
Void result = apiInstance.createUser(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object |
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput**
> Void createUsersWithArrayInput(body)
Creates list of users with given input array
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
List<User> body = Arrays.asList(new User()); // List<User> | List of user object
try {
Void result = apiInstance.createUsersWithArrayInput(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="createUsersWithListInput"></a>
# **createUsersWithListInput**
> Void createUsersWithListInput(body)
Creates list of users with given input array
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
List<User> body = Arrays.asList(new User()); // List<User> | List of user object
try {
Void result = apiInstance.createUsersWithListInput(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUsersWithListInput");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="deleteUser"></a>
# **deleteUser**
> Void deleteUser(username)
Delete user
This can only be done by the logged in user.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
String username = "username_example"; // String | The name that needs to be deleted
try {
Void result = apiInstance.deleteUser(username);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#deleteUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be deleted |
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="getUserByName"></a>
# **getUserByName**
> User getUserByName(username)
Get user by user name
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
try {
User result = apiInstance.getUserByName(username);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#getUserByName");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
### Return type
[**User**](User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="loginUser"></a>
# **loginUser**
> String loginUser(username, password)
Logs user into the system
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
String username = "username_example"; // String | The user name for login
String password = "password_example"; // String | The password for login in clear text
try {
String result = apiInstance.loginUser(username, password);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#loginUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The user name for login |
**password** | **String**| The password for login in clear text |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="logoutUser"></a>
# **logoutUser**
> Void logoutUser()
Logs out current logged in user session
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
try {
Void result = apiInstance.logoutUser();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#logoutUser");
e.printStackTrace();
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="updateUser"></a>
# **updateUser**
> Void updateUser(username, body)
Updated user
This can only be done by the logged in user.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.UserApi;
UserApi apiInstance = new UserApi();
String username = "username_example"; // String | name that need to be deleted
User body = new User(); // User | Updated user object
try {
Void result = apiInstance.updateUser(username, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#updateUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object |
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -0,0 +1,2 @@
# Uncomment to build for Android
#target = android

View File

@ -0,0 +1,6 @@
#Tue May 17 23:08:05 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip

View File

@ -0,0 +1,160 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

View File

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,190 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<packaging>jar</packaging>
<name>swagger-java-client</name>
<version>1.0.0</version>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- attach test jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>add_sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add_test_sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-scalars</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
<artifactId>org.apache.oltu.oauth2.client</artifactId>
<version>${oltu-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>${retrofit-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-java-ws_2.10</artifactId>
<version>2.4.6</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.9</swagger-core-version>
<retrofit-version>2.1.0</retrofit-version>
<jackson-version>2.7.5</jackson-version>
<jodatime-version>2.9.4</jodatime-version>
<oltu-version>1.0.1</oltu-version>
<junit-version>4.12</junit-version>
</properties>
</project>

View File

@ -0,0 +1 @@
rootProject.name = "swagger-java-client"

View File

@ -0,0 +1,3 @@
<manifest package="io.swagger.client" xmlns:android="http://schemas.android.com/apk/res/android">
<application />
</manifest>

View File

@ -0,0 +1,136 @@
package io.swagger.client;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.*;
import retrofit2.Retrofit;
import retrofit2.converter.scalars.ScalarsConverterFactory;
import retrofit2.converter.jackson.JacksonConverterFactory;
import play.libs.Json;
import play.libs.ws.WSClient;
import io.swagger.client.Play24CallAdapterFactory;
import io.swagger.client.Play24CallFactory;
import okhttp3.Interceptor;
import io.swagger.client.auth.ApiKeyAuth;
import io.swagger.client.auth.Authentication;
/**
* API client
*/
public class ApiClient {
/** Underlying HTTP-client */
private WSClient wsClient;
/** Supported auths */
private Map<String, Authentication> authentications;
/** API base path */
private String basePath = "http://petstore.swagger.io/v2";
public ApiClient(WSClient wsClient) {
this();
this.wsClient = wsClient;
}
public ApiClient() {
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<>();
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
// authentications.put("http_basic_test", new HttpBasicAuth());
// authentications.put("petstore_auth", new OAuth());
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
/**
* Creates a retrofit2 client for given API interface
*/
public <S> S createService(Class<S> serviceClass) {
if(!basePath.endsWith("/")) {
basePath = basePath + "/";
}
Map<String, String> extraHeaders = new HashMap<>();
List<Pair> extraQueryParams = new ArrayList<>();
for (String authName : authentications.keySet()) {
Authentication auth = authentications.get(authName);
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
auth.applyToParams(extraQueryParams, extraHeaders);
}
return new Retrofit.Builder()
.baseUrl(basePath)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(JacksonConverterFactory.create(Json.mapper()))
.callFactory(new Play24CallFactory(wsClient, extraHeaders, extraQueryParams))
.addCallAdapterFactory(new Play24CallAdapterFactory())
.build()
.create(serviceClass);
}
/**
* Helper method to set API base path
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
return this;
}
/**
* Get authentications (key: authentication name, value: authentication).
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
}
/**
* Get authentication for the given name.
*
* @param authName The authentication name
* @return The authentication, null if not found
*/
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
/**
* Helper method to set API key value for the first API key authentication.
*/
public ApiClient setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set API key prefix for the first API key authentication.
*/
public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
}

View File

@ -0,0 +1,95 @@
package io.swagger.client;
import java.util.Arrays;
import java.util.List;
public class CollectionFormats {
public static class CSVParams {
protected List<String> params;
public CSVParams() {
}
public CSVParams(List<String> params) {
this.params = params;
}
public CSVParams(String... params) {
this.params = Arrays.asList(params);
}
public List<String> getParams() {
return params;
}
public void setParams(List<String> params) {
this.params = params;
}
@Override
public String toString() {
return StringUtil.join(params.toArray(new String[0]), ",");
}
}
public static class SSVParams extends CSVParams {
public SSVParams() {
}
public SSVParams(List<String> params) {
super(params);
}
public SSVParams(String... params) {
super(params);
}
@Override
public String toString() {
return StringUtil.join(params.toArray(new String[0]), " ");
}
}
public static class TSVParams extends CSVParams {
public TSVParams() {
}
public TSVParams(List<String> params) {
super(params);
}
public TSVParams(String... params) {
super(params);
}
@Override
public String toString() {
return StringUtil.join( params.toArray(new String[0]), "\t");
}
}
public static class PIPESParams extends CSVParams {
public PIPESParams() {
}
public PIPESParams(List<String> params) {
super(params);
}
public PIPESParams(String... params) {
super(params);
}
@Override
public String toString() {
return StringUtil.join(params.toArray(new String[0]), "|");
}
}
}

View File

@ -0,0 +1,52 @@
/*
* 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.
*/
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Pair {
private String name = "";
private String value = "";
public Pair (String name, String value) {
setName(name);
setValue(value);
}
private void setName(String name) {
if (!isValidString(name)) return;
this.name = name;
}
private void setValue(String value) {
if (!isValidString(value)) return;
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private boolean isValidString(String arg) {
if (arg == null) return false;
if (arg.trim().isEmpty()) return false;
return true;
}
}

View File

@ -0,0 +1,90 @@
package io.swagger.client;
import play.libs.F;
import retrofit2.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.WildcardType;
/**
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link play.libs.F.Promise}
*/
public class Play24CallAdapterFactory extends CallAdapter.Factory {
@Override
public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
if (!(returnType instanceof ParameterizedType)) {
return null;
}
ParameterizedType type = (ParameterizedType) returnType;
if (type.getRawType() != F.Promise.class) {
return null;
}
return createAdapter((ParameterizedType) returnType);
}
private Type getTypeParam(ParameterizedType type) {
Type[] types = type.getActualTypeArguments();
if (types.length != 1) {
throw new IllegalStateException("Must be exactly one type parameter");
}
Type paramType = types[0];
if (paramType instanceof WildcardType) {
return ((WildcardType) paramType).getUpperBounds()[0];
}
return paramType;
}
private CallAdapter<F.Promise<?>> createAdapter(ParameterizedType returnType) {
Type parameterType = getTypeParam(returnType);
return new ValueAdapter(parameterType);
}
/**
* Adpater that coverts values returned by API interface into Play promises
*/
static final class ValueAdapter implements CallAdapter<F.Promise<?>> {
private final Type responseType;
ValueAdapter(Type responseType) {
this.responseType = responseType;
}
@Override
public Type responseType() {
return responseType;
}
@Override
public <R> F.Promise<R> adapt(final Call<R> call) {
final F.RedeemablePromise<R> promise = F.RedeemablePromise.empty();
call.enqueue(new Callback<R>() {
@Override
public void onResponse(Call<R> call, Response<R> response) {
if (response.isSuccessful()) {
promise.success(response.body());
} else {
promise.failure(new Exception(response.errorBody().toString()));
}
}
@Override
public void onFailure(Call<R> call, Throwable t) {
promise.failure(t);
}
});
return promise;
}
}
}

View File

@ -0,0 +1,210 @@
package io.swagger.client;
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSource;
import play.libs.F;
import play.libs.ws.WSClient;
import play.libs.ws.WSRequest;
import play.libs.ws.WSResponse;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Creates {@link Call} instances that invoke underlying {@link WSClient}
*/
public class Play24CallFactory implements okhttp3.Call.Factory {
/** PlayWS http client */
private final WSClient wsClient;
/** Extra headers to add to request */
private Map<String, String> extraHeaders = new HashMap<>();
/** Extra query parameters to add to request */
private List<Pair> extraQueryParams = new ArrayList<>();
public Play24CallFactory(WSClient wsClient) {
this.wsClient = wsClient;
}
public Play24CallFactory(WSClient wsClient, Map<String, String> extraHeaders,
List<Pair> extraQueryParams) {
this.wsClient = wsClient;
this.extraHeaders.putAll(extraHeaders);
this.extraQueryParams.addAll(extraQueryParams);
}
@Override
public Call newCall(Request request) {
// add extra headers
Request.Builder rb = request.newBuilder();
for (Map.Entry<String, String> header : this.extraHeaders.entrySet()) {
rb.addHeader(header.getKey(), header.getValue());
}
// add extra query params
if (!this.extraQueryParams.isEmpty()) {
String newQuery = request.url().uri().getQuery();
for (Pair queryParam : this.extraQueryParams) {
String param = String.format("%s=%s", queryParam.getName(), queryParam.getValue());
if (newQuery == null) {
newQuery = param;
} else {
newQuery += "&" + param;
}
}
URI newUri;
try {
newUri = new URI(request.url().uri().getScheme(), request.url().uri().getAuthority(),
request.url().uri().getPath(), newQuery, request.url().uri().getFragment());
rb.url(newUri.toURL());
} catch (MalformedURLException | URISyntaxException e) {
throw new RuntimeException("Error while updating an url", e);
}
}
return new PlayWSCall(wsClient, rb.build());
}
/**
* Call implementation that delegates to Play WS Client
*/
static class PlayWSCall implements Call {
private final WSClient wsClient;
private WSRequest wsRequest;
private final Request request;
public PlayWSCall(WSClient wsClient, Request request) {
this.wsClient = wsClient;
this.request = request;
}
@Override
public Request request() {
return request;
}
@Override
public void enqueue(final okhttp3.Callback responseCallback) {
final Call call = this;
final F.Promise<WSResponse> promise = executeAsync();
promise.onRedeem(new F.Callback<WSResponse>() {
@Override
public void invoke(WSResponse wsResponse) throws Throwable {
responseCallback.onResponse(call, PlayWSCall.this.toWSResponse(wsResponse));
}
});
promise.onFailure(new F.Callback<Throwable>() {
@Override
public void invoke(Throwable throwable) throws Throwable {
if (throwable instanceof IOException) {
responseCallback.onFailure(call, (IOException) throwable);
} else {
responseCallback.onFailure(call, new IOException(throwable));
}
}
});
}
F.Promise<WSResponse> executeAsync() {
try {
wsRequest = wsClient.url(request.url().uri().toString());
addHeaders(wsRequest);
if (request.body() != null) {
addBody(wsRequest);
}
return wsRequest.execute(request.method());
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
private void addHeaders(WSRequest wsRequest) {
for(Map.Entry<String, List<String>> entry : request.headers().toMultimap().entrySet()) {
List<String> values = entry.getValue();
for (String value : values) {
wsRequest.setHeader(entry.getKey(), value);
}
}
}
private void addBody(WSRequest wsRequest) throws IOException {
Buffer buffer = new Buffer();
request.body().writeTo(buffer);
wsRequest.setBody(buffer.inputStream());
wsRequest.setContentType(request.body().contentType().toString());
}
private Response toWSResponse(final WSResponse r) {
final Response.Builder builder = new Response.Builder();
builder.request(request)
.code(r.getStatus())
.body(new ResponseBody() {
@Override
public MediaType contentType() {
return MediaType.parse(r.getHeader("Content-Type"));
}
@Override
public long contentLength() {
return r.getBody().getBytes().length;
}
@Override
public BufferedSource source() {
return new Buffer().write(r.getBody().getBytes());
}
});
for (Map.Entry<String, List<String>> entry : r.getAllHeaders().entrySet()) {
for (String value : entry.getValue()) {
builder.addHeader(entry.getKey(), value);
}
}
builder.protocol(Protocol.HTTP_1_1);
return builder.build();
}
@Override
public Response execute() throws IOException {
throw new UnsupportedOperationException("Not supported");
}
@Override
public void cancel() {
throw new UnsupportedOperationException("Not supported");
}
@Override
public boolean isExecuted() {
return false;
}
@Override
public boolean isCanceled() {
return false;
}
}
}

View File

@ -0,0 +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.
*/
package io.swagger.client;
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
import com.fasterxml.jackson.databind.util.ISO8601Utils;
import java.text.FieldPosition;
import java.util.Date;
public class RFC3339DateFormat extends ISO8601DateFormat {
// Same as ISO8601DateFormat but serializing milliseconds.
@Override
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
String value = ISO8601Utils.format(date, true);
toAppendTo.append(value);
return toAppendTo;
}
}

View File

@ -0,0 +1,55 @@
/*
* 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.
*/
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) return true;
if (value != null && value.equalsIgnoreCase(str)) return true;
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) return "";
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
}

View File

@ -0,0 +1,86 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit2.Call;
import retrofit2.http.*;
import okhttp3.RequestBody;
import java.math.BigDecimal;
import io.swagger.client.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import play.libs.F;
import retrofit2.Response;
public interface FakeApi {
/**
* To test \&quot;client\&quot; model
*
* @param body client model (required)
* @return Call&lt;Client&gt;
*/
@Headers({
"Content-Type:application/json"
})
@PATCH("fake")
F.Promise<Response<Client>> testClientModel(
@retrofit2.http.Body Client body
);
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* @param number None (required)
* @param _double None (required)
* @param patternWithoutDelimiter None (required)
* @param _byte None (required)
* @param integer None (optional)
* @param int32 None (optional)
* @param int64 None (optional)
* @param _float None (optional)
* @param string None (optional)
* @param binary None (optional)
* @param date None (optional)
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@POST("fake")
F.Promise<Response<Void>> testEndpointParameters(
@retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") DateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback
);
/**
* To test enum parameters
*
* @param enumFormStringArray Form parameter enum test (string array) (optional)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@GET("fake")
F.Promise<Response<Void>> testEnumParameters(
@retrofit2.http.Field("enum_form_string_array") List<String> enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List<String> enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble
);
}

View File

@ -0,0 +1,133 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit2.Call;
import retrofit2.http.*;
import okhttp3.RequestBody;
import java.io.File;
import io.swagger.client.model.ModelApiResponse;
import io.swagger.client.model.Pet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import play.libs.F;
import retrofit2.Response;
public interface PetApi {
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store (required)
* @return Call&lt;Void&gt;
*/
@Headers({
"Content-Type:application/json"
})
@POST("pet")
F.Promise<Response<Void>> addPet(
@retrofit2.http.Body Pet body
);
/**
* Deletes a pet
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return Call&lt;Void&gt;
*/
@DELETE("pet/{petId}")
F.Promise<Response<Void>> deletePet(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey
);
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return Call&lt;List<Pet>&gt;
*/
@GET("pet/findByStatus")
F.Promise<Response<List<Pet>>> findPetsByStatus(
@retrofit2.http.Query("status") CSVParams status
);
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return Call&lt;List<Pet>&gt;
*/
@GET("pet/findByTags")
F.Promise<Response<List<Pet>>> findPetsByTags(
@retrofit2.http.Query("tags") CSVParams tags
);
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return (required)
* @return Call&lt;Pet&gt;
*/
@GET("pet/{petId}")
F.Promise<Response<Pet>> getPetById(
@retrofit2.http.Path("petId") Long petId
);
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store (required)
* @return Call&lt;Void&gt;
*/
@Headers({
"Content-Type:application/json"
})
@PUT("pet")
F.Promise<Response<Void>> updatePet(
@retrofit2.http.Body Pet body
);
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@POST("pet/{petId}")
F.Promise<Response<Void>> updatePetWithForm(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status
);
/**
* uploads an image
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return Call&lt;ModelApiResponse&gt;
*/
@retrofit2.http.Multipart
@POST("pet/{petId}/uploadImage")
F.Promise<Response<ModelApiResponse>> uploadFile(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file
);
}

View File

@ -0,0 +1,68 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit2.Call;
import retrofit2.http.*;
import okhttp3.RequestBody;
import io.swagger.client.model.Order;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import play.libs.F;
import retrofit2.Response;
public interface StoreApi {
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted (required)
* @return Call&lt;Void&gt;
*/
@DELETE("store/order/{orderId}")
F.Promise<Response<Void>> deleteOrder(
@retrofit2.http.Path("orderId") String orderId
);
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Call&lt;Map<String, Integer>&gt;
*/
@GET("store/inventory")
F.Promise<Response<Map<String, Integer>>> getInventory();
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched (required)
* @return Call&lt;Order&gt;
*/
@GET("store/order/{orderId}")
F.Promise<Response<Order>> getOrderById(
@retrofit2.http.Path("orderId") Long orderId
);
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet (required)
* @return Call&lt;Order&gt;
*/
@POST("store/order")
F.Promise<Response<Order>> placeOrder(
@retrofit2.http.Body Order body
);
}

View File

@ -0,0 +1,118 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit2.Call;
import retrofit2.http.*;
import okhttp3.RequestBody;
import io.swagger.client.model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import play.libs.F;
import retrofit2.Response;
public interface UserApi {
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object (required)
* @return Call&lt;Void&gt;
*/
@POST("user")
F.Promise<Response<Void>> createUser(
@retrofit2.http.Body User body
);
/**
* Creates list of users with given input array
*
* @param body List of user object (required)
* @return Call&lt;Void&gt;
*/
@POST("user/createWithArray")
F.Promise<Response<Void>> createUsersWithArrayInput(
@retrofit2.http.Body List<User> body
);
/**
* Creates list of users with given input array
*
* @param body List of user object (required)
* @return Call&lt;Void&gt;
*/
@POST("user/createWithList")
F.Promise<Response<Void>> createUsersWithListInput(
@retrofit2.http.Body List<User> body
);
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted (required)
* @return Call&lt;Void&gt;
*/
@DELETE("user/{username}")
F.Promise<Response<Void>> deleteUser(
@retrofit2.http.Path("username") String username
);
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return Call&lt;User&gt;
*/
@GET("user/{username}")
F.Promise<Response<User>> getUserByName(
@retrofit2.http.Path("username") String username
);
/**
* Logs user into the system
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @return Call&lt;String&gt;
*/
@GET("user/login")
F.Promise<Response<String>> loginUser(
@retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password
);
/**
* Logs out current logged in user session
*
* @return Call&lt;Void&gt;
*/
@GET("user/logout")
F.Promise<Response<Void>> logoutUser();
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @return Call&lt;Void&gt;
*/
@PUT("user/{username}")
F.Promise<Response<Void>> updateUser(
@retrofit2.http.Path("username") String username, @retrofit2.http.Body User body
);
}

View File

@ -0,0 +1,78 @@
/*
* 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.
*/
package io.swagger.client.auth;
import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
/**
* Holds ApiKey auth info
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
}
}
}

View File

@ -0,0 +1,29 @@
/*
* 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.
*/
package io.swagger.client.auth;
import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
}

View File

@ -0,0 +1,126 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.*;
/**
* AdditionalPropertiesClass
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class AdditionalPropertiesClass {
@JsonProperty("map_property")
private Map<String, String> mapProperty = new HashMap<String, String>();
@JsonProperty("map_of_map_property")
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
return this;
}
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
this.mapProperty.put(key, mapPropertyItem);
return this;
}
/**
* Get mapProperty
* @return mapProperty
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, String> getMapProperty() {
return mapProperty;
}
public void setMapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
}
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
return this;
}
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
return this;
}
/**
* Get mapOfMapProperty
* @return mapOfMapProperty
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Map<String, String>> getMapOfMapProperty() {
return mapOfMapProperty;
}
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
}
@Override
public int hashCode() {
return Objects.hash(mapProperty, mapOfMapProperty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).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 ");
}
}

View File

@ -0,0 +1,119 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Animal
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className" )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
public class Animal {
@JsonProperty("className")
private String className = null;
@JsonProperty("color")
private String color = "red";
public Animal className(String className) {
this.className = className;
return this;
}
/**
* Get className
* @return className
**/
@NotNull
@ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Animal animal = (Animal) o;
return Objects.equals(this.className, animal.className) &&
Objects.equals(this.color, animal.color);
}
@Override
public int hashCode() {
return Objects.hash(className, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Animal {\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).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 ");
}
}

View File

@ -0,0 +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.
*/
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
/**
* AnimalFarm
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).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 ");
}
}

View File

@ -0,0 +1,98 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
/**
* ArrayOfArrayOfNumberOnly
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
return this;
}
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
this.arrayArrayNumber.add(arrayArrayNumberItem);
return this;
}
/**
* Get arrayArrayNumber
* @return arrayArrayNumber
**/
@ApiModelProperty(example = "null", value = "")
public List<List<BigDecimal>> getArrayArrayNumber() {
return arrayArrayNumber;
}
public void setArrayArrayNumber(List<List<BigDecimal>> 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 ");
}
}

View File

@ -0,0 +1,98 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
/**
* ArrayOfNumberOnly
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
return this;
}
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
this.arrayNumber.add(arrayNumberItem);
return this;
}
/**
* Get arrayNumber
* @return arrayNumber
**/
@ApiModelProperty(example = "null", value = "")
public List<BigDecimal> getArrayNumber() {
return arrayNumber;
}
public void setArrayNumber(List<BigDecimal> 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 ");
}
}

View File

@ -0,0 +1,154 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
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 javax.validation.constraints.*;
/**
* ArrayTest
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ArrayTest {
@JsonProperty("array_of_string")
private List<String> arrayOfString = new ArrayList<String>();
@JsonProperty("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
@JsonProperty("array_array_of_model")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
return this;
}
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
this.arrayOfString.add(arrayOfStringItem);
return this;
}
/**
* Get arrayOfString
* @return arrayOfString
**/
@ApiModelProperty(example = "null", value = "")
public List<String> getArrayOfString() {
return arrayOfString;
}
public void setArrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
}
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return this;
}
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
return this;
}
/**
* Get arrayArrayOfInteger
* @return arrayArrayOfInteger
**/
@ApiModelProperty(example = "null", value = "")
public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return this;
}
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
return this;
}
/**
* Get arrayArrayOfModel
* @return arrayArrayOfModel
**/
@ApiModelProperty(example = "null", value = "")
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
}
@Override
public int hashCode() {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayTest {\n");
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("}");
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 ");
}
}

View File

@ -0,0 +1,92 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
import javax.validation.constraints.*;
/**
* Cat
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Cat extends Animal {
@JsonProperty("declawed")
private Boolean declawed = null;
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Cat cat = (Cat) o;
return Objects.equals(this.declawed, cat.declawed) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(declawed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Cat {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" declawed: ").append(toIndentedString(declawed)).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 ");
}
}

View File

@ -0,0 +1,113 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Category
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Category {
@JsonProperty("id")
private Long id = null;
@JsonProperty("name")
private String name = null;
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;
}
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).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 ");
}
}

View File

@ -0,0 +1,91 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Model for testing model with \&quot;_class\&quot; property
*/
@ApiModel(description = "Model for testing model with \"_class\" property")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ClassModel {
@JsonProperty("_class")
private String propertyClass = null;
public ClassModel 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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClassModel classModel = (ClassModel) o;
return Objects.equals(this.propertyClass, classModel.propertyClass);
}
@Override
public int hashCode() {
return Objects.hash(propertyClass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ClassModel {\n");
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 ");
}
}

View File

@ -0,0 +1,90 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Client
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Client {
@JsonProperty("client")
private String client = null;
public Client client(String client) {
this.client = client;
return this;
}
/**
* Get client
* @return client
**/
@ApiModelProperty(example = "null", value = "")
public String getClient() {
return client;
}
public void setClient(String client) {
this.client = client;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Client client = (Client) o;
return Objects.equals(this.client, client.client);
}
@Override
public int hashCode() {
return Objects.hash(client);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Client {\n");
sb.append(" client: ").append(toIndentedString(client)).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 ");
}
}

View File

@ -0,0 +1,92 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
import javax.validation.constraints.*;
/**
* Dog
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Dog extends Animal {
@JsonProperty("breed")
private String breed = null;
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Dog dog = (Dog) o;
return Objects.equals(this.breed, dog.breed) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(breed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Dog {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" breed: ").append(toIndentedString(breed)).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 ");
}
}

View File

@ -0,0 +1,180 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
/**
* EnumArrays
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class EnumArrays {
/**
* Gets or Sets justSymbol
*/
public enum JustSymbolEnum {
GREATER_THAN_OR_EQUAL_TO(">="),
DOLLAR("$");
private String value;
JustSymbolEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static JustSymbolEnum fromValue(String text) {
for (JustSymbolEnum b : JustSymbolEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("just_symbol")
private JustSymbolEnum justSymbol = null;
/**
* Gets or Sets arrayEnum
*/
public enum ArrayEnumEnum {
FISH("fish"),
CRAB("crab");
private String value;
ArrayEnumEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ArrayEnumEnum fromValue(String text) {
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("array_enum")
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
return this;
}
/**
* Get justSymbol
* @return justSymbol
**/
@ApiModelProperty(example = "null", value = "")
public JustSymbolEnum getJustSymbol() {
return justSymbol;
}
public void setJustSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
}
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
return this;
}
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
this.arrayEnum.add(arrayEnumItem);
return this;
}
/**
* Get arrayEnum
* @return arrayEnum
**/
@ApiModelProperty(example = "null", value = "")
public List<ArrayEnumEnum> getArrayEnum() {
return arrayEnum;
}
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EnumArrays enumArrays = (EnumArrays) o;
return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
}
@Override
public int hashCode() {
return Objects.hash(justSymbol, arrayEnum);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumArrays {\n");
sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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 ");
}
}

View File

@ -0,0 +1,53 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Gets or Sets EnumClass
*/
public enum EnumClass {
_ABC("_abc"),
_EFG("-efg"),
_XYZ_("(xyz)");
private String value;
EnumClass(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EnumClass fromValue(String text) {
for (EnumClass b : EnumClass.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}

View File

@ -0,0 +1,250 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.OuterEnum;
import javax.validation.constraints.*;
/**
* EnumTest
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class EnumTest {
/**
* Gets or Sets enumString
*/
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
private String value;
EnumStringEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EnumStringEnum fromValue(String text) {
for (EnumStringEnum b : EnumStringEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("enum_string")
private EnumStringEnum enumString = null;
/**
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_MINUS_1(-1);
private Integer value;
EnumIntegerEnum(Integer value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EnumIntegerEnum fromValue(String text) {
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("enum_integer")
private EnumIntegerEnum enumInteger = null;
/**
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_MINUS_1_DOT_2(-1.2);
private Double value;
EnumNumberEnum(Double value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EnumNumberEnum fromValue(String text) {
for (EnumNumberEnum b : EnumNumberEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("enum_number")
private EnumNumberEnum enumNumber = null;
@JsonProperty("outerEnum")
private OuterEnum outerEnum = null;
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;
}
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;
}
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;
}
public EnumTest outerEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
return this;
}
/**
* Get outerEnum
* @return outerEnum
**/
@ApiModelProperty(example = "null", value = "")
public OuterEnum getOuterEnum() {
return outerEnum;
}
public void setOuterEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EnumTest enumTest = (EnumTest) o;
return Objects.equals(this.enumString, enumTest.enumString) &&
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
Objects.equals(this.enumNumber, enumTest.enumNumber) &&
Objects.equals(this.outerEnum, enumTest.outerEnum);
}
@Override
public int hashCode() {
return Objects.hash(enumString, enumInteger, enumNumber, outerEnum);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumTest {\n");
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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 ");
}
}

View File

@ -0,0 +1,395 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
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 javax.validation.constraints.*;
/**
* FormatTest
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class FormatTest {
@JsonProperty("integer")
private Integer integer = null;
@JsonProperty("int32")
private Integer int32 = null;
@JsonProperty("int64")
private Long int64 = null;
@JsonProperty("number")
private BigDecimal number = null;
@JsonProperty("float")
private Float _float = null;
@JsonProperty("double")
private Double _double = null;
@JsonProperty("string")
private String string = null;
@JsonProperty("byte")
private byte[] _byte = null;
@JsonProperty("binary")
private byte[] binary = null;
@JsonProperty("date")
private LocalDate date = null;
@JsonProperty("dateTime")
private DateTime dateTime = null;
@JsonProperty("uuid")
private String uuid = null;
@JsonProperty("password")
private String password = null;
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
}
/**
* Get integer
* minimum: 10.0
* maximum: 100.0
* @return integer
**/
//@Min(10.0)
//@Max(100.0)
@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
* @return int32
**/
//@Min(20.0)
//@Max(200.0)
@ApiModelProperty(example = "null", value = "")
public Integer getInt32() {
return int32;
}
public void setInt32(Integer int32) {
this.int32 = int32;
}
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
* @return number
**/
@NotNull
//@Min(32.1)
//@Max(543.2)
@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
* @return _float
**/
//@Min(54.3)
//@Max(987.6)
@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
* @return _double
**/
//@Min(67.8)
//@Max(123.4)
@ApiModelProperty(example = "null", value = "")
public Double getDouble() {
return _double;
}
public void setDouble(Double _double) {
this._double = _double;
}
public FormatTest string(String string) {
this.string = string;
return this;
}
/**
* Get string
* @return string
**/
@Pattern(regexp="/[a-z]/i")
@ApiModelProperty(example = "null", value = "")
public String getString() {
return string;
}
public void setString(String string) {
this.string = string;
}
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
/**
* Get _byte
* @return _byte
**/
@NotNull
@ApiModelProperty(example = "null", required = true, value = "")
public byte[] getByte() {
return _byte;
}
public void setByte(byte[] _byte) {
this._byte = _byte;
}
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;
}
public FormatTest date(LocalDate date) {
this.date = date;
return this;
}
/**
* Get date
* @return date
**/
@NotNull
@ApiModelProperty(example = "null", required = true, value = "")
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
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;
}
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;
}
public FormatTest password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@NotNull
@Size(min=10,max=64)
@ApiModelProperty(example = "null", required = true, value = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FormatTest formatTest = (FormatTest) o;
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
public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FormatTest {\n");
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
sb.append(" string: ").append(toIndentedString(string)).append("\n");
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).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 ");
}
}

View File

@ -0,0 +1,95 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* HasOnlyReadOnly
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class HasOnlyReadOnly {
@JsonProperty("bar")
private String bar = null;
@JsonProperty("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 ");
}
}

View File

@ -0,0 +1,156 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.*;
/**
* MapTest
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class MapTest {
@JsonProperty("map_map_of_string")
private Map<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();
/**
* Gets or Sets inner
*/
public enum InnerEnum {
UPPER("UPPER"),
LOWER("lower");
private String value;
InnerEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static InnerEnum fromValue(String text) {
for (InnerEnum b : InnerEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
}
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
/**
* Get mapMapOfString
* @return mapMapOfString
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Map<String, String>> getMapMapOfString() {
return mapMapOfString;
}
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
}
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
return this;
}
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
/**
* Get mapOfEnumString
* @return mapOfEnumString
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, InnerEnum> getMapOfEnumString() {
return mapOfEnumString;
}
public void setMapOfEnumString(Map<String, InnerEnum> 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 ");
}
}

View File

@ -0,0 +1,146 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.joda.time.DateTime;
import javax.validation.constraints.*;
/**
* MixedPropertiesAndAdditionalPropertiesClass
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("uuid")
private String uuid = null;
@JsonProperty("dateTime")
private DateTime dateTime = null;
@JsonProperty("map")
private Map<String, Animal> map = new HashMap<String, Animal>();
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;
}
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;
}
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
this.map = map;
return this;
}
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
this.map.put(key, mapItem);
return this;
}
/**
* Get map
* @return map
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Animal> getMap() {
return map;
}
public void setMap(Map<String, Animal> map) {
this.map = map;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
}
@Override
public int hashCode() {
return Objects.hash(uuid, dateTime, map);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" map: ").append(toIndentedString(map)).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 ");
}
}

View File

@ -0,0 +1,114 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Model for testing model name starting with number
*/
@ApiModel(description = "Model for testing model name starting with number")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Model200Response {
@JsonProperty("name")
private Integer name = null;
@JsonProperty("class")
private String propertyClass = null;
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;
}
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(this.name, _200Response.name) &&
Objects.equals(this.propertyClass, _200Response.propertyClass);
}
@Override
public int hashCode() {
return Objects.hash(name, propertyClass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 ");
}
}

View File

@ -0,0 +1,136 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* ModelApiResponse
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@JsonProperty("type")
private String type = null;
@JsonProperty("message")
private String message = null;
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;
}
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;
}
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
}
@Override
public int hashCode() {
return Objects.hash(code, type, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
}

View File

@ -0,0 +1,91 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Model for testing reserved words
*/
@ApiModel(description = "Model for testing reserved words")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ModelReturn {
@JsonProperty("return")
private Integer _return = null;
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(this._return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).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 ");
}
}

View File

@ -0,0 +1,143 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Model for testing model name same as property name
*/
@ApiModel(description = "Model for testing model name same as property name")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Name {
@JsonProperty("name")
private Integer name = null;
@JsonProperty("snake_case")
private Integer snakeCase = null;
@JsonProperty("property")
private String property = null;
@JsonProperty("123Number")
private Integer _123Number = null;
public Name name(Integer name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@NotNull
@ApiModelProperty(example = "null", required = true, value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
/**
* Get snakeCase
* @return snakeCase
**/
@ApiModelProperty(example = "null", value = "")
public Integer getSnakeCase() {
return snakeCase;
}
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;
}
/**
* Get _123Number
* @return _123Number
**/
@ApiModelProperty(example = "null", value = "")
public Integer get123Number() {
return _123Number;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
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
public int hashCode() {
return Objects.hash(name, snakeCase, property, _123Number);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append(" _123Number: ").append(toIndentedString(_123Number)).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 ");
}
}

View File

@ -0,0 +1,91 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.constraints.*;
/**
* NumberOnly
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class NumberOnly {
@JsonProperty("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 ");
}
}

View File

@ -0,0 +1,238 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import javax.validation.constraints.*;
/**
* Order
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Order {
@JsonProperty("id")
private Long id = null;
@JsonProperty("petId")
private Long petId = null;
@JsonProperty("quantity")
private Integer quantity = null;
@JsonProperty("shipDate")
private DateTime shipDate = null;
/**
* Order Status
*/
public enum StatusEnum {
PLACED("placed"),
APPROVED("approved"),
DELIVERED("delivered");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("status")
private StatusEnum status = null;
@JsonProperty("complete")
private Boolean complete = false;
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;
}
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;
}
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;
}
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
* @return status
**/
@ApiModelProperty(example = "null", value = "Order Status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
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
public int hashCode() {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).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 ");
}
}

View File

@ -0,0 +1,53 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Gets or Sets OuterEnum
*/
public enum OuterEnum {
PLACED("placed"),
APPROVED("approved"),
DELIVERED("delivered");
private String value;
OuterEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static OuterEnum fromValue(String text) {
for (OuterEnum b : OuterEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}

View File

@ -0,0 +1,253 @@
/*
* 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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Category;
import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
/**
* Pet
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class Pet {
@JsonProperty("id")
private Long id = null;
@JsonProperty("category")
private Category category = null;
@JsonProperty("name")
private String name = null;
@JsonProperty("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
@JsonProperty("tags")
private List<Tag> tags = new ArrayList<Tag>();
/**
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
PENDING("pending"),
SOLD("sold");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("status")
private StatusEnum status = null;
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;
}
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;
}
public Pet name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@NotNull
@ApiModelProperty(example = "doggie", required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
return this;
}
/**
* Get photoUrls
* @return photoUrls
**/
@NotNull
@ApiModelProperty(example = "null", required = true, value = "")
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
public Pet addTagsItem(Tag tagsItem) {
this.tags.add(tagsItem);
return this;
}
/**
* Get tags
* @return tags
**/
@ApiModelProperty(example = "null", value = "")
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
/**
* 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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Pet pet = (Pet) o;
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
public int hashCode() {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).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 ");
}
}

View File

@ -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.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* ReadOnlyFirst
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-12-09T01:19:10.790+04:00")
public class ReadOnlyFirst {
@JsonProperty("bar")
private String bar = null;
@JsonProperty("baz")
private String baz = null;
/**
* Get bar
* @return bar
**/
@ApiModelProperty(example = "null", value = "")
public String getBar() {
return bar;
}
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(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
return Objects.equals(this.bar, readOnlyFirst.bar) &&
Objects.equals(this.baz, readOnlyFirst.baz);
}
@Override
public int hashCode() {
return Objects.hash(bar, baz);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReadOnlyFirst {\n");
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
sb.append(" baz: ").append(toIndentedString(baz)).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 ");
}
}

Some files were not shown because too many files have changed in this diff Show More