forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
commit
a839a6803f
1
.gitignore
vendored
1
.gitignore
vendored
@ -53,6 +53,7 @@ samples/client/petstore/qt5cpp/PetStore/*.o
|
|||||||
samples/client/petstore/qt5cpp/build-*
|
samples/client/petstore/qt5cpp/build-*
|
||||||
samples/client/petstore/qt5cpp/PetStore/PetStore
|
samples/client/petstore/qt5cpp/PetStore/PetStore
|
||||||
samples/client/petstore/qt5cpp/PetStore/Makefile
|
samples/client/petstore/qt5cpp/PetStore/Makefile
|
||||||
|
samples/client/petstore/qt5cpp/PetStore/PetStore.pro.user
|
||||||
|
|
||||||
#Java/Android
|
#Java/Android
|
||||||
**/.gradle
|
**/.gradle
|
||||||
|
34
bin/java-petstore-jersey2-java6.sh
Executable file
34
bin/java-petstore-jersey2-java6.sh
Executable 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-jersey2.json -o samples/client/petstore/java/jersey2-java6 -DhideGenerationTimestamp=true,supportJava6=true"
|
||||||
|
|
||||||
|
echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main"
|
||||||
|
rm -rf samples/client/petstore/java/jersey2-java6/src/main
|
||||||
|
find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
@ -183,7 +183,12 @@ public class Qt5CPPGenerator extends DefaultCodegen implements CodegenConfig {
|
|||||||
} else if (systemIncludes.contains(name)) {
|
} else if (systemIncludes.contains(name)) {
|
||||||
return "#include <" + name + ">";
|
return "#include <" + name + ">";
|
||||||
}
|
}
|
||||||
return "#include \"" + name + ".h\"";
|
|
||||||
|
String folder = modelPackage().replace("::", File.separator);
|
||||||
|
if (!folder.isEmpty())
|
||||||
|
folder += File.separator;
|
||||||
|
|
||||||
|
return "#include \"" + folder + name + ".h\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -203,7 +208,7 @@ public class Qt5CPPGenerator extends DefaultCodegen implements CodegenConfig {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String modelFileFolder() {
|
public String modelFileFolder() {
|
||||||
return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar);
|
return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace("::", File.separator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -212,7 +217,7 @@ public class Qt5CPPGenerator extends DefaultCodegen implements CodegenConfig {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar);
|
return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace("::", File.separator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,6 +111,10 @@ ext {
|
|||||||
{{^java8}}
|
{{^java8}}
|
||||||
jodatime_version = "2.9.4"
|
jodatime_version = "2.9.4"
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
|
{{#supportJava6}}
|
||||||
|
commons_io_version=2.5
|
||||||
|
commons_lang3_version=3.5
|
||||||
|
{{/supportJava6}}
|
||||||
junit_version = "4.12"
|
junit_version = "4.12"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,6 +133,10 @@ dependencies {
|
|||||||
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
|
||||||
compile "joda-time:joda-time:$jodatime_version"
|
compile "joda-time:joda-time:$jodatime_version"
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
|
{{#supportJava6}}
|
||||||
|
compile "commons-io:commons-io:$commons_io_version"
|
||||||
|
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
|
||||||
|
{{/supportJava6}}
|
||||||
compile "com.brsanthu:migbase64:2.2"
|
compile "com.brsanthu:migbase64:2.2"
|
||||||
testCompile "junit:junit:$junit_version"
|
testCompile "junit:junit:$junit_version"
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,10 @@ lazy val root = (project in file(".")).
|
|||||||
"joda-time" % "joda-time" % "2.9.4",
|
"joda-time" % "joda-time" % "2.9.4",
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
"com.brsanthu" % "migbase64" % "2.2",
|
"com.brsanthu" % "migbase64" % "2.2",
|
||||||
|
{{#supportJava6}}
|
||||||
|
"org.apache.commons" % "commons-lang3" % "3.5",
|
||||||
|
"commons-io" % "commons-io" % "2.5",
|
||||||
|
{{/supportJava6}}
|
||||||
"junit" % "junit" % "4.12" % "test",
|
"junit" % "junit" % "4.12" % "test",
|
||||||
"com.novocode" % "junit-interface" % "0.10" % "test"
|
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||||
)
|
)
|
||||||
|
@ -183,6 +183,19 @@
|
|||||||
<artifactId>migbase64</artifactId>
|
<artifactId>migbase64</artifactId>
|
||||||
<version>2.2</version>
|
<version>2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
{{#supportJava6}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons_lang3_version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>${commons_io_version}</version>
|
||||||
|
</dependency>
|
||||||
|
{{/supportJava6}}
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -199,6 +212,10 @@
|
|||||||
{{^java8}}
|
{{^java8}}
|
||||||
<jodatime-version>2.9.4</jodatime-version>
|
<jodatime-version>2.9.4</jodatime-version>
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
|
{{#supportJava6}}
|
||||||
|
<commons_io_version>2.5</commons_io_version>
|
||||||
|
<commons_lang3_version>3.5</commons_lang3_version>
|
||||||
|
{{/supportJava6}}
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.12</junit-version>
|
<junit-version>4.12</junit-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -5,6 +5,9 @@ package {{package}};
|
|||||||
{{^supportJava6}}
|
{{^supportJava6}}
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
{{/supportJava6}}
|
{{/supportJava6}}
|
||||||
|
{{#supportJava6}}
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
{{/supportJava6}}
|
||||||
{{#imports}}
|
{{#imports}}
|
||||||
import {{import}};
|
import {{import}};
|
||||||
{{/imports}}
|
{{/imports}}
|
||||||
|
@ -101,6 +101,29 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
|
|||||||
}
|
}
|
||||||
|
|
||||||
{{/supportJava6}}
|
{{/supportJava6}}
|
||||||
|
{{#supportJava6}}
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}{{#hasVars}}
|
||||||
|
{{classname}} {{classVarName}} = ({{classname}}) o;
|
||||||
|
return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
|
||||||
|
{{/hasMore}}{{/vars}}{{#parent}} &&
|
||||||
|
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
|
||||||
|
return true;{{/hasVars}}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
|
||||||
|
}
|
||||||
|
|
||||||
|
{{/supportJava6}}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -181,6 +181,20 @@
|
|||||||
<version>2.2</version>
|
<version>2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
{{#supportJava6}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons_lang3_version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>${commons_io_version}</version>
|
||||||
|
</dependency>
|
||||||
|
{{/supportJava6}}
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
@ -197,6 +211,10 @@
|
|||||||
{{^java8}}
|
{{^java8}}
|
||||||
<jodatime-version>2.9.4</jodatime-version>
|
<jodatime-version>2.9.4</jodatime-version>
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
|
{{#supportJava6}}
|
||||||
|
<commons_io_version>2.5</commons_io_version>
|
||||||
|
<commons_lang3_version>3.5</commons_lang3_version>
|
||||||
|
{{/supportJava6}}
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.12</junit-version>
|
<junit-version>4.12</junit-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
12
pom.xml
12
pom.xml
@ -292,6 +292,18 @@
|
|||||||
<module>samples/client/petstore/java/jersey2</module>
|
<module>samples/client/petstore/java/jersey2</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>java-client-jersey2-java6</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>env</name>
|
||||||
|
<value>java</value>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<modules>
|
||||||
|
<module>samples/client/petstore/java/jersey2-java6</module>
|
||||||
|
</modules>
|
||||||
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>java-client-okhttp-gson</id>
|
<id>java-client-okhttp-gson</id>
|
||||||
<activation>
|
<activation>
|
||||||
|
21
samples/client/petstore/java/jersey2-java6/.gitignore
vendored
Normal file
21
samples/client/petstore/java/jersey2-java6/.gitignore
vendored
Normal 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
|
@ -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
|
29
samples/client/petstore/java/jersey2-java6/.travis.yml
Normal file
29
samples/client/petstore/java/jersey2-java6/.travis.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
language: java
|
||||||
|
jdk:
|
||||||
|
- oraclejdk8
|
||||||
|
- oraclejdk7
|
||||||
|
before_install:
|
||||||
|
# ensure gradlew has proper permission
|
||||||
|
- chmod a+x ./gradlew
|
||||||
|
script:
|
||||||
|
# test using maven
|
||||||
|
- mvn test
|
||||||
|
# uncomment below to test using gradle
|
||||||
|
# - gradle test
|
||||||
|
# uncomment below to test using sbt
|
||||||
|
# - sbt test
|
201
samples/client/petstore/java/jersey2-java6/LICENSE
Normal file
201
samples/client/petstore/java/jersey2-java6/LICENSE
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright {yyyy} {name of copyright owner}
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
180
samples/client/petstore/java/jersey2-java6/README.md
Normal file
180
samples/client/petstore/java/jersey2-java6/README.md
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
# swagger-petstore-jersey2
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Maven users
|
||||||
|
|
||||||
|
Add this dependency to your project's POM:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-petstore-jersey2</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Gradle users
|
||||||
|
|
||||||
|
Add this dependency to your project's build file:
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
compile "io.swagger:swagger-petstore-jersey2:1.0.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Others
|
||||||
|
|
||||||
|
At first generate the JAR by executing:
|
||||||
|
|
||||||
|
mvn package
|
||||||
|
|
||||||
|
Then manually install the following JARs:
|
||||||
|
|
||||||
|
* target/swagger-petstore-jersey2-1.0.0.jar
|
||||||
|
* target/lib/*.jar
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation](#installation) instruction and execute the following Java code:
|
||||||
|
|
||||||
|
```java
|
||||||
|
|
||||||
|
import io.swagger.client.*;
|
||||||
|
import io.swagger.client.auth.*;
|
||||||
|
import io.swagger.client.model.*;
|
||||||
|
import io.swagger.client.api.FakeApi;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class FakeApiExample {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||||
|
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||||
|
*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
||||||
|
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [Animal](docs/Animal.md)
|
||||||
|
- [AnimalFarm](docs/AnimalFarm.md)
|
||||||
|
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||||
|
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||||
|
- [ArrayTest](docs/ArrayTest.md)
|
||||||
|
- [Cat](docs/Cat.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [Client](docs/Client.md)
|
||||||
|
- [Dog](docs/Dog.md)
|
||||||
|
- [EnumArrays](docs/EnumArrays.md)
|
||||||
|
- [EnumClass](docs/EnumClass.md)
|
||||||
|
- [EnumTest](docs/EnumTest.md)
|
||||||
|
- [FormatTest](docs/FormatTest.md)
|
||||||
|
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||||
|
- [MapTest](docs/MapTest.md)
|
||||||
|
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||||
|
- [Model200Response](docs/Model200Response.md)
|
||||||
|
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||||
|
- [ModelReturn](docs/ModelReturn.md)
|
||||||
|
- [Name](docs/Name.md)
|
||||||
|
- [NumberOnly](docs/NumberOnly.md)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||||
|
- [SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
Authentication schemes defined for the API:
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### http_basic_test
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
### petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- write:pets: modify pets in your account
|
||||||
|
- read:pets: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
## Recommendation
|
||||||
|
|
||||||
|
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
apiteam@swagger.io
|
||||||
|
|
119
samples/client/petstore/java/jersey2-java6/build.gradle
Normal file
119
samples/client/petstore/java/jersey2-java6/build.gradle
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
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-petstore-jersey2'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task execute(type:JavaExec) {
|
||||||
|
main = System.getProperty('mainClass')
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
swagger_annotations_version = "1.5.8"
|
||||||
|
jackson_version = "2.7.5"
|
||||||
|
jersey_version = "2.22.2"
|
||||||
|
jodatime_version = "2.9.4"
|
||||||
|
commons_io_version=2.5
|
||||||
|
commons_lang3_version=3.5
|
||||||
|
junit_version = "4.12"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
|
compile "org.glassfish.jersey.core:jersey-client:$jersey_version"
|
||||||
|
compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
|
||||||
|
compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
|
||||||
|
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||||
|
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||||
|
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
|
||||||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
|
||||||
|
compile "joda-time:joda-time:$jodatime_version"
|
||||||
|
compile "commons-io:commons-io:$commons_io_version"
|
||||||
|
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
|
||||||
|
compile "com.brsanthu:migbase64:2.2"
|
||||||
|
testCompile "junit:junit:$junit_version"
|
||||||
|
}
|
27
samples/client/petstore/java/jersey2-java6/build.sbt
Normal file
27
samples/client/petstore/java/jersey2-java6/build.sbt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
|
organization := "io.swagger",
|
||||||
|
name := "swagger-petstore-jersey2",
|
||||||
|
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(
|
||||||
|
"io.swagger" % "swagger-annotations" % "1.5.8",
|
||||||
|
"org.glassfish.jersey.core" % "jersey-client" % "2.22.2",
|
||||||
|
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2",
|
||||||
|
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-core" % "2.7.5",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5",
|
||||||
|
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5",
|
||||||
|
"joda-time" % "joda-time" % "2.9.4",
|
||||||
|
"com.brsanthu" % "migbase64" % "2.2",
|
||||||
|
"org.apache.commons" % "commons-lang3" % "3.5",
|
||||||
|
"commons-io" % "commons-io" % "2.5",
|
||||||
|
"junit" % "junit" % "4.12" % "test",
|
||||||
|
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# AdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapProperty** | **Map<String, String>** | | [optional]
|
||||||
|
**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/java/jersey2-java6/docs/Animal.md
Normal file
11
samples/client/petstore/java/jersey2-java6/docs/Animal.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **String** | |
|
||||||
|
**color** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# AnimalFarm
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ArrayOfArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
12
samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md
Normal file
12
samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# ArrayTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayOfString** | **List<String>** | | [optional]
|
||||||
|
**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional]
|
||||||
|
**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/jersey2-java6/docs/Cat.md
Normal file
10
samples/client/petstore/java/jersey2-java6/docs/Cat.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/java/jersey2-java6/docs/Category.md
Normal file
11
samples/client/petstore/java/jersey2-java6/docs/Category.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/jersey2-java6/docs/Client.md
Normal file
10
samples/client/petstore/java/jersey2-java6/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Client
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**client** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/jersey2-java6/docs/Dog.md
Normal file
10
samples/client/petstore/java/jersey2-java6/docs/Dog.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
# EnumArrays
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
|
||||||
|
**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="JustSymbolEnum"></a>
|
||||||
|
## Enum: JustSymbolEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
GREATER_THAN_OR_EQUAL_TO | ">="
|
||||||
|
DOLLAR | "$"
|
||||||
|
|
||||||
|
|
||||||
|
<a name="List<ArrayEnumEnum>"></a>
|
||||||
|
## Enum: List<ArrayEnumEnum>
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
FISH | "fish"
|
||||||
|
CRAB | "crab"
|
||||||
|
|
||||||
|
|
||||||
|
|
14
samples/client/petstore/java/jersey2-java6/docs/EnumClass.md
Normal file
14
samples/client/petstore/java/jersey2-java6/docs/EnumClass.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
# EnumClass
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `_ABC` (value: `"_abc"`)
|
||||||
|
|
||||||
|
* `_EFG` (value: `"-efg"`)
|
||||||
|
|
||||||
|
* `_XYZ_` (value: `"(xyz)"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
36
samples/client/petstore/java/jersey2-java6/docs/EnumTest.md
Normal file
36
samples/client/petstore/java/jersey2-java6/docs/EnumTest.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
# EnumTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
|
||||||
|
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
|
||||||
|
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="EnumStringEnum"></a>
|
||||||
|
## Enum: EnumStringEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
|
||||||
|
|
||||||
|
<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
|
||||||
|
|
||||||
|
|
||||||
|
|
189
samples/client/petstore/java/jersey2-java6/docs/FakeApi.md
Normal file
189
samples/client/petstore/java/jersey2-java6/docs/FakeApi.md
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
# FakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" 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 \"client\" 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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_basic_test](../README.md#http_basic_test)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||||
|
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||||
|
|
||||||
|
<a name="testEnumParameters"></a>
|
||||||
|
# **testEnumParameters**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testEnumParameters");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**enumFormStringArray** | [**List<String>**](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<String>**](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<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
|
||||||
|
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||||
|
**enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
|
||||||
|
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -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** | |
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# HasOnlyReadOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional]
|
||||||
|
**foo** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
19
samples/client/petstore/java/jersey2-java6/docs/MapTest.md
Normal file
19
samples/client/petstore/java/jersey2-java6/docs/MapTest.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
# MapTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||||
|
**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Map<String, InnerEnum>"></a>
|
||||||
|
## Enum: Map<String, InnerEnum>
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**uuid** | **String** | | [optional]
|
||||||
|
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Model200Response
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Integer** | | [optional]
|
||||||
|
**propertyClass** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# ModelApiResponse
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**code** | **Integer** | | [optional]
|
||||||
|
**type** | **String** | | [optional]
|
||||||
|
**message** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ModelReturn
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_return** | **Integer** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
13
samples/client/petstore/java/jersey2-java6/docs/Name.md
Normal file
13
samples/client/petstore/java/jersey2-java6/docs/Name.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
# Name
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Integer** | |
|
||||||
|
**snakeCase** | **Integer** | | [optional]
|
||||||
|
**property** | **String** | | [optional]
|
||||||
|
**_123Number** | **Integer** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# NumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
24
samples/client/petstore/java/jersey2-java6/docs/Order.md
Normal file
24
samples/client/petstore/java/jersey2-java6/docs/Order.md
Normal 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 | "placed"
|
||||||
|
APPROVED | "approved"
|
||||||
|
DELIVERED | "delivered"
|
||||||
|
|
||||||
|
|
||||||
|
|
24
samples/client/petstore/java/jersey2-java6/docs/Pet.md
Normal file
24
samples/client/petstore/java/jersey2-java6/docs/Pet.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
# Pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**category** | [**Category**](Category.md) | | [optional]
|
||||||
|
**name** | **String** | |
|
||||||
|
**photoUrls** | **List<String>** | |
|
||||||
|
**tags** | [**List<Tag>**](Tag.md) | | [optional]
|
||||||
|
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="StatusEnum"></a>
|
||||||
|
## Enum: StatusEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
AVAILABLE | "available"
|
||||||
|
PENDING | "pending"
|
||||||
|
SOLD | "sold"
|
||||||
|
|
||||||
|
|
||||||
|
|
448
samples/client/petstore/java/jersey2-java6/docs/PetApi.md
Normal file
448
samples/client/petstore/java/jersey2-java6/docs/PetApi.md
Normal file
@ -0,0 +1,448 @@
|
|||||||
|
# PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.addPet(body);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### 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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.deletePet(petId, apiKey);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### 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<Pet> 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<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](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<Pet> 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<String>**](String.md)| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.updatePet(body);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### 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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.updatePetWithForm(petId, name, status);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# ReadOnlyFirst
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional]
|
||||||
|
**baz** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# SpecialModelName
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**specialPropertyName** | **Long** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
197
samples/client/petstore/java/jersey2-java6/docs/StoreApi.md
Normal file
197
samples/client/petstore/java/jersey2-java6/docs/StoreApi.md
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
# StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
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**
|
||||||
|
> deleteOrder(orderId)
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value < 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 {
|
||||||
|
apiInstance.deleteOrder(orderId);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="getInventory"></a>
|
||||||
|
# **getInventory**
|
||||||
|
> Map<String, Integer> 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<String, Integer>**](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 <= 5 or > 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
|
||||||
|
|
11
samples/client/petstore/java/jersey2-java6/docs/Tag.md
Normal file
11
samples/client/petstore/java/jersey2-java6/docs/Tag.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Tag
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
17
samples/client/petstore/java/jersey2-java6/docs/User.md
Normal file
17
samples/client/petstore/java/jersey2-java6/docs/User.md
Normal 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]
|
||||||
|
|
||||||
|
|
||||||
|
|
370
samples/client/petstore/java/jersey2-java6/docs/UserApi.md
Normal file
370
samples/client/petstore/java/jersey2-java6/docs/UserApi.md
Normal file
@ -0,0 +1,370 @@
|
|||||||
|
# UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.createUser(body);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="createUsersWithArrayInput"></a>
|
||||||
|
# **createUsersWithArrayInput**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.createUsersWithArrayInput(body);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="createUsersWithListInput"></a>
|
||||||
|
# **createUsersWithListInput**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.createUsersWithListInput(body);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#createUsersWithListInput");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="deleteUser"></a>
|
||||||
|
# **deleteUser**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.deleteUser(username);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### 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**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.logoutUser();
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#logoutUser");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="updateUser"></a>
|
||||||
|
# **updateUser**
|
||||||
|
> 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 {
|
||||||
|
apiInstance.updateUser(username, body);
|
||||||
|
} 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
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
52
samples/client/petstore/java/jersey2-java6/git_push.sh
Normal file
52
samples/client/petstore/java/jersey2-java6/git_push.sh
Normal 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'
|
||||||
|
|
@ -0,0 +1,2 @@
|
|||||||
|
# Uncomment to build for Android
|
||||||
|
#target = android
|
BIN
samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.properties
vendored
Normal 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
|
160
samples/client/petstore/java/jersey2-java6/gradlew
vendored
Normal file
160
samples/client/petstore/java/jersey2-java6/gradlew
vendored
Normal 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 "$@"
|
90
samples/client/petstore/java/jersey2-java6/gradlew.bat
vendored
Normal file
90
samples/client/petstore/java/jersey2-java6/gradlew.bat
vendored
Normal 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
|
201
samples/client/petstore/java/jersey2-java6/pom.xml
Normal file
201
samples/client/petstore/java/jersey2-java6/pom.xml
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
<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-petstore-jersey2-java6</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>swagger-petstore-jersey2-java6</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.6</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>
|
||||||
|
<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-compiler-plugin</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.7</source>
|
||||||
|
<target>1.7</target>
|
||||||
|
</configuration>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- HTTP client: jersey-client -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.glassfish.jersey.core</groupId>
|
||||||
|
<artifactId>jersey-client</artifactId>
|
||||||
|
<version>${jersey-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.glassfish.jersey.media</groupId>
|
||||||
|
<artifactId>jersey-media-multipart</artifactId>
|
||||||
|
<version>${jersey-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.glassfish.jersey.media</groupId>
|
||||||
|
<artifactId>jersey-media-json-jackson</artifactId>
|
||||||
|
<version>${jersey-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JSON processing: jackson -->
|
||||||
|
<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>joda-time</groupId>
|
||||||
|
<artifactId>joda-time</artifactId>
|
||||||
|
<version>${jodatime-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Base64 encoding that works in both JVM and Android -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.brsanthu</groupId>
|
||||||
|
<artifactId>migbase64</artifactId>
|
||||||
|
<version>2.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons_lang3_version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>${commons_io_version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- test dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>${junit-version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<swagger-core-version>1.5.9</swagger-core-version>
|
||||||
|
<jersey-version>2.22.2</jersey-version>
|
||||||
|
<jackson-version>2.7.5</jackson-version>
|
||||||
|
<jodatime-version>2.9.4</jodatime-version>
|
||||||
|
<commons_io_version>2.5</commons_io_version>
|
||||||
|
<commons_lang3_version>3.5</commons_lang3_version>
|
||||||
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
|
<junit-version>4.12</junit-version>
|
||||||
|
</properties>
|
||||||
|
</project>
|
@ -0,0 +1 @@
|
|||||||
|
rootProject.name = "swagger-petstore-jersey2"
|
@ -0,0 +1,3 @@
|
|||||||
|
<manifest package="io.swagger.client" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application />
|
||||||
|
</manifest>
|
@ -0,0 +1,700 @@
|
|||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import javax.ws.rs.client.Client;
|
||||||
|
import javax.ws.rs.client.ClientBuilder;
|
||||||
|
import javax.ws.rs.client.Entity;
|
||||||
|
import javax.ws.rs.client.Invocation;
|
||||||
|
import javax.ws.rs.client.WebTarget;
|
||||||
|
import javax.ws.rs.core.Form;
|
||||||
|
import javax.ws.rs.core.GenericType;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
import javax.ws.rs.core.Response.Status;
|
||||||
|
|
||||||
|
import org.glassfish.jersey.client.ClientConfig;
|
||||||
|
import org.glassfish.jersey.client.ClientProperties;
|
||||||
|
import org.glassfish.jersey.filter.LoggingFilter;
|
||||||
|
import org.glassfish.jersey.jackson.JacksonFeature;
|
||||||
|
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
||||||
|
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||||
|
import org.glassfish.jersey.media.multipart.MultiPart;
|
||||||
|
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import io.swagger.client.auth.Authentication;
|
||||||
|
import io.swagger.client.auth.HttpBasicAuth;
|
||||||
|
import io.swagger.client.auth.ApiKeyAuth;
|
||||||
|
import io.swagger.client.auth.OAuth;
|
||||||
|
|
||||||
|
|
||||||
|
public class ApiClient {
|
||||||
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
|
private String basePath = "http://petstore.swagger.io/v2";
|
||||||
|
private boolean debugging = false;
|
||||||
|
private int connectionTimeout = 0;
|
||||||
|
|
||||||
|
private Client httpClient;
|
||||||
|
private JSON json;
|
||||||
|
private String tempFolderPath = null;
|
||||||
|
|
||||||
|
private Map<String, Authentication> authentications;
|
||||||
|
|
||||||
|
private int statusCode;
|
||||||
|
private Map<String, List<String>> responseHeaders;
|
||||||
|
|
||||||
|
private DateFormat dateFormat;
|
||||||
|
|
||||||
|
public ApiClient() {
|
||||||
|
json = new JSON();
|
||||||
|
httpClient = buildHttpClient(debugging);
|
||||||
|
|
||||||
|
this.dateFormat = new RFC3339DateFormat();
|
||||||
|
|
||||||
|
// Set default User-Agent.
|
||||||
|
setUserAgent("Swagger-Codegen/1.0.0/java");
|
||||||
|
|
||||||
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
|
authentications = new HashMap<String, Authentication>();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the JSON instance to do JSON serialization and deserialization.
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Client getHttpClient() {
|
||||||
|
return httpClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient setHttpClient(Client httpClient) {
|
||||||
|
this.httpClient = httpClient;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBasePath() {
|
||||||
|
return basePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient setBasePath(String basePath) {
|
||||||
|
this.basePath = basePath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the status code of the previous request
|
||||||
|
*/
|
||||||
|
public int getStatusCode() {
|
||||||
|
return statusCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the response headers of the previous request
|
||||||
|
*/
|
||||||
|
public Map<String, List<String>> getResponseHeaders() {
|
||||||
|
return responseHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 username for the first HTTP basic authentication.
|
||||||
|
*/
|
||||||
|
public void setUsername(String username) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof HttpBasicAuth) {
|
||||||
|
((HttpBasicAuth) auth).setUsername(username);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No HTTP basic authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set password for the first HTTP basic authentication.
|
||||||
|
*/
|
||||||
|
public void setPassword(String password) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof HttpBasicAuth) {
|
||||||
|
((HttpBasicAuth) auth).setPassword(password);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No HTTP basic authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API key value for the first API key authentication.
|
||||||
|
*/
|
||||||
|
public void setApiKey(String apiKey) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof ApiKeyAuth) {
|
||||||
|
((ApiKeyAuth) auth).setApiKey(apiKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API key prefix for the first API key authentication.
|
||||||
|
*/
|
||||||
|
public void setApiKeyPrefix(String apiKeyPrefix) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof ApiKeyAuth) {
|
||||||
|
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set access token for the first OAuth2 authentication.
|
||||||
|
*/
|
||||||
|
public void setAccessToken(String accessToken) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof OAuth) {
|
||||||
|
((OAuth) auth).setAccessToken(accessToken);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No OAuth2 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
|
*/
|
||||||
|
public ApiClient setUserAgent(String userAgent) {
|
||||||
|
addDefaultHeader("User-Agent", userAgent);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a default header.
|
||||||
|
*
|
||||||
|
* @param key The header's key
|
||||||
|
* @param value The header's value
|
||||||
|
*/
|
||||||
|
public ApiClient addDefaultHeader(String key, String value) {
|
||||||
|
defaultHeaderMap.put(key, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check that whether debugging is enabled for this API client.
|
||||||
|
*/
|
||||||
|
public boolean isDebugging() {
|
||||||
|
return debugging;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable/disable debugging for this API client.
|
||||||
|
*
|
||||||
|
* @param debugging To enable (true) or disable (false) debugging
|
||||||
|
*/
|
||||||
|
public ApiClient setDebugging(boolean debugging) {
|
||||||
|
this.debugging = debugging;
|
||||||
|
// Rebuild HTTP Client according to the new "debugging" value.
|
||||||
|
this.httpClient = buildHttpClient(debugging);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path of temporary folder used to store downloaded files from endpoints
|
||||||
|
* with file response. The default value is <code>null</code>, i.e. using
|
||||||
|
* the system's default tempopary folder.
|
||||||
|
*
|
||||||
|
* @see https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)
|
||||||
|
*/
|
||||||
|
public String getTempFolderPath() {
|
||||||
|
return tempFolderPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient setTempFolderPath(String tempFolderPath) {
|
||||||
|
this.tempFolderPath = tempFolderPath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect timeout (in milliseconds).
|
||||||
|
*/
|
||||||
|
public int getConnectTimeout() {
|
||||||
|
return connectionTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the connect timeout (in milliseconds).
|
||||||
|
* A value of 0 means no timeout, otherwise values must be between 1 and
|
||||||
|
* {@link Integer#MAX_VALUE}.
|
||||||
|
*/
|
||||||
|
public ApiClient setConnectTimeout(int connectionTimeout) {
|
||||||
|
this.connectionTimeout = connectionTimeout;
|
||||||
|
httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the date format used to parse/format date parameters.
|
||||||
|
*/
|
||||||
|
public DateFormat getDateFormat() {
|
||||||
|
return dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the date format used to parse/format date parameters.
|
||||||
|
*/
|
||||||
|
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||||
|
this.dateFormat = dateFormat;
|
||||||
|
// also set the date format for model (de)serialization with Date properties
|
||||||
|
this.json.setDateFormat((DateFormat) dateFormat.clone());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the given string into Date object.
|
||||||
|
*/
|
||||||
|
public Date parseDate(String str) {
|
||||||
|
try {
|
||||||
|
return dateFormat.parse(str);
|
||||||
|
} catch (java.text.ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format the given Date object into string.
|
||||||
|
*/
|
||||||
|
public String formatDate(Date date) {
|
||||||
|
return dateFormat.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format the given parameter object into string.
|
||||||
|
*/
|
||||||
|
public String parameterToString(Object param) {
|
||||||
|
if (param == null) {
|
||||||
|
return "";
|
||||||
|
} else if (param instanceof Date) {
|
||||||
|
return formatDate((Date) param);
|
||||||
|
} else if (param instanceof Collection) {
|
||||||
|
StringBuilder b = new StringBuilder();
|
||||||
|
for(Object o : (Collection)param) {
|
||||||
|
if(b.length() > 0) {
|
||||||
|
b.append(",");
|
||||||
|
}
|
||||||
|
b.append(String.valueOf(o));
|
||||||
|
}
|
||||||
|
return b.toString();
|
||||||
|
} else {
|
||||||
|
return String.valueOf(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Format to {@code Pair} objects.
|
||||||
|
*/
|
||||||
|
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){
|
||||||
|
List<Pair> params = new ArrayList<Pair>();
|
||||||
|
|
||||||
|
// preconditions
|
||||||
|
if (name == null || name.isEmpty() || value == null) return params;
|
||||||
|
|
||||||
|
Collection valueCollection = null;
|
||||||
|
if (value instanceof Collection) {
|
||||||
|
valueCollection = (Collection) value;
|
||||||
|
} else {
|
||||||
|
params.add(new Pair(name, parameterToString(value)));
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (valueCollection.isEmpty()){
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the collection format
|
||||||
|
collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv
|
||||||
|
|
||||||
|
// create the params based on the collection format
|
||||||
|
if (collectionFormat.equals("multi")) {
|
||||||
|
for (Object item : valueCollection) {
|
||||||
|
params.add(new Pair(name, parameterToString(item)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
String delimiter = ",";
|
||||||
|
|
||||||
|
if (collectionFormat.equals("csv")) {
|
||||||
|
delimiter = ",";
|
||||||
|
} else if (collectionFormat.equals("ssv")) {
|
||||||
|
delimiter = " ";
|
||||||
|
} else if (collectionFormat.equals("tsv")) {
|
||||||
|
delimiter = "\t";
|
||||||
|
} else if (collectionFormat.equals("pipes")) {
|
||||||
|
delimiter = "|";
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder() ;
|
||||||
|
for (Object item : valueCollection) {
|
||||||
|
sb.append(delimiter);
|
||||||
|
sb.append(parameterToString(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
params.add(new Pair(name, sb.substring(1)));
|
||||||
|
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given MIME is a JSON MIME.
|
||||||
|
* JSON MIME examples:
|
||||||
|
* application/json
|
||||||
|
* application/json; charset=UTF8
|
||||||
|
* APPLICATION/JSON
|
||||||
|
*/
|
||||||
|
public boolean isJsonMime(String mime) {
|
||||||
|
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select the Accept header's value from the given accepts array:
|
||||||
|
* if JSON exists in the given array, use it;
|
||||||
|
* otherwise use all of them (joining into a string)
|
||||||
|
*
|
||||||
|
* @param accepts The accepts array to select from
|
||||||
|
* @return The Accept header to use. If the given array is empty,
|
||||||
|
* null will be returned (not to set the Accept header explicitly).
|
||||||
|
*/
|
||||||
|
public String selectHeaderAccept(String[] accepts) {
|
||||||
|
if (accepts.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (String accept : accepts) {
|
||||||
|
if (isJsonMime(accept)) {
|
||||||
|
return accept;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return StringUtil.join(accepts, ",");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select the Content-Type header's value from the given array:
|
||||||
|
* if JSON exists in the given array, use it;
|
||||||
|
* otherwise use the first one of the array.
|
||||||
|
*
|
||||||
|
* @param contentTypes The Content-Type array to select from
|
||||||
|
* @return The Content-Type header to use. If the given array is empty,
|
||||||
|
* JSON will be used.
|
||||||
|
*/
|
||||||
|
public String selectHeaderContentType(String[] contentTypes) {
|
||||||
|
if (contentTypes.length == 0) {
|
||||||
|
return "application/json";
|
||||||
|
}
|
||||||
|
for (String contentType : contentTypes) {
|
||||||
|
if (isJsonMime(contentType)) {
|
||||||
|
return contentType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return contentTypes[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escape the given string to be used as URL query value.
|
||||||
|
*/
|
||||||
|
public String escapeString(String str) {
|
||||||
|
try {
|
||||||
|
return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize the given Java object into string entity according the given
|
||||||
|
* Content-Type (only JSON is supported for now).
|
||||||
|
*/
|
||||||
|
public Entity<?> serialize(Object obj, Map<String, Object> formParams, String contentType) throws ApiException {
|
||||||
|
Entity<?> entity = null;
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
MultiPart multiPart = new MultiPart();
|
||||||
|
for (Entry<String, Object> param: formParams.entrySet()) {
|
||||||
|
if (param.getValue() instanceof File) {
|
||||||
|
File file = (File) param.getValue();
|
||||||
|
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
|
||||||
|
.fileName(file.getName()).size(file.length()).build();
|
||||||
|
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
|
||||||
|
} else {
|
||||||
|
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
|
||||||
|
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||||
|
} else if (contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||||
|
Form form = new Form();
|
||||||
|
for (Entry<String, Object> param: formParams.entrySet()) {
|
||||||
|
form.param(param.getKey(), parameterToString(param.getValue()));
|
||||||
|
}
|
||||||
|
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
|
||||||
|
} else {
|
||||||
|
// We let jersey handle the serialization
|
||||||
|
entity = Entity.entity(obj, contentType);
|
||||||
|
}
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserialize response body to Java object according to the Content-Type.
|
||||||
|
*/
|
||||||
|
public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException {
|
||||||
|
if (response == null || returnType == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("byte[]".equals(returnType.toString())) {
|
||||||
|
// Handle binary response (byte array).
|
||||||
|
return (T) response.readEntity(byte[].class);
|
||||||
|
} else if (returnType.equals(File.class)) {
|
||||||
|
// Handle file downloading.
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
T file = (T) downloadFileFromResponse(response);
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
String contentType = null;
|
||||||
|
List<Object> contentTypes = response.getHeaders().get("Content-Type");
|
||||||
|
if (contentTypes != null && !contentTypes.isEmpty())
|
||||||
|
contentType = String.valueOf(contentTypes.get(0));
|
||||||
|
if (contentType == null)
|
||||||
|
throw new ApiException(500, "missing Content-Type in response");
|
||||||
|
|
||||||
|
return response.readEntity(returnType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download file from the given response.
|
||||||
|
* @throws ApiException If fail to read file content from response and write to disk
|
||||||
|
*/
|
||||||
|
public File downloadFileFromResponse(Response response) throws ApiException {
|
||||||
|
try {
|
||||||
|
File file = prepareDownloadFile(response);
|
||||||
|
// Java6 falls back to commons.io for file copying
|
||||||
|
FileUtils.copyToFile(response.readEntity(InputStream.class), file);
|
||||||
|
return file;
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new ApiException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public File prepareDownloadFile(Response response) throws IOException {
|
||||||
|
String filename = null;
|
||||||
|
String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
|
||||||
|
if (contentDisposition != null && !"".equals(contentDisposition)) {
|
||||||
|
// Get filename from the Content-Disposition header.
|
||||||
|
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
||||||
|
Matcher matcher = pattern.matcher(contentDisposition);
|
||||||
|
if (matcher.find())
|
||||||
|
filename = matcher.group(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
String prefix = null;
|
||||||
|
String suffix = null;
|
||||||
|
if (filename == null) {
|
||||||
|
prefix = "download-";
|
||||||
|
suffix = "";
|
||||||
|
} else {
|
||||||
|
int pos = filename.lastIndexOf(".");
|
||||||
|
if (pos == -1) {
|
||||||
|
prefix = filename + "-";
|
||||||
|
} else {
|
||||||
|
prefix = filename.substring(0, pos) + "-";
|
||||||
|
suffix = filename.substring(pos);
|
||||||
|
}
|
||||||
|
// File.createTempFile requires the prefix to be at least three characters long
|
||||||
|
if (prefix.length() < 3)
|
||||||
|
prefix = "download-";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempFolderPath == null)
|
||||||
|
return File.createTempFile(prefix, suffix);
|
||||||
|
else
|
||||||
|
return File.createTempFile(prefix, suffix, new File(tempFolderPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoke API by sending HTTP request with the given options.
|
||||||
|
*
|
||||||
|
* @param path The sub-path of the HTTP URL
|
||||||
|
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
|
||||||
|
* @param queryParams The query parameters
|
||||||
|
* @param body The request body object
|
||||||
|
* @param headerParams The header parameters
|
||||||
|
* @param formParams The form parameters
|
||||||
|
* @param accept The request's Accept header
|
||||||
|
* @param contentType The request's Content-Type header
|
||||||
|
* @param authNames The authentications to apply
|
||||||
|
* @param returnType The return type into which to deserialize the response
|
||||||
|
* @return The response body in type of string
|
||||||
|
*/
|
||||||
|
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
|
||||||
|
updateParamsForAuth(authNames, queryParams, headerParams);
|
||||||
|
|
||||||
|
// Not using `.target(this.basePath).path(path)` below,
|
||||||
|
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
||||||
|
WebTarget target = httpClient.target(this.basePath + path);
|
||||||
|
|
||||||
|
if (queryParams != null) {
|
||||||
|
for (Pair queryParam : queryParams) {
|
||||||
|
if (queryParam.getValue() != null) {
|
||||||
|
target = target.queryParam(queryParam.getName(), queryParam.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Invocation.Builder invocationBuilder = target.request().accept(accept);
|
||||||
|
|
||||||
|
for (String key : headerParams.keySet()) {
|
||||||
|
String value = headerParams.get(key);
|
||||||
|
if (value != null) {
|
||||||
|
invocationBuilder = invocationBuilder.header(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String key : defaultHeaderMap.keySet()) {
|
||||||
|
if (!headerParams.containsKey(key)) {
|
||||||
|
String value = defaultHeaderMap.get(key);
|
||||||
|
if (value != null) {
|
||||||
|
invocationBuilder = invocationBuilder.header(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity<?> entity = serialize(body, formParams, contentType);
|
||||||
|
|
||||||
|
Response response = null;
|
||||||
|
|
||||||
|
if ("GET".equals(method)) {
|
||||||
|
response = invocationBuilder.get();
|
||||||
|
} else if ("POST".equals(method)) {
|
||||||
|
response = invocationBuilder.post(entity);
|
||||||
|
} else if ("PUT".equals(method)) {
|
||||||
|
response = invocationBuilder.put(entity);
|
||||||
|
} else if ("DELETE".equals(method)) {
|
||||||
|
response = invocationBuilder.delete();
|
||||||
|
} else {
|
||||||
|
throw new ApiException(500, "unknown method type " + method);
|
||||||
|
}
|
||||||
|
|
||||||
|
statusCode = response.getStatusInfo().getStatusCode();
|
||||||
|
responseHeaders = buildResponseHeaders(response);
|
||||||
|
|
||||||
|
if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) {
|
||||||
|
return null;
|
||||||
|
} else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) {
|
||||||
|
if (returnType == null)
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
return deserialize(response, returnType);
|
||||||
|
} else {
|
||||||
|
String message = "error";
|
||||||
|
String respBody = null;
|
||||||
|
if (response.hasEntity()) {
|
||||||
|
try {
|
||||||
|
respBody = String.valueOf(response.readEntity(String.class));
|
||||||
|
message = respBody;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new ApiException(
|
||||||
|
response.getStatus(),
|
||||||
|
message,
|
||||||
|
buildResponseHeaders(response),
|
||||||
|
respBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the Client used to make HTTP requests.
|
||||||
|
*/
|
||||||
|
private Client buildHttpClient(boolean debugging) {
|
||||||
|
final ClientConfig clientConfig = new ClientConfig();
|
||||||
|
clientConfig.register(MultiPartFeature.class);
|
||||||
|
clientConfig.register(json);
|
||||||
|
clientConfig.register(JacksonFeature.class);
|
||||||
|
if (debugging) {
|
||||||
|
clientConfig.register(LoggingFilter.class);
|
||||||
|
}
|
||||||
|
return ClientBuilder.newClient(clientConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, List<String>> buildResponseHeaders(Response response) {
|
||||||
|
Map<String, List<String>> responseHeaders = new HashMap<String, List<String>>();
|
||||||
|
for (Entry<String, List<Object>> entry: response.getHeaders().entrySet()) {
|
||||||
|
List<Object> values = entry.getValue();
|
||||||
|
List<String> headers = new ArrayList<String>();
|
||||||
|
for (Object o : values) {
|
||||||
|
headers.add(String.valueOf(o));
|
||||||
|
}
|
||||||
|
responseHeaders.put(entry.getKey(), headers);
|
||||||
|
}
|
||||||
|
return responseHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update query and header parameters based on authentication settings.
|
||||||
|
*
|
||||||
|
* @param authNames The authentications to apply
|
||||||
|
*/
|
||||||
|
private void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
|
||||||
|
for (String authName : authNames) {
|
||||||
|
Authentication auth = authentications.get(authName);
|
||||||
|
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
|
||||||
|
auth.applyToParams(queryParams, headerParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class ApiException extends Exception {
|
||||||
|
private int code = 0;
|
||||||
|
private Map<String, List<String>> responseHeaders = null;
|
||||||
|
private String responseBody = null;
|
||||||
|
|
||||||
|
public ApiException() {}
|
||||||
|
|
||||||
|
public ApiException(Throwable throwable) {
|
||||||
|
super(throwable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
|
||||||
|
super(message, throwable);
|
||||||
|
this.code = code;
|
||||||
|
this.responseHeaders = responseHeaders;
|
||||||
|
this.responseBody = responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
|
||||||
|
this(message, (Throwable) null, code, responseHeaders, responseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
|
||||||
|
this(message, throwable, code, responseHeaders, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
|
||||||
|
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(int code, String message) {
|
||||||
|
super(message);
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
|
||||||
|
this(code, message);
|
||||||
|
this.responseHeaders = responseHeaders;
|
||||||
|
this.responseBody = responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the HTTP status code.
|
||||||
|
*
|
||||||
|
* @return HTTP status code
|
||||||
|
*/
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the HTTP response headers.
|
||||||
|
*
|
||||||
|
* @return A map of list of string
|
||||||
|
*/
|
||||||
|
public Map<String, List<String>> getResponseHeaders() {
|
||||||
|
return responseHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the HTTP response body.
|
||||||
|
*
|
||||||
|
* @return Response body in the form of string
|
||||||
|
*/
|
||||||
|
public String getResponseBody() {
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
|
||||||
|
public class Configuration {
|
||||||
|
private static ApiClient defaultApiClient = new ApiClient();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default API client, which would be used when creating API
|
||||||
|
* instances without providing an API client.
|
||||||
|
*
|
||||||
|
* @return Default API client
|
||||||
|
*/
|
||||||
|
public static ApiClient getDefaultApiClient() {
|
||||||
|
return defaultApiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the default API client, which would be used when creating API
|
||||||
|
* instances without providing an API client.
|
||||||
|
*
|
||||||
|
* @param apiClient API client
|
||||||
|
*/
|
||||||
|
public static void setDefaultApiClient(ApiClient apiClient) {
|
||||||
|
defaultApiClient = apiClient;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.*;
|
||||||
|
import com.fasterxml.jackson.databind.*;
|
||||||
|
import com.fasterxml.jackson.datatype.joda.*;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
|
||||||
|
import javax.ws.rs.ext.ContextResolver;
|
||||||
|
|
||||||
|
|
||||||
|
public class JSON implements ContextResolver<ObjectMapper> {
|
||||||
|
private ObjectMapper mapper;
|
||||||
|
|
||||||
|
public JSON() {
|
||||||
|
mapper = new ObjectMapper();
|
||||||
|
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||||
|
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||||
|
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
|
||||||
|
mapper.setDateFormat(new RFC3339DateFormat());
|
||||||
|
mapper.registerModule(new JodaModule());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the date format for JSON (de)serialization with Date properties.
|
||||||
|
*/
|
||||||
|
public void setDateFormat(DateFormat dateFormat) {
|
||||||
|
mapper.setDateFormat(dateFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ObjectMapper getContext(Class<?> type) {
|
||||||
|
return mapper;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,232 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.ApiException;
|
||||||
|
import io.swagger.client.ApiClient;
|
||||||
|
import io.swagger.client.Configuration;
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
|
import io.swagger.client.model.Client;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class FakeApi {
|
||||||
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
public FakeApi() {
|
||||||
|
this(Configuration.getDefaultApiClient());
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeApi(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient getApiClient() {
|
||||||
|
return apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiClient(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test \"client\" model
|
||||||
|
*
|
||||||
|
* @param body client model (required)
|
||||||
|
* @return Client
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public Client testClientModel(Client body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* @param number None (required)
|
||||||
|
* @param _double None (required)
|
||||||
|
* @param patternWithoutDelimiter None (required)
|
||||||
|
* @param _byte None (required)
|
||||||
|
* @param integer None (optional)
|
||||||
|
* @param int32 None (optional)
|
||||||
|
* @param int64 None (optional)
|
||||||
|
* @param _float None (optional)
|
||||||
|
* @param string None (optional)
|
||||||
|
* @param binary None (optional)
|
||||||
|
* @param date None (optional)
|
||||||
|
* @param dateTime None (optional)
|
||||||
|
* @param password None (optional)
|
||||||
|
* @param paramCallback None (optional)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'number' is set
|
||||||
|
if (number == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
// verify the required parameter '_double' is set
|
||||||
|
if (_double == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||||
|
if (patternWithoutDelimiter == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
// verify the required parameter '_byte' is set
|
||||||
|
if (_byte == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (integer != null)
|
||||||
|
localVarFormParams.put("integer", integer);
|
||||||
|
if (int32 != null)
|
||||||
|
localVarFormParams.put("int32", int32);
|
||||||
|
if (int64 != null)
|
||||||
|
localVarFormParams.put("int64", int64);
|
||||||
|
if (number != null)
|
||||||
|
localVarFormParams.put("number", number);
|
||||||
|
if (_float != null)
|
||||||
|
localVarFormParams.put("float", _float);
|
||||||
|
if (_double != null)
|
||||||
|
localVarFormParams.put("double", _double);
|
||||||
|
if (string != null)
|
||||||
|
localVarFormParams.put("string", string);
|
||||||
|
if (patternWithoutDelimiter != null)
|
||||||
|
localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter);
|
||||||
|
if (_byte != null)
|
||||||
|
localVarFormParams.put("byte", _byte);
|
||||||
|
if (binary != null)
|
||||||
|
localVarFormParams.put("binary", binary);
|
||||||
|
if (date != null)
|
||||||
|
localVarFormParams.put("date", date);
|
||||||
|
if (dateTime != null)
|
||||||
|
localVarFormParams.put("dateTime", dateTime);
|
||||||
|
if (password != null)
|
||||||
|
localVarFormParams.put("password", password);
|
||||||
|
if (paramCallback != null)
|
||||||
|
localVarFormParams.put("callback", paramCallback);
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml; charset=utf-8", "application/json; charset=utf-8"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"application/xml; charset=utf-8", "application/json; charset=utf-8"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "http_basic_test" };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* To test enum parameters
|
||||||
|
*
|
||||||
|
* @param enumFormStringArray Form parameter enum test (string array) (optional)
|
||||||
|
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
|
||||||
|
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
|
||||||
|
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @param enumQueryInteger Query parameter enum test (double) (optional)
|
||||||
|
* @param enumQueryDouble Query parameter enum test (double) (optional)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray));
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString));
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger));
|
||||||
|
|
||||||
|
if (enumHeaderStringArray != null)
|
||||||
|
localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray));
|
||||||
|
if (enumHeaderString != null)
|
||||||
|
localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString));
|
||||||
|
|
||||||
|
if (enumFormStringArray != null)
|
||||||
|
localVarFormParams.put("enum_form_string_array", enumFormStringArray);
|
||||||
|
if (enumFormString != null)
|
||||||
|
localVarFormParams.put("enum_form_string", enumFormString);
|
||||||
|
if (enumQueryDouble != null)
|
||||||
|
localVarFormParams.put("enum_query_double", enumQueryDouble);
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,384 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.ApiException;
|
||||||
|
import io.swagger.client.ApiClient;
|
||||||
|
import io.swagger.client.Configuration;
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
|
import io.swagger.client.model.Pet;
|
||||||
|
import java.io.File;
|
||||||
|
import io.swagger.client.model.ModelApiResponse;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class PetApi {
|
||||||
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
public PetApi() {
|
||||||
|
this(Configuration.getDefaultApiClient());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PetApi(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient getApiClient() {
|
||||||
|
return apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiClient(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new pet to the store
|
||||||
|
*
|
||||||
|
* @param body Pet object that needs to be added to the store (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void addPet(Pet body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"application/json", "application/xml"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
* @param petId Pet id to delete (required)
|
||||||
|
* @param apiKey (optional)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
if (apiKey != null)
|
||||||
|
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds Pets by status
|
||||||
|
* Multiple status values can be provided with comma separated strings
|
||||||
|
* @param status Status values that need to be considered for filter (required)
|
||||||
|
* @return List<Pet>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'status' is set
|
||||||
|
if (status == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds Pets by tags
|
||||||
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* @param tags Tags to filter by (required)
|
||||||
|
* @return List<Pet>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'tags' is set
|
||||||
|
if (tags == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Find pet by ID
|
||||||
|
* Returns a single pet
|
||||||
|
* @param petId ID of pet to return (required)
|
||||||
|
* @return Pet
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public Pet getPetById(Long petId) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "api_key" };
|
||||||
|
|
||||||
|
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
* @param body Pet object that needs to be added to the store (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void updatePet(Pet body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"application/json", "application/xml"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Updates a pet in the store with form data
|
||||||
|
*
|
||||||
|
* @param petId ID of pet that needs to be updated (required)
|
||||||
|
* @param name Updated name of the pet (optional)
|
||||||
|
* @param status Updated status of the pet (optional)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void updatePetWithForm(Long petId, String name, String status) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (name != null)
|
||||||
|
localVarFormParams.put("name", name);
|
||||||
|
if (status != null)
|
||||||
|
localVarFormParams.put("status", status);
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"application/x-www-form-urlencoded"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* uploads an image
|
||||||
|
*
|
||||||
|
* @param petId ID of pet to update (required)
|
||||||
|
* @param additionalMetadata Additional data to pass to server (optional)
|
||||||
|
* @param file file to upload (optional)
|
||||||
|
* @return ModelApiResponse
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (additionalMetadata != null)
|
||||||
|
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||||
|
if (file != null)
|
||||||
|
localVarFormParams.put("file", file);
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
"multipart/form-data"
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,196 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.ApiException;
|
||||||
|
import io.swagger.client.ApiClient;
|
||||||
|
import io.swagger.client.Configuration;
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
|
import io.swagger.client.model.Order;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class StoreApi {
|
||||||
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
public StoreApi() {
|
||||||
|
this(Configuration.getDefaultApiClient());
|
||||||
|
}
|
||||||
|
|
||||||
|
public StoreApi(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient getApiClient() {
|
||||||
|
return apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiClient(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete purchase order by ID
|
||||||
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
* @param orderId ID of the order that needs to be deleted (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void deleteOrder(String orderId) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns pet inventories by status
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
* @return Map<String, Integer>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public Map<String, Integer> getInventory() throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "api_key" };
|
||||||
|
|
||||||
|
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Find purchase order by ID
|
||||||
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
* @param orderId ID of pet that needs to be fetched (required)
|
||||||
|
* @return Order
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public Order getOrderById(Long orderId) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Place an order for a pet
|
||||||
|
*
|
||||||
|
* @param body order placed for purchasing the pet (required)
|
||||||
|
* @return Order
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public Order placeOrder(Order body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,370 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.ApiException;
|
||||||
|
import io.swagger.client.ApiClient;
|
||||||
|
import io.swagger.client.Configuration;
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
|
import io.swagger.client.model.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class UserApi {
|
||||||
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
public UserApi() {
|
||||||
|
this(Configuration.getDefaultApiClient());
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserApi(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient getApiClient() {
|
||||||
|
return apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiClient(ApiClient apiClient) {
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param body Created user object (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void createUser(User body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param body List of user object (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param body List of user object (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username The name that needs to be deleted (required)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void deleteUser(String username) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
|
* @return User
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public User getUserByName(String username) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
GenericType<User> localVarReturnType = new GenericType<User>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Logs user into the system
|
||||||
|
*
|
||||||
|
* @param username The user name for login (required)
|
||||||
|
* @param password The password for login in clear text (required)
|
||||||
|
* @return String
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public String loginUser(String username, String password) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
// verify the required parameter 'password' is set
|
||||||
|
if (password == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void logoutUser() throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 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)
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public void updateUser(String username, User body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null) {
|
||||||
|
throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/xml", "application/json"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
|
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.auth;
|
||||||
|
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.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);
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.auth;
|
||||||
|
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import com.migcomponents.migbase64.Base64;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
|
||||||
|
public class HttpBasicAuth implements Authentication {
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||||
|
if (username == null && password == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
|
||||||
|
try {
|
||||||
|
headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false));
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.auth;
|
||||||
|
|
||||||
|
import io.swagger.client.Pair;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class OAuth implements Authentication {
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
public String getAccessToken() {
|
||||||
|
return accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccessToken(String accessToken) {
|
||||||
|
this.accessToken = accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||||
|
if (accessToken != null) {
|
||||||
|
headerParams.put("Authorization", "Bearer " + accessToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.auth;
|
||||||
|
|
||||||
|
public enum OAuthFlow {
|
||||||
|
accessCode, implicit, password, application
|
||||||
|
}
|
@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
|
||||||
|
ObjectUtils.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animal
|
||||||
|
*/
|
||||||
|
|
||||||
|
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
|
||||||
|
**/
|
||||||
|
@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 ObjectUtils.equals(this.className, animal.className) &&
|
||||||
|
ObjectUtils.equals(this.color, animal.color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import io.swagger.client.model.Animal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AnimalFarm
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayOfArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,165 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.arrayOfString, arrayTest.arrayOfString) &&
|
||||||
|
ObjectUtils.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
|
||||||
|
ObjectUtils.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cat
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.declawed, cat.declawed) &&
|
||||||
|
super.equals(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Category
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.id, category.id) &&
|
||||||
|
ObjectUtils.equals(this.name, category.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.client, client.client);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dog
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.breed, dog.breed) &&
|
||||||
|
super.equals(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,191 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EnumArrays
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.justSymbol, enumArrays.justSymbol) &&
|
||||||
|
ObjectUtils.equals(this.arrayEnum, enumArrays.arrayEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,237 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EnumTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@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 ObjectUtils.equals(this.enumString, enumTest.enumString) &&
|
||||||
|
ObjectUtils.equals(this.enumInteger, enumTest.enumInteger) &&
|
||||||
|
ObjectUtils.equals(this.enumNumber, enumTest.enumNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(enumString, enumInteger, enumNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@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("}");
|
||||||
|
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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,390 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FormatTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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 ObjectUtils.equals(this.integer, formatTest.integer) &&
|
||||||
|
ObjectUtils.equals(this.int32, formatTest.int32) &&
|
||||||
|
ObjectUtils.equals(this.int64, formatTest.int64) &&
|
||||||
|
ObjectUtils.equals(this.number, formatTest.number) &&
|
||||||
|
ObjectUtils.equals(this._float, formatTest._float) &&
|
||||||
|
ObjectUtils.equals(this._double, formatTest._double) &&
|
||||||
|
ObjectUtils.equals(this.string, formatTest.string) &&
|
||||||
|
ObjectUtils.equals(this._byte, formatTest._byte) &&
|
||||||
|
ObjectUtils.equals(this.binary, formatTest.binary) &&
|
||||||
|
ObjectUtils.equals(this.date, formatTest.date) &&
|
||||||
|
ObjectUtils.equals(this.dateTime, formatTest.dateTime) &&
|
||||||
|
ObjectUtils.equals(this.uuid, formatTest.uuid) &&
|
||||||
|
ObjectUtils.equals(this.password, formatTest.password);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HasOnlyReadOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.bar, hasOnlyReadOnly.bar) &&
|
||||||
|
ObjectUtils.equals(this.foo, hasOnlyReadOnly.foo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,167 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MapTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
|
||||||
|
ObjectUtils.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,157 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
|
||||||
|
ObjectUtils.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
|
||||||
|
ObjectUtils.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for testing model name starting with number
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "Model for testing model name starting with number")
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.name, _200Response.name) &&
|
||||||
|
ObjectUtils.equals(this.propertyClass, _200Response.propertyClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ModelApiResponse
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.code, _apiResponse.code) &&
|
||||||
|
ObjectUtils.equals(this.type, _apiResponse.type) &&
|
||||||
|
ObjectUtils.equals(this.message, _apiResponse.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for testing reserved words
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "Model for testing reserved words")
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this._return, _return._return);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(_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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,153 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for testing model name same as property name
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "Model for testing model name same as property name")
|
||||||
|
|
||||||
|
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
|
||||||
|
**/
|
||||||
|
@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 ObjectUtils.equals(this.name, name.name) &&
|
||||||
|
ObjectUtils.equals(this.snakeCase, name.snakeCase) &&
|
||||||
|
ObjectUtils.equals(this.property, name.property) &&
|
||||||
|
ObjectUtils.equals(this._123Number, name._123Number);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.justNumber, numberOnly.justNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,249 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Order
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.id, order.id) &&
|
||||||
|
ObjectUtils.equals(this.petId, order.petId) &&
|
||||||
|
ObjectUtils.equals(this.quantity, order.quantity) &&
|
||||||
|
ObjectUtils.equals(this.shipDate, order.shipDate) &&
|
||||||
|
ObjectUtils.equals(this.status, order.status) &&
|
||||||
|
ObjectUtils.equals(this.complete, order.complete);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,262 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pet
|
||||||
|
*/
|
||||||
|
|
||||||
|
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
|
||||||
|
**/
|
||||||
|
@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
|
||||||
|
**/
|
||||||
|
@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 ObjectUtils.equals(this.id, pet.id) &&
|
||||||
|
ObjectUtils.equals(this.category, pet.category) &&
|
||||||
|
ObjectUtils.equals(this.name, pet.name) &&
|
||||||
|
ObjectUtils.equals(this.photoUrls, pet.photoUrls) &&
|
||||||
|
ObjectUtils.equals(this.tags, pet.tags) &&
|
||||||
|
ObjectUtils.equals(this.status, pet.status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ReadOnlyFirst
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 ObjectUtils.equals(this.bar, readOnlyFirst.bar) &&
|
||||||
|
ObjectUtils.equals(this.baz, readOnlyFirst.baz);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Swagger Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SpecialModelName
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class SpecialModelName {
|
||||||
|
@JsonProperty("$special[property.name]")
|
||||||
|
private Long specialPropertyName = null;
|
||||||
|
|
||||||
|
public SpecialModelName specialPropertyName(Long specialPropertyName) {
|
||||||
|
this.specialPropertyName = specialPropertyName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get specialPropertyName
|
||||||
|
* @return specialPropertyName
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(example = "null", value = "")
|
||||||
|
public Long getSpecialPropertyName() {
|
||||||
|
return specialPropertyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecialPropertyName(Long specialPropertyName) {
|
||||||
|
this.specialPropertyName = specialPropertyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SpecialModelName specialModelName = (SpecialModelName) o;
|
||||||
|
return ObjectUtils.equals(this.specialPropertyName, specialModelName.specialPropertyName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ObjectUtils.hashCodeMulti(specialPropertyName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class SpecialModelName {\n");
|
||||||
|
|
||||||
|
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).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
Loading…
x
Reference in New Issue
Block a user