forked from loafle/openapi-generator-original
Merge pull request #2366 from wing328/git_push_sh
Add git_push.sh and .gitignore to client generators
This commit is contained in:
commit
d3f26f72d9
@ -157,6 +157,9 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toVarName(String name) {
|
public String toVarName(String name) {
|
||||||
|
// sanitize name
|
||||||
|
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
// replace - with _ e.g. created-at => created_at
|
// replace - with _ e.g. created-at => created_at
|
||||||
name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
@ -302,6 +305,8 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
(sourceFolder + File.separator + invokerPackage).replace(".", File.separator), "ApiException.java"));
|
(sourceFolder + File.separator + invokerPackage).replace(".", File.separator), "ApiException.java"));
|
||||||
supportingFiles.add(new SupportingFile("Pair.mustache",
|
supportingFiles.add(new SupportingFile("Pair.mustache",
|
||||||
(sourceFolder + File.separator + invokerPackage).replace(".", File.separator), "Pair.java"));
|
(sourceFolder + File.separator + invokerPackage).replace(".", File.separator), "Pair.java"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSupportingFilesForVolley() {
|
private void addSupportingFilesForVolley() {
|
||||||
|
@ -210,6 +210,9 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
||||||
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config"));
|
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config"));
|
||||||
supportingFiles.add(new SupportingFile("README.md", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.md", "", "README.md"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
|
|
||||||
if (optionalAssemblyInfoFlag) {
|
if (optionalAssemblyInfoFlag) {
|
||||||
supportingFiles.add(new SupportingFile("AssemblyInfo.mustache", packageFolder + File.separator + "Properties", "AssemblyInfo.cs"));
|
supportingFiles.add(new SupportingFile("AssemblyInfo.mustache", packageFolder + File.separator + "Properties", "AssemblyInfo.cs"));
|
||||||
|
@ -143,6 +143,8 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
final String baseNamespaceFolder = sourceFolder + File.separator + namespaceToFolder(baseNamespace);
|
final String baseNamespaceFolder = sourceFolder + File.separator + namespaceToFolder(baseNamespace);
|
||||||
supportingFiles.add(new SupportingFile("project.mustache", "", "project.clj"));
|
supportingFiles.add(new SupportingFile("project.mustache", "", "project.clj"));
|
||||||
supportingFiles.add(new SupportingFile("core.mustache", baseNamespaceFolder, "core.clj"));
|
supportingFiles.add(new SupportingFile("core.mustache", baseNamespaceFolder, "core.clj"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -150,6 +150,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("auth/http_basic_auth.mustache", authFolder, "http_basic_auth.dart"));
|
supportingFiles.add(new SupportingFile("auth/http_basic_auth.mustache", authFolder, "http_basic_auth.dart"));
|
||||||
supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart"));
|
supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart"));
|
||||||
supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart"));
|
supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,6 +153,8 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
+ File.separator + "lib" + File.separator + "ext", "flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc"));
|
+ File.separator + "lib" + File.separator + "ext", "flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc"));
|
||||||
supportingFiles.add(new SupportingFile("flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc", sourceFolder
|
supportingFiles.add(new SupportingFile("flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc", sourceFolder
|
||||||
+ File.separator + "lib" + File.separator + "ext", "flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc"));
|
+ File.separator + "lib" + File.separator + "ext", "flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String dropDots(String str) {
|
private static String dropDots(String str) {
|
||||||
|
@ -129,6 +129,8 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
apiPackage = packageName;
|
apiPackage = packageName;
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -301,6 +301,10 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
importMapping.put("LocalDate", "java.time.LocalDate");
|
importMapping.put("LocalDate", "java.time.LocalDate");
|
||||||
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
|
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean usesAnyRetrofitLibrary() {
|
private boolean usesAnyRetrofitLibrary() {
|
||||||
|
@ -241,6 +241,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
|
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
|
||||||
supportingFiles.add(new SupportingFile("index.mustache", sourceFolder, "index.js"));
|
supportingFiles.add(new SupportingFile("index.mustache", sourceFolder, "index.js"));
|
||||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", sourceFolder, "ApiClient.js"));
|
supportingFiles.add(new SupportingFile("ApiClient.mustache", sourceFolder, "ApiClient.js"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -220,6 +220,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("Configuration-header.mustache", swaggerFolder, classPrefix + "Configuration.h"));
|
supportingFiles.add(new SupportingFile("Configuration-header.mustache", swaggerFolder, classPrefix + "Configuration.h"));
|
||||||
supportingFiles.add(new SupportingFile("podspec.mustache", "", podName + ".podspec"));
|
supportingFiles.add(new SupportingFile("podspec.mustache", "", podName + ".podspec"));
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -225,6 +225,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("autoload.mustache", getPackagePath(), "autoload.php"));
|
supportingFiles.add(new SupportingFile("autoload.mustache", getPackagePath(), "autoload.php"));
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md"));
|
||||||
supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml"));
|
supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -110,6 +110,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
supportingFiles.add(new SupportingFile("__init__package.mustache", swaggerFolder, "__init__.py"));
|
supportingFiles.add(new SupportingFile("__init__package.mustache", swaggerFolder, "__init__.py"));
|
||||||
supportingFiles.add(new SupportingFile("__init__model.mustache", modelPackage, "__init__.py"));
|
supportingFiles.add(new SupportingFile("__init__model.mustache", modelPackage, "__init__.py"));
|
||||||
supportingFiles.add(new SupportingFile("__init__api.mustache", apiPackage, "__init__.py"));
|
supportingFiles.add(new SupportingFile("__init__api.mustache", apiPackage, "__init__.py"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String dropDots(String str) {
|
private static String dropDots(String str) {
|
||||||
|
@ -220,6 +220,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb"));
|
supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb"));
|
||||||
supportingFiles.add(new SupportingFile("version.mustache", gemFolder, "version.rb"));
|
supportingFiles.add(new SupportingFile("version.mustache", gemFolder, "version.rb"));
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,8 @@ public class ScalaClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||||
supportingFiles.add(new SupportingFile("apiInvoker.mustache",
|
supportingFiles.add(new SupportingFile("apiInvoker.mustache",
|
||||||
(sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), "ApiInvoker.scala"));
|
(sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), "ApiInvoker.scala"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
importMapping.remove("List");
|
importMapping.remove("List");
|
||||||
importMapping.remove("Set");
|
importMapping.remove("Set");
|
||||||
@ -110,6 +112,7 @@ public class ScalaClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
"Long",
|
"Long",
|
||||||
"Float",
|
"Float",
|
||||||
"Object",
|
"Object",
|
||||||
|
"Any",
|
||||||
"List",
|
"List",
|
||||||
"Map")
|
"Map")
|
||||||
);
|
);
|
||||||
@ -255,4 +258,60 @@ public class ScalaClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toVarName(String name) {
|
||||||
|
// sanitize name
|
||||||
|
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
|
if("_".equals(name)) {
|
||||||
|
name = "_u";
|
||||||
|
}
|
||||||
|
|
||||||
|
// if it's all uppper case, do nothing
|
||||||
|
if (name.matches("^[A-Z_]*$")) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// camelize (lower first character) the variable name
|
||||||
|
// pet_id => petId
|
||||||
|
name = camelize(name, true);
|
||||||
|
|
||||||
|
// for reserved word or word starting with number, append _
|
||||||
|
if (isReservedWord(name) || name.matches("^\\d.*")) {
|
||||||
|
name = escapeReservedWord(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toParamName(String name) {
|
||||||
|
// should be the same as variable name
|
||||||
|
return toVarName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelName(final String name) {
|
||||||
|
final String sanitizedName = sanitizeName(modelNamePrefix + name + modelNameSuffix);
|
||||||
|
|
||||||
|
// camelize the model name
|
||||||
|
// phone_number => PhoneNumber
|
||||||
|
final String camelizedName = camelize(sanitizedName);
|
||||||
|
|
||||||
|
// model name cannot use reserved keyword, e.g. return
|
||||||
|
if (isReservedWord(camelizedName)) {
|
||||||
|
final String modelName = "Model" + camelizedName;
|
||||||
|
LOGGER.warn(camelizedName + " (reserved word) cannot be used as model name. Renamed to " + modelName);
|
||||||
|
return modelName;
|
||||||
|
}
|
||||||
|
|
||||||
|
return camelizedName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelFilename(String name) {
|
||||||
|
// should be the same as the model name
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -195,6 +195,9 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift"));
|
supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift"));
|
||||||
supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift"));
|
supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift"));
|
||||||
supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift"));
|
supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,6 +19,10 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
|||||||
public void processOpts() {
|
public void processOpts() {
|
||||||
super.processOpts();
|
super.processOpts();
|
||||||
supportingFiles.add(new SupportingFile("api.d.mustache", apiPackage().replace('.', File.separatorChar), "api.d.ts"));
|
supportingFiles.add(new SupportingFile("api.d.mustache", apiPackage().replace('.', File.separatorChar), "api.d.ts"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
//supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TypeScriptAngularClientCodegen() {
|
public TypeScriptAngularClientCodegen() {
|
||||||
|
@ -18,6 +18,8 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
|
|||||||
public void processOpts() {
|
public void processOpts() {
|
||||||
super.processOpts();
|
super.processOpts();
|
||||||
supportingFiles.add(new SupportingFile("api.mustache", null, "api.ts"));
|
supportingFiles.add(new SupportingFile("api.mustache", null, "api.ts"));
|
||||||
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
|
//supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public TypeScriptNodeClientCodegen() {
|
public TypeScriptNodeClientCodegen() {
|
||||||
|
52
modules/swagger-codegen/src/main/resources/Java/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/Java/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,12 @@
|
|||||||
|
*.class
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
52
modules/swagger-codegen/src/main/resources/Javascript/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/Javascript/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,33 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directory
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
@ -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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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'
|
||||||
|
|
52
modules/swagger-codegen/src/main/resources/android/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/android/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,39 @@
|
|||||||
|
# Built application files
|
||||||
|
*.apk
|
||||||
|
*.ap_
|
||||||
|
|
||||||
|
# Files for the Dalvik VM
|
||||||
|
*.dex
|
||||||
|
|
||||||
|
# Java class files
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
bin/
|
||||||
|
gen/
|
||||||
|
out/
|
||||||
|
|
||||||
|
# Gradle files
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Local configuration file (sdk path, etc)
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
# Proguard folder generated by Eclipse
|
||||||
|
proguard/
|
||||||
|
|
||||||
|
# Log Files
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Android Studio Navigation editor temp files
|
||||||
|
.navigation/
|
||||||
|
|
||||||
|
# Android Studio captures folder
|
||||||
|
captures/
|
||||||
|
|
||||||
|
# Intellij
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
#Keystore files
|
||||||
|
*.jks
|
52
modules/swagger-codegen/src/main/resources/clojure/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/clojure/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,12 @@
|
|||||||
|
pom.xml
|
||||||
|
pom.xml.asc
|
||||||
|
*jar
|
||||||
|
/lib/
|
||||||
|
/classes/
|
||||||
|
/target/
|
||||||
|
/checkouts/
|
||||||
|
.lein-deps-sum
|
||||||
|
.lein-repl-history
|
||||||
|
.lein-plugins/
|
||||||
|
.lein-failures
|
||||||
|
.nrepl-port
|
52
modules/swagger-codegen/src/main/resources/csharp/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/csharp/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,185 @@
|
|||||||
|
# Ref: https://gist.github.com/kmorcinek/2710267
|
||||||
|
# Download this file using PowerShell v3 under Windows with the following comand
|
||||||
|
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/packages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/packages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/packages/repositories.config
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# OS generated files #
|
||||||
|
.DS_Store*
|
||||||
|
ehthumbs.db
|
||||||
|
Icon?
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
modulesbin/
|
||||||
|
tempbin/
|
||||||
|
|
||||||
|
# EPiServer Site file (VPP)
|
||||||
|
AppData/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# vim
|
||||||
|
*.txt~
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# svn
|
||||||
|
.svn
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
**/App_Data/*.mdf
|
||||||
|
**/App_Data/*.ldf
|
||||||
|
**/App_Data/*.sdf
|
||||||
|
|
||||||
|
|
||||||
|
#LightSwitch generated files
|
||||||
|
GeneratedArtifacts/
|
||||||
|
_Pvt_Extensions/
|
||||||
|
ModelManifest.xml
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Windows detritus
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac desktop service store files
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# SASS Compiler cache
|
||||||
|
.sass-cache
|
||||||
|
|
||||||
|
# Visual Studio 2014 CTP
|
||||||
|
**/*.sln.ide
|
52
modules/swagger-codegen/src/main/resources/dart/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/dart/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,27 @@
|
|||||||
|
# See https://www.dartlang.org/tools/private-files.html
|
||||||
|
|
||||||
|
# Files and directories created by pub
|
||||||
|
.buildlog
|
||||||
|
.packages
|
||||||
|
.project
|
||||||
|
.pub/
|
||||||
|
build/
|
||||||
|
**/packages/
|
||||||
|
|
||||||
|
# Files created by dart2js
|
||||||
|
# (Most Dart developers will use pub build to compile Dart, use/modify these
|
||||||
|
# rules if you intend to use dart2js directly
|
||||||
|
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
|
||||||
|
# differentiate from explicit Javascript files)
|
||||||
|
*.dart.js
|
||||||
|
*.part.js
|
||||||
|
*.js.deps
|
||||||
|
*.js.map
|
||||||
|
*.info.json
|
||||||
|
|
||||||
|
# Directory created by dartdoc
|
||||||
|
doc/api/
|
||||||
|
|
||||||
|
# Don't commit pubspec lock file
|
||||||
|
# (Library packages only! Remove pattern if developing an application package)
|
||||||
|
pubspec.lock
|
11
modules/swagger-codegen/src/main/resources/flash/.gitignore
vendored
Normal file
11
modules/swagger-codegen/src/main/resources/flash/.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Build and Release Folders
|
||||||
|
bin/
|
||||||
|
bin-debug/
|
||||||
|
bin-release/
|
||||||
|
|
||||||
|
# Other files and folders
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||||
|
# should NOT be excluded as they contain compiler settings and other important
|
||||||
|
# information for Eclipse / Flash Builder.
|
52
modules/swagger-codegen/src/main/resources/go/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/go/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,24 @@
|
|||||||
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Folders
|
||||||
|
_obj
|
||||||
|
_test
|
||||||
|
|
||||||
|
# Architecture specific extensions/prefixes
|
||||||
|
*.[568vq]
|
||||||
|
[568vq].out
|
||||||
|
|
||||||
|
*.cgo1.go
|
||||||
|
*.cgo2.c
|
||||||
|
_cgo_defun.c
|
||||||
|
_cgo_gotypes.go
|
||||||
|
_cgo_export.*
|
||||||
|
|
||||||
|
_testmain.go
|
||||||
|
|
||||||
|
*.exe
|
||||||
|
*.test
|
||||||
|
*.prof
|
52
modules/swagger-codegen/src/main/resources/objc/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/objc/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,53 @@
|
|||||||
|
# Xcode
|
||||||
|
#
|
||||||
|
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||||
|
|
||||||
|
## Build generated
|
||||||
|
build/
|
||||||
|
DerivedData
|
||||||
|
|
||||||
|
## Various settings
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
|
||||||
|
## Other
|
||||||
|
*.xccheckout
|
||||||
|
*.moved-aside
|
||||||
|
*.xcuserstate
|
||||||
|
*.xcscmblueprint
|
||||||
|
|
||||||
|
## Obj-C/Swift specific
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
|
||||||
|
# CocoaPods
|
||||||
|
#
|
||||||
|
# We recommend against adding the Pods directory to your .gitignore. However
|
||||||
|
# you should judge for yourself, the pros and cons are mentioned at:
|
||||||
|
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||||
|
#
|
||||||
|
# Pods/
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
#
|
||||||
|
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||||
|
# Carthage/Checkouts
|
||||||
|
|
||||||
|
Carthage/Build
|
||||||
|
|
||||||
|
# fastlane
|
||||||
|
#
|
||||||
|
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||||
|
# screenshots whenever they are needed.
|
||||||
|
# For more information about the recommended setup visit:
|
||||||
|
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
|
||||||
|
|
||||||
|
fastlane/report.xml
|
||||||
|
fastlane/screenshots
|
52
modules/swagger-codegen/src/main/resources/php/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/php/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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'
|
||||||
|
|
52
modules/swagger-codegen/src/main/resources/python/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/python/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,62 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
env/
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*,cover
|
||||||
|
.hypothesis/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
#Ipython Notebook
|
||||||
|
.ipynb_checkpoints
|
52
modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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'
|
||||||
|
|
52
modules/swagger-codegen/src/main/resources/scala/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/scala/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,17 @@
|
|||||||
|
*.class
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# sbt specific
|
||||||
|
.cache
|
||||||
|
.history
|
||||||
|
.lib/
|
||||||
|
dist/*
|
||||||
|
target/
|
||||||
|
lib_managed/
|
||||||
|
src_managed/
|
||||||
|
project/boot/
|
||||||
|
project/plugins/project/
|
||||||
|
|
||||||
|
# Scala-IDE specific
|
||||||
|
.scala_dependencies
|
||||||
|
.worksheet
|
52
modules/swagger-codegen/src/main/resources/swift/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/swift/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="{{{gitRepoId}}}"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="{{{releaseNote}}}"
|
||||||
|
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,63 @@
|
|||||||
|
# Xcode
|
||||||
|
#
|
||||||
|
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||||
|
|
||||||
|
## Build generated
|
||||||
|
build/
|
||||||
|
DerivedData
|
||||||
|
|
||||||
|
## Various settings
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
|
||||||
|
## Other
|
||||||
|
*.xccheckout
|
||||||
|
*.moved-aside
|
||||||
|
*.xcuserstate
|
||||||
|
*.xcscmblueprint
|
||||||
|
|
||||||
|
## Obj-C/Swift specific
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
|
||||||
|
## Playgrounds
|
||||||
|
timeline.xctimeline
|
||||||
|
playground.xcworkspace
|
||||||
|
|
||||||
|
# Swift Package Manager
|
||||||
|
#
|
||||||
|
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
|
||||||
|
# Packages/
|
||||||
|
.build/
|
||||||
|
|
||||||
|
# CocoaPods
|
||||||
|
#
|
||||||
|
# We recommend against adding the Pods directory to your .gitignore. However
|
||||||
|
# you should judge for yourself, the pros and cons are mentioned at:
|
||||||
|
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||||
|
#
|
||||||
|
# Pods/
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
#
|
||||||
|
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||||
|
# Carthage/Checkouts
|
||||||
|
|
||||||
|
Carthage/Build
|
||||||
|
|
||||||
|
# fastlane
|
||||||
|
#
|
||||||
|
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||||
|
# screenshots whenever they are needed.
|
||||||
|
# For more information about the recommended setup visit:
|
||||||
|
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
|
||||||
|
|
||||||
|
fastlane/report.xml
|
||||||
|
fastlane/screenshots
|
39
samples/client/petstore/android/default/.gitignore
vendored
Normal file
39
samples/client/petstore/android/default/.gitignore
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Built application files
|
||||||
|
*.apk
|
||||||
|
*.ap_
|
||||||
|
|
||||||
|
# Files for the Dalvik VM
|
||||||
|
*.dex
|
||||||
|
|
||||||
|
# Java class files
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
bin/
|
||||||
|
gen/
|
||||||
|
out/
|
||||||
|
|
||||||
|
# Gradle files
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Local configuration file (sdk path, etc)
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
# Proguard folder generated by Eclipse
|
||||||
|
proguard/
|
||||||
|
|
||||||
|
# Log Files
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Android Studio Navigation editor temp files
|
||||||
|
.navigation/
|
||||||
|
|
||||||
|
# Android Studio captures folder
|
||||||
|
captures/
|
||||||
|
|
||||||
|
# Intellij
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
#Keystore files
|
||||||
|
*.jks
|
52
samples/client/petstore/android/default/git_push.sh
Normal file
52
samples/client/petstore/android/default/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="YOUR_GIT_USR_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="YOUR_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'
|
||||||
|
|
@ -35,24 +35,40 @@ public class JsonUtil {
|
|||||||
public static Type getListTypeForDeserialization(Class cls) {
|
public static Type getListTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
|
if ("Category".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<List<Category>>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<List<InlineResponse200>>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("ModelReturn".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<List<ModelReturn>>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("Name".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<List<Name>>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Order>>(){}.getType();
|
return new TypeToken<List<Order>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("User".equalsIgnoreCase(className)) {
|
if ("Pet".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<User>>(){}.getType();
|
return new TypeToken<List<Pet>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Category".equalsIgnoreCase(className)) {
|
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Category>>(){}.getType();
|
return new TypeToken<List<SpecialModelName>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Tag>>(){}.getType();
|
return new TypeToken<List<Tag>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Pet".equalsIgnoreCase(className)) {
|
if ("User".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Pet>>(){}.getType();
|
return new TypeToken<List<User>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TypeToken<List<Object>>(){}.getType();
|
return new TypeToken<List<Object>>(){}.getType();
|
||||||
@ -61,26 +77,42 @@ public class JsonUtil {
|
|||||||
public static Type getTypeForDeserialization(Class cls) {
|
public static Type getTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Order>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("User".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<User>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Category".equalsIgnoreCase(className)) {
|
if ("Category".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Category>(){}.getType();
|
return new TypeToken<Category>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Tag>(){}.getType();
|
return new TypeToken<InlineResponse200>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("ModelReturn".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<ModelReturn>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("Name".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<Name>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<Order>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Pet".equalsIgnoreCase(className)) {
|
if ("Pet".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Pet>(){}.getType();
|
return new TypeToken<Pet>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<SpecialModelName>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<Tag>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("User".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<User>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
return new TypeToken<Object>(){}.getType();
|
return new TypeToken<Object>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import io.swagger.client.model.*;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import io.swagger.client.model.Pet;
|
import io.swagger.client.model.Pet;
|
||||||
|
import io.swagger.client.model.InlineResponse200;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
@ -38,59 +39,6 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update an existing pet
|
|
||||||
*
|
|
||||||
* @param body Pet object that needs to be added to the store
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public void updatePet (Pet body) throws ApiException {
|
|
||||||
Object localVarPostBody = body;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
"application/json","application/xml"
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
@ -144,6 +92,120 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
*
|
||||||
|
* @param body Pet object in the form of byte array
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public void addPetUsingByteArray (byte[] body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
"application/json","application/xml"
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
* @param petId Pet id to delete
|
||||||
|
* @param apiKey
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
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" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey));
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
@ -312,6 +374,175 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param petId ID of pet that needs to be fetched
|
||||||
|
* @return InlineResponse200
|
||||||
|
*/
|
||||||
|
public InlineResponse200 getPetByIdInObject (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 getPetByIdInObject");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (InlineResponse200) ApiInvoker.deserialize(localVarResponse, "", InlineResponse200.class);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param petId ID of pet that needs to be fetched
|
||||||
|
* @return byte[]
|
||||||
|
*/
|
||||||
|
public byte[] petPetIdtestingByteArraytrueGet (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 petPetIdtestingByteArraytrueGet");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (byte[]) ApiInvoker.deserialize(localVarResponse, "", byte[].class);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
* @param body Pet object that needs to be added to the store
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public void updatePet (Pet body) throws ApiException {
|
||||||
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
"application/json","application/xml"
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a pet in the store with form data
|
* Updates a pet in the store with form data
|
||||||
*
|
*
|
||||||
@ -382,67 +613,6 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes a pet
|
|
||||||
*
|
|
||||||
* @param petId Pet id to delete
|
|
||||||
* @param apiKey
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
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" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey));
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploads an image
|
* uploads an image
|
||||||
*
|
*
|
||||||
@ -513,115 +683,4 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
* @return byte[]
|
|
||||||
*/
|
|
||||||
public byte[] petPetIdtestingByteArraytrueGet (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 petPetIdtestingByteArraytrueGet");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (byte[]) ApiInvoker.deserialize(localVarResponse, "", byte[].class);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
*
|
|
||||||
* @param body Pet object in the form of byte array
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public void addPetUsingByteArray (byte[] body) throws ApiException {
|
|
||||||
Object localVarPostBody = body;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
"application/json","application/xml"
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,64 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
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" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds orders by status
|
* Finds orders by status
|
||||||
* A single status value can be provided as a string
|
* A single status value can be provided as a string
|
||||||
@ -146,17 +204,16 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place an order for a pet
|
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
*
|
* Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
* @param body order placed for purchasing the pet
|
* @return Object
|
||||||
* @return Order
|
|
||||||
*/
|
*/
|
||||||
public Order placeOrder (Order body) throws ApiException {
|
public Object getInventoryInObject () throws ApiException {
|
||||||
Object localVarPostBody = body;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
@ -186,9 +243,9 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(localVarResponse != null){
|
if(localVarResponse != null){
|
||||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -257,22 +314,17 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete purchase order by ID
|
* Place an order for a pet
|
||||||
* 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
|
* @param body order placed for purchasing the pet
|
||||||
* @return void
|
* @return Order
|
||||||
*/
|
*/
|
||||||
public void deleteOrder (String orderId) throws ApiException {
|
public Order placeOrder (Order body) throws ApiException {
|
||||||
Object localVarPostBody = null;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// 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
|
// create path and map variables
|
||||||
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
@ -302,12 +354,12 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(localVarResponse != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return ;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (ApiException ex) {
|
} catch (ApiException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
@ -197,6 +197,122 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username The name that needs to be deleted
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
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" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
|
* @return User
|
||||||
|
*/
|
||||||
|
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" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
localVarPostBody = localVarBuilder.build();
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs user into the system
|
* Logs user into the system
|
||||||
*
|
*
|
||||||
@ -307,64 +423,6 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get user by user name
|
|
||||||
*
|
|
||||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
|
||||||
* @return User
|
|
||||||
*/
|
|
||||||
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" + "\\}", apiInvoker.escapeString(username.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updated user
|
* Updated user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -424,62 +482,4 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete user
|
|
||||||
* This can only be done by the logged in user.
|
|
||||||
* @param username The name that needs to be deleted
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
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" + "\\}", apiInvoker.escapeString(username.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,112 @@
|
|||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import io.swagger.client.model.Tag;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(description = "")
|
||||||
|
public class InlineResponse200 {
|
||||||
|
|
||||||
|
@SerializedName("tags")
|
||||||
|
private List<Tag> tags = null;
|
||||||
|
@SerializedName("id")
|
||||||
|
private Long id = null;
|
||||||
|
@SerializedName("category")
|
||||||
|
private Object category = null;
|
||||||
|
public enum StatusEnum {
|
||||||
|
available, pending, sold,
|
||||||
|
};
|
||||||
|
@SerializedName("status")
|
||||||
|
private StatusEnum status = null;
|
||||||
|
@SerializedName("name")
|
||||||
|
private String name = null;
|
||||||
|
@SerializedName("photoUrls")
|
||||||
|
private List<String> photoUrls = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<Tag> getTags() {
|
||||||
|
return tags;
|
||||||
|
}
|
||||||
|
public void setTags(List<Tag> tags) {
|
||||||
|
this.tags = tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(required = true, value = "")
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Object getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
public void setCategory(Object category) {
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pet status in the store
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "pet status in the store")
|
||||||
|
public StatusEnum getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
public void setStatus(StatusEnum status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<String> getPhotoUrls() {
|
||||||
|
return photoUrls;
|
||||||
|
}
|
||||||
|
public void setPhotoUrls(List<String> photoUrls) {
|
||||||
|
this.photoUrls = photoUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class InlineResponse200 {\n");
|
||||||
|
|
||||||
|
sb.append(" tags: ").append(tags).append("\n");
|
||||||
|
sb.append(" id: ").append(id).append("\n");
|
||||||
|
sb.append(" category: ").append(category).append("\n");
|
||||||
|
sb.append(" status: ").append(status).append("\n");
|
||||||
|
sb.append(" name: ").append(name).append("\n");
|
||||||
|
sb.append(" photoUrls: ").append(photoUrls).append("\n");
|
||||||
|
sb.append("}\n");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(description = "")
|
||||||
|
public class ModelReturn {
|
||||||
|
|
||||||
|
@SerializedName("return")
|
||||||
|
private Integer _return = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getReturn() {
|
||||||
|
return _return;
|
||||||
|
}
|
||||||
|
public void setReturn(Integer _return) {
|
||||||
|
this._return = _return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class ModelReturn {\n");
|
||||||
|
|
||||||
|
sb.append(" _return: ").append(_return).append("\n");
|
||||||
|
sb.append("}\n");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(description = "")
|
||||||
|
public class Name {
|
||||||
|
|
||||||
|
@SerializedName("name")
|
||||||
|
private Integer name = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(Integer name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Name {\n");
|
||||||
|
|
||||||
|
sb.append(" name: ").append(name).append("\n");
|
||||||
|
sb.append("}\n");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(description = "")
|
||||||
|
public class SpecialModelName {
|
||||||
|
|
||||||
|
@SerializedName("$special[property.name]")
|
||||||
|
private Long specialPropertyName = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Long getSpecialPropertyName() {
|
||||||
|
return specialPropertyName;
|
||||||
|
}
|
||||||
|
public void setSpecialPropertyName(Long specialPropertyName) {
|
||||||
|
this.specialPropertyName = specialPropertyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class SpecialModelName {\n");
|
||||||
|
|
||||||
|
sb.append(" specialPropertyName: ").append(specialPropertyName).append("\n");
|
||||||
|
sb.append("}\n");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
20
samples/client/petstore/clojure/.gitignore
vendored
20
samples/client/petstore/clojure/.gitignore
vendored
@ -1,10 +1,12 @@
|
|||||||
/target
|
pom.xml
|
||||||
/classes
|
|
||||||
/checkouts
|
|
||||||
pom.xml.asc
|
pom.xml.asc
|
||||||
*.jar
|
*jar
|
||||||
*.class
|
/lib/
|
||||||
/.lein-*
|
/classes/
|
||||||
/.nrepl-port
|
/target/
|
||||||
.hgignore
|
/checkouts/
|
||||||
.hg/
|
.lein-deps-sum
|
||||||
|
.lein-repl-history
|
||||||
|
.lein-plugins/
|
||||||
|
.lein-failures
|
||||||
|
.nrepl-port
|
||||||
|
52
samples/client/petstore/clojure/git_push.sh
Normal file
52
samples/client/petstore/clojure/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="YOUR_GIT_USR_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="YOUR_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'
|
||||||
|
|
@ -2,28 +2,6 @@
|
|||||||
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
||||||
(:import (java.io File)))
|
(:import (java.io File)))
|
||||||
|
|
||||||
(defn update-pet-with-http-info
|
|
||||||
"Update an existing pet
|
|
||||||
"
|
|
||||||
([] (update-pet-with-http-info nil))
|
|
||||||
([{:keys [body ]}]
|
|
||||||
(call-api "/pet" :put
|
|
||||||
{:path-params {}
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:body-param body
|
|
||||||
:content-types ["application/json" "application/xml"]
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names ["petstore_auth"]})))
|
|
||||||
|
|
||||||
(defn update-pet
|
|
||||||
"Update an existing pet
|
|
||||||
"
|
|
||||||
([] (update-pet nil))
|
|
||||||
([optional-params]
|
|
||||||
(:data (update-pet-with-http-info optional-params))))
|
|
||||||
|
|
||||||
(defn add-pet-with-http-info
|
(defn add-pet-with-http-info
|
||||||
"Add a new pet to the store
|
"Add a new pet to the store
|
||||||
"
|
"
|
||||||
@ -46,6 +24,49 @@
|
|||||||
([optional-params]
|
([optional-params]
|
||||||
(:data (add-pet-with-http-info optional-params))))
|
(:data (add-pet-with-http-info optional-params))))
|
||||||
|
|
||||||
|
(defn add-pet-using-byte-array-with-http-info
|
||||||
|
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
"
|
||||||
|
([] (add-pet-using-byte-array-with-http-info nil))
|
||||||
|
([{:keys [body ]}]
|
||||||
|
(call-api "/pet?testing_byte_array=true" :post
|
||||||
|
{:path-params {}
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:body-param body
|
||||||
|
:content-types ["application/json" "application/xml"]
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["petstore_auth"]})))
|
||||||
|
|
||||||
|
(defn add-pet-using-byte-array
|
||||||
|
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
"
|
||||||
|
([] (add-pet-using-byte-array nil))
|
||||||
|
([optional-params]
|
||||||
|
(:data (add-pet-using-byte-array-with-http-info optional-params))))
|
||||||
|
|
||||||
|
(defn delete-pet-with-http-info
|
||||||
|
"Deletes a pet
|
||||||
|
"
|
||||||
|
([pet-id ] (delete-pet-with-http-info pet-id nil))
|
||||||
|
([pet-id {:keys [api-key ]}]
|
||||||
|
(call-api "/pet/{petId}" :delete
|
||||||
|
{:path-params {"petId" pet-id }
|
||||||
|
:header-params {"api_key" api-key }
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["petstore_auth"]})))
|
||||||
|
|
||||||
|
(defn delete-pet
|
||||||
|
"Deletes a pet
|
||||||
|
"
|
||||||
|
([pet-id ] (delete-pet pet-id nil))
|
||||||
|
([pet-id optional-params]
|
||||||
|
(:data (delete-pet-with-http-info pet-id optional-params))))
|
||||||
|
|
||||||
(defn find-pets-by-status-with-http-info
|
(defn find-pets-by-status-with-http-info
|
||||||
"Finds Pets by status
|
"Finds Pets by status
|
||||||
Multiple status values can be provided with comma separated strings"
|
Multiple status values can be provided with comma separated strings"
|
||||||
@ -99,7 +120,7 @@
|
|||||||
:form-params {}
|
:form-params {}
|
||||||
:content-types []
|
:content-types []
|
||||||
:accepts ["application/json" "application/xml"]
|
:accepts ["application/json" "application/xml"]
|
||||||
:auth-names ["petstore_auth" "api_key"]}))
|
:auth-names ["api_key" "petstore_auth"]}))
|
||||||
|
|
||||||
(defn get-pet-by-id
|
(defn get-pet-by-id
|
||||||
"Find pet by ID
|
"Find pet by ID
|
||||||
@ -107,6 +128,66 @@
|
|||||||
[pet-id ]
|
[pet-id ]
|
||||||
(:data (get-pet-by-id-with-http-info pet-id)))
|
(:data (get-pet-by-id-with-http-info pet-id)))
|
||||||
|
|
||||||
|
(defn get-pet-by-id-in-object-with-http-info
|
||||||
|
"Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||||
|
[pet-id ]
|
||||||
|
(call-api "/pet/{petId}?response=inline_arbitrary_object" :get
|
||||||
|
{:path-params {"petId" pet-id }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["api_key" "petstore_auth"]}))
|
||||||
|
|
||||||
|
(defn get-pet-by-id-in-object
|
||||||
|
"Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||||
|
[pet-id ]
|
||||||
|
(:data (get-pet-by-id-in-object-with-http-info pet-id)))
|
||||||
|
|
||||||
|
(defn pet-pet-idtesting-byte-arraytrue-get-with-http-info
|
||||||
|
"Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||||
|
[pet-id ]
|
||||||
|
(call-api "/pet/{petId}?testing_byte_array=true" :get
|
||||||
|
{:path-params {"petId" pet-id }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["api_key" "petstore_auth"]}))
|
||||||
|
|
||||||
|
(defn pet-pet-idtesting-byte-arraytrue-get
|
||||||
|
"Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||||
|
[pet-id ]
|
||||||
|
(:data (pet-pet-idtesting-byte-arraytrue-get-with-http-info pet-id)))
|
||||||
|
|
||||||
|
(defn update-pet-with-http-info
|
||||||
|
"Update an existing pet
|
||||||
|
"
|
||||||
|
([] (update-pet-with-http-info nil))
|
||||||
|
([{:keys [body ]}]
|
||||||
|
(call-api "/pet" :put
|
||||||
|
{:path-params {}
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:body-param body
|
||||||
|
:content-types ["application/json" "application/xml"]
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["petstore_auth"]})))
|
||||||
|
|
||||||
|
(defn update-pet
|
||||||
|
"Update an existing pet
|
||||||
|
"
|
||||||
|
([] (update-pet nil))
|
||||||
|
([optional-params]
|
||||||
|
(:data (update-pet-with-http-info optional-params))))
|
||||||
|
|
||||||
(defn update-pet-with-form-with-http-info
|
(defn update-pet-with-form-with-http-info
|
||||||
"Updates a pet in the store with form data
|
"Updates a pet in the store with form data
|
||||||
"
|
"
|
||||||
@ -128,27 +209,6 @@
|
|||||||
([pet-id optional-params]
|
([pet-id optional-params]
|
||||||
(:data (update-pet-with-form-with-http-info pet-id optional-params))))
|
(:data (update-pet-with-form-with-http-info pet-id optional-params))))
|
||||||
|
|
||||||
(defn delete-pet-with-http-info
|
|
||||||
"Deletes a pet
|
|
||||||
"
|
|
||||||
([pet-id ] (delete-pet-with-http-info pet-id nil))
|
|
||||||
([pet-id {:keys [api-key ]}]
|
|
||||||
(call-api "/pet/{petId}" :delete
|
|
||||||
{:path-params {"petId" pet-id }
|
|
||||||
:header-params {"api_key" api-key }
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:content-types []
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names ["petstore_auth"]})))
|
|
||||||
|
|
||||||
(defn delete-pet
|
|
||||||
"Deletes a pet
|
|
||||||
"
|
|
||||||
([pet-id ] (delete-pet pet-id nil))
|
|
||||||
([pet-id optional-params]
|
|
||||||
(:data (delete-pet-with-http-info pet-id optional-params))))
|
|
||||||
|
|
||||||
(defn upload-file-with-http-info
|
(defn upload-file-with-http-info
|
||||||
"uploads an image
|
"uploads an image
|
||||||
"
|
"
|
||||||
@ -169,44 +229,3 @@
|
|||||||
([pet-id ] (upload-file pet-id nil))
|
([pet-id ] (upload-file pet-id nil))
|
||||||
([pet-id optional-params]
|
([pet-id optional-params]
|
||||||
(:data (upload-file-with-http-info pet-id optional-params))))
|
(:data (upload-file-with-http-info pet-id optional-params))))
|
||||||
|
|
||||||
(defn pet-pet-idtesting-byte-arraytrue-get-with-http-info
|
|
||||||
"Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
|
||||||
[pet-id ]
|
|
||||||
(call-api "/pet/{petId}?testing_byte_array=true" :get
|
|
||||||
{:path-params {"petId" pet-id }
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:content-types []
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names ["petstore_auth" "api_key"]}))
|
|
||||||
|
|
||||||
(defn pet-pet-idtesting-byte-arraytrue-get
|
|
||||||
"Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
|
||||||
[pet-id ]
|
|
||||||
(:data (pet-pet-idtesting-byte-arraytrue-get-with-http-info pet-id)))
|
|
||||||
|
|
||||||
(defn add-pet-using-byte-array-with-http-info
|
|
||||||
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
"
|
|
||||||
([] (add-pet-using-byte-array-with-http-info nil))
|
|
||||||
([{:keys [body ]}]
|
|
||||||
(call-api "/pet?testing_byte_array=true" :post
|
|
||||||
{:path-params {}
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:body-param body
|
|
||||||
:content-types ["application/json" "application/xml"]
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names ["petstore_auth"]})))
|
|
||||||
|
|
||||||
(defn add-pet-using-byte-array
|
|
||||||
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
"
|
|
||||||
([] (add-pet-using-byte-array nil))
|
|
||||||
([optional-params]
|
|
||||||
(:data (add-pet-using-byte-array-with-http-info optional-params))))
|
|
||||||
|
@ -2,6 +2,25 @@
|
|||||||
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
||||||
(:import (java.io File)))
|
(:import (java.io File)))
|
||||||
|
|
||||||
|
(defn delete-order-with-http-info
|
||||||
|
"Delete purchase order by ID
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
|
||||||
|
[order-id ]
|
||||||
|
(call-api "/store/order/{orderId}" :delete
|
||||||
|
{:path-params {"orderId" order-id }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names []}))
|
||||||
|
|
||||||
|
(defn delete-order
|
||||||
|
"Delete purchase order by ID
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
|
||||||
|
[order-id ]
|
||||||
|
(:data (delete-order-with-http-info order-id)))
|
||||||
|
|
||||||
(defn find-orders-by-status-with-http-info
|
(defn find-orders-by-status-with-http-info
|
||||||
"Finds orders by status
|
"Finds orders by status
|
||||||
A single status value can be provided as a string"
|
A single status value can be provided as a string"
|
||||||
@ -42,6 +61,44 @@
|
|||||||
[]
|
[]
|
||||||
(:data (get-inventory-with-http-info)))
|
(:data (get-inventory-with-http-info)))
|
||||||
|
|
||||||
|
(defn get-inventory-in-object-with-http-info
|
||||||
|
"Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities"
|
||||||
|
[]
|
||||||
|
(call-api "/store/inventory?response=arbitrary_object" :get
|
||||||
|
{:path-params {}
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["api_key"]}))
|
||||||
|
|
||||||
|
(defn get-inventory-in-object
|
||||||
|
"Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities"
|
||||||
|
[]
|
||||||
|
(:data (get-inventory-in-object-with-http-info)))
|
||||||
|
|
||||||
|
(defn get-order-by-id-with-http-info
|
||||||
|
"Find purchase order by ID
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
|
||||||
|
[order-id ]
|
||||||
|
(call-api "/store/order/{orderId}" :get
|
||||||
|
{:path-params {"orderId" order-id }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["test_api_key_header" "test_api_key_query"]}))
|
||||||
|
|
||||||
|
(defn get-order-by-id
|
||||||
|
"Find purchase order by ID
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
|
||||||
|
[order-id ]
|
||||||
|
(:data (get-order-by-id-with-http-info order-id)))
|
||||||
|
|
||||||
(defn place-order-with-http-info
|
(defn place-order-with-http-info
|
||||||
"Place an order for a pet
|
"Place an order for a pet
|
||||||
"
|
"
|
||||||
@ -63,41 +120,3 @@
|
|||||||
([] (place-order nil))
|
([] (place-order nil))
|
||||||
([optional-params]
|
([optional-params]
|
||||||
(:data (place-order-with-http-info optional-params))))
|
(:data (place-order-with-http-info optional-params))))
|
||||||
|
|
||||||
(defn get-order-by-id-with-http-info
|
|
||||||
"Find purchase order by ID
|
|
||||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
|
|
||||||
[order-id ]
|
|
||||||
(call-api "/store/order/{orderId}" :get
|
|
||||||
{:path-params {"orderId" order-id }
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:content-types []
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names ["test_api_key_query" "test_api_key_header"]}))
|
|
||||||
|
|
||||||
(defn get-order-by-id
|
|
||||||
"Find purchase order by ID
|
|
||||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
|
|
||||||
[order-id ]
|
|
||||||
(:data (get-order-by-id-with-http-info order-id)))
|
|
||||||
|
|
||||||
(defn delete-order-with-http-info
|
|
||||||
"Delete purchase order by ID
|
|
||||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
|
|
||||||
[order-id ]
|
|
||||||
(call-api "/store/order/{orderId}" :delete
|
|
||||||
{:path-params {"orderId" order-id }
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:content-types []
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names []}))
|
|
||||||
|
|
||||||
(defn delete-order
|
|
||||||
"Delete purchase order by ID
|
|
||||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
|
|
||||||
[order-id ]
|
|
||||||
(:data (delete-order-with-http-info order-id)))
|
|
||||||
|
@ -68,6 +68,44 @@
|
|||||||
([optional-params]
|
([optional-params]
|
||||||
(:data (create-users-with-list-input-with-http-info optional-params))))
|
(:data (create-users-with-list-input-with-http-info optional-params))))
|
||||||
|
|
||||||
|
(defn delete-user-with-http-info
|
||||||
|
"Delete user
|
||||||
|
This can only be done by the logged in user."
|
||||||
|
[username ]
|
||||||
|
(call-api "/user/{username}" :delete
|
||||||
|
{:path-params {"username" username }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names []}))
|
||||||
|
|
||||||
|
(defn delete-user
|
||||||
|
"Delete user
|
||||||
|
This can only be done by the logged in user."
|
||||||
|
[username ]
|
||||||
|
(:data (delete-user-with-http-info username)))
|
||||||
|
|
||||||
|
(defn get-user-by-name-with-http-info
|
||||||
|
"Get user by user name
|
||||||
|
"
|
||||||
|
[username ]
|
||||||
|
(call-api "/user/{username}" :get
|
||||||
|
{:path-params {"username" username }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names []}))
|
||||||
|
|
||||||
|
(defn get-user-by-name
|
||||||
|
"Get user by user name
|
||||||
|
"
|
||||||
|
[username ]
|
||||||
|
(:data (get-user-by-name-with-http-info username)))
|
||||||
|
|
||||||
(defn login-user-with-http-info
|
(defn login-user-with-http-info
|
||||||
"Logs user into the system
|
"Logs user into the system
|
||||||
"
|
"
|
||||||
@ -108,25 +146,6 @@
|
|||||||
[]
|
[]
|
||||||
(:data (logout-user-with-http-info)))
|
(:data (logout-user-with-http-info)))
|
||||||
|
|
||||||
(defn get-user-by-name-with-http-info
|
|
||||||
"Get user by user name
|
|
||||||
"
|
|
||||||
[username ]
|
|
||||||
(call-api "/user/{username}" :get
|
|
||||||
{:path-params {"username" username }
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:content-types []
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names []}))
|
|
||||||
|
|
||||||
(defn get-user-by-name
|
|
||||||
"Get user by user name
|
|
||||||
"
|
|
||||||
[username ]
|
|
||||||
(:data (get-user-by-name-with-http-info username)))
|
|
||||||
|
|
||||||
(defn update-user-with-http-info
|
(defn update-user-with-http-info
|
||||||
"Updated user
|
"Updated user
|
||||||
This can only be done by the logged in user."
|
This can only be done by the logged in user."
|
||||||
@ -148,22 +167,3 @@
|
|||||||
([username ] (update-user username nil))
|
([username ] (update-user username nil))
|
||||||
([username optional-params]
|
([username optional-params]
|
||||||
(:data (update-user-with-http-info username optional-params))))
|
(:data (update-user-with-http-info username optional-params))))
|
||||||
|
|
||||||
(defn delete-user-with-http-info
|
|
||||||
"Delete user
|
|
||||||
This can only be done by the logged in user."
|
|
||||||
[username ]
|
|
||||||
(call-api "/user/{username}" :delete
|
|
||||||
{:path-params {"username" username }
|
|
||||||
:header-params {}
|
|
||||||
:query-params {}
|
|
||||||
:form-params {}
|
|
||||||
:content-types []
|
|
||||||
:accepts ["application/json" "application/xml"]
|
|
||||||
:auth-names []}))
|
|
||||||
|
|
||||||
(defn delete-user
|
|
||||||
"Delete user
|
|
||||||
This can only be done by the logged in user."
|
|
||||||
[username ]
|
|
||||||
(:data (delete-user-with-http-info username)))
|
|
||||||
|
@ -8,12 +8,12 @@
|
|||||||
(java.text SimpleDateFormat)))
|
(java.text SimpleDateFormat)))
|
||||||
|
|
||||||
(def auth-definitions
|
(def auth-definitions
|
||||||
{"petstore_auth" {:type :oauth2}
|
{"test_api_key_header" {:type :api-key :in :header :param-name "test_api_key_header"}
|
||||||
"test_api_client_id" {:type :api-key :in :header :param-name "x-test_api_client_id"}
|
|
||||||
"test_api_client_secret" {:type :api-key :in :header :param-name "x-test_api_client_secret"}
|
|
||||||
"api_key" {:type :api-key :in :header :param-name "api_key"}
|
"api_key" {:type :api-key :in :header :param-name "api_key"}
|
||||||
|
"test_api_client_secret" {:type :api-key :in :header :param-name "x-test_api_client_secret"}
|
||||||
|
"test_api_client_id" {:type :api-key :in :header :param-name "x-test_api_client_id"}
|
||||||
"test_api_key_query" {:type :api-key :in :query :param-name "test_api_key_query"}
|
"test_api_key_query" {:type :api-key :in :query :param-name "test_api_key_query"}
|
||||||
"test_api_key_header" {:type :api-key :in :header :param-name "test_api_key_header"}})
|
"petstore_auth" {:type :oauth2}})
|
||||||
|
|
||||||
(def default-api-context
|
(def default-api-context
|
||||||
"Default API context."
|
"Default API context."
|
||||||
@ -21,12 +21,12 @@
|
|||||||
:date-format "yyyy-MM-dd"
|
:date-format "yyyy-MM-dd"
|
||||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||||
:debug false
|
:debug false
|
||||||
:auths {"petstore_auth" nil
|
:auths {"test_api_key_header" nil
|
||||||
"test_api_client_id" nil
|
|
||||||
"test_api_client_secret" nil
|
|
||||||
"api_key" nil
|
"api_key" nil
|
||||||
|
"test_api_client_secret" nil
|
||||||
|
"test_api_client_id" nil
|
||||||
"test_api_key_query" nil
|
"test_api_key_query" nil
|
||||||
"test_api_key_header" nil}})
|
"petstore_auth" nil}})
|
||||||
|
|
||||||
(def ^:dynamic *api-context*
|
(def ^:dynamic *api-context*
|
||||||
"Dynamic API context to be applied in API calls."
|
"Dynamic API context to be applied in API calls."
|
||||||
|
@ -0,0 +1,111 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace IO.Swagger.Test
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing InlineResponse200
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by Swagger Codegen.
|
||||||
|
/// Please update the test case below to test the model.
|
||||||
|
/// </remarks>
|
||||||
|
[TestFixture]
|
||||||
|
public class InlineResponse200Tests
|
||||||
|
{
|
||||||
|
private InlineResponse200 instance;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Setup before each test
|
||||||
|
/// </summary>
|
||||||
|
[SetUp]
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
instance = new InlineResponse200();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up after each test
|
||||||
|
/// </summary>
|
||||||
|
[TearDown]
|
||||||
|
public void Cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of InlineResponse200
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void InlineResponse200InstanceTest()
|
||||||
|
{
|
||||||
|
Assert.IsInstanceOf<InlineResponse200> (instance, "instance is a InlineResponse200");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'Tags'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void TagsTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'Tags'
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'Id'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void IdTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'Id'
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'Category'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void CategoryTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'Category'
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'Status'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void StatusTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'Status'
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'Name'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void NameTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'Name'
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'PhotoUrls'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void PhotoUrlsTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'PhotoUrls'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace IO.Swagger.Test
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing ModelReturn
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by Swagger Codegen.
|
||||||
|
/// Please update the test case below to test the model.
|
||||||
|
/// </remarks>
|
||||||
|
[TestFixture]
|
||||||
|
public class ModelReturnTests
|
||||||
|
{
|
||||||
|
private ModelReturn instance;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Setup before each test
|
||||||
|
/// </summary>
|
||||||
|
[SetUp]
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
instance = new ModelReturn();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up after each test
|
||||||
|
/// </summary>
|
||||||
|
[TearDown]
|
||||||
|
public void Cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of ModelReturn
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void ModelReturnInstanceTest()
|
||||||
|
{
|
||||||
|
Assert.IsInstanceOf<ModelReturn> (instance, "instance is a ModelReturn");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property '_Return'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void _ReturnTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property '_Return'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace IO.Swagger.Test
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing Name
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by Swagger Codegen.
|
||||||
|
/// Please update the test case below to test the model.
|
||||||
|
/// </remarks>
|
||||||
|
[TestFixture]
|
||||||
|
public class NameTests
|
||||||
|
{
|
||||||
|
private Name instance;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Setup before each test
|
||||||
|
/// </summary>
|
||||||
|
[SetUp]
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
instance = new Name();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up after each test
|
||||||
|
/// </summary>
|
||||||
|
[TearDown]
|
||||||
|
public void Cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of Name
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void NameInstanceTest()
|
||||||
|
{
|
||||||
|
Assert.IsInstanceOf<Name> (instance, "instance is a Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property '_Name'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void _NameTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property '_Name'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace IO.Swagger.Test
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing SpecialModelName
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by Swagger Codegen.
|
||||||
|
/// Please update the test case below to test the model.
|
||||||
|
/// </remarks>
|
||||||
|
[TestFixture]
|
||||||
|
public class SpecialModelNameTests
|
||||||
|
{
|
||||||
|
private SpecialModelName instance;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Setup before each test
|
||||||
|
/// </summary>
|
||||||
|
[SetUp]
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
instance = new SpecialModelName();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up after each test
|
||||||
|
/// </summary>
|
||||||
|
[TearDown]
|
||||||
|
public void Cleanup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of SpecialModelName
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void SpecialModelNameInstanceTest()
|
||||||
|
{
|
||||||
|
Assert.IsInstanceOf<SpecialModelName> (instance, "instance is a SpecialModelName");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test the property 'SpecialPropertyName'
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void SpecialPropertyNameTest()
|
||||||
|
{
|
||||||
|
// TODO: unit test for the property 'SpecialPropertyName'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,2 +1,185 @@
|
|||||||
vendor/Newtonsoft.Json.8.0.2/
|
# Ref: https://gist.github.com/kmorcinek/2710267
|
||||||
vendor/RestSharp.105.2.3/
|
# Download this file using PowerShell v3 under Windows with the following comand
|
||||||
|
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/packages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/packages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/packages/repositories.config
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# OS generated files #
|
||||||
|
.DS_Store*
|
||||||
|
ehthumbs.db
|
||||||
|
Icon?
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
modulesbin/
|
||||||
|
tempbin/
|
||||||
|
|
||||||
|
# EPiServer Site file (VPP)
|
||||||
|
AppData/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# vim
|
||||||
|
*.txt~
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# svn
|
||||||
|
.svn
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
**/App_Data/*.mdf
|
||||||
|
**/App_Data/*.ldf
|
||||||
|
**/App_Data/*.sdf
|
||||||
|
|
||||||
|
|
||||||
|
#LightSwitch generated files
|
||||||
|
GeneratedArtifacts/
|
||||||
|
_Pvt_Extensions/
|
||||||
|
ModelManifest.xml
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Windows detritus
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac desktop service store files
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# SASS Compiler cache
|
||||||
|
.sass-cache
|
||||||
|
|
||||||
|
# Visual Studio 2014 CTP
|
||||||
|
**/*.sln.ide
|
||||||
|
@ -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="YOUR_GIT_USR_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="YOUR_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'
|
||||||
|
|
24
samples/client/petstore/go/.gitignore
vendored
Normal file
24
samples/client/petstore/go/.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Folders
|
||||||
|
_obj
|
||||||
|
_test
|
||||||
|
|
||||||
|
# Architecture specific extensions/prefixes
|
||||||
|
*.[568vq]
|
||||||
|
[568vq].out
|
||||||
|
|
||||||
|
*.cgo1.go
|
||||||
|
*.cgo2.c
|
||||||
|
_cgo_defun.c
|
||||||
|
_cgo_gotypes.go
|
||||||
|
_cgo_export.*
|
||||||
|
|
||||||
|
_testmain.go
|
||||||
|
|
||||||
|
*.exe
|
||||||
|
*.test
|
||||||
|
*.prof
|
52
samples/client/petstore/go/git_push.sh
Normal file
52
samples/client/petstore/go/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="YOUR_GIT_USR_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="YOUR_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'
|
||||||
|
|
14
samples/client/petstore/go/swagger/InlineResponse200.go
Normal file
14
samples/client/petstore/go/swagger/InlineResponse200.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
)
|
||||||
|
|
||||||
|
type InlineResponse200 struct {
|
||||||
|
Tags []Tag `json:"tags,omitempty"`
|
||||||
|
Id int64 `json:"id,omitempty"`
|
||||||
|
Category Object `json:"category,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
PhotoUrls []string `json:"photoUrls,omitempty"`
|
||||||
|
|
||||||
|
}
|
9
samples/client/petstore/go/swagger/ModelReturn.go
Normal file
9
samples/client/petstore/go/swagger/ModelReturn.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
)
|
||||||
|
|
||||||
|
type ModelReturn struct {
|
||||||
|
Return_ int32 `json:"return,omitempty"`
|
||||||
|
|
||||||
|
}
|
9
samples/client/petstore/go/swagger/Name.go
Normal file
9
samples/client/petstore/go/swagger/Name.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
)
|
||||||
|
|
||||||
|
type Name struct {
|
||||||
|
Name int32 `json:"name,omitempty"`
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,8 @@ package swagger
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"github.com/dghubble/sling"
|
"github.com/dghubble/sling"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
@ -24,13 +26,498 @@ func NewPetApiWithBasePath(basePath string) *PetApi{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing pet
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
* @param Body Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a PetApi) UpdatePet (Body Pet) (error) {
|
//func (a PetApi) AddPet (body Pet) (error) {
|
||||||
func (a PetApi) UpdatePet (Body Pet) (error) {
|
func (a PetApi) AddPet (body Pet) (error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
// body params
|
||||||
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
*
|
||||||
|
* @param body Pet object in the form of byte array
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
//func (a PetApi) AddPetUsingByteArray (body string) (error) {
|
||||||
|
func (a PetApi) AddPetUsingByteArray (body string) (error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet?testing_byte_array=true"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
// body params
|
||||||
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
* @param petId Pet id to delete
|
||||||
|
* @param apiKey
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
//func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
||||||
|
func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Delete(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet/{petId}"
|
||||||
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
// header params "api_key"
|
||||||
|
_sling = _sling.Set("api_key", apiKey)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds Pets by status
|
||||||
|
* Multiple status values can be provided with comma separated strings
|
||||||
|
* @param status Status values that need to be considered for query
|
||||||
|
* @return []Pet
|
||||||
|
*/
|
||||||
|
//func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
||||||
|
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet/findByStatus"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
type QueryParams struct {
|
||||||
|
status []string `url:"status,omitempty"`
|
||||||
|
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ status: status })
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new([]Pet)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds Pets by tags
|
||||||
|
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* @param tags Tags to filter by
|
||||||
|
* @return []Pet
|
||||||
|
*/
|
||||||
|
//func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
||||||
|
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet/findByTags"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
type QueryParams struct {
|
||||||
|
tags []string `url:"tags,omitempty"`
|
||||||
|
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ tags: tags })
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new([]Pet)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Find pet by ID
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param petId ID of pet that needs to be fetched
|
||||||
|
* @return Pet
|
||||||
|
*/
|
||||||
|
//func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
||||||
|
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet/{petId}"
|
||||||
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(Pet)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param petId ID of pet that needs to be fetched
|
||||||
|
* @return InlineResponse200
|
||||||
|
*/
|
||||||
|
//func (a PetApi) GetPetByIdInObject (petId int64) (InlineResponse200, error) {
|
||||||
|
func (a PetApi) GetPetByIdInObject (petId int64) (InlineResponse200, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet/{petId}?response=inline_arbitrary_object"
|
||||||
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(InlineResponse200)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param petId ID of pet that needs to be fetched
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
//func (a PetApi) PetPetIdtestingByteArraytrueGet (petId int64) (string, error) {
|
||||||
|
func (a PetApi) PetPetIdtestingByteArraytrueGet (petId int64) (string, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/pet/{petId}?testing_byte_array=true"
|
||||||
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(string)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
* @param body Pet object that needs to be added to the store
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
//func (a PetApi) UpdatePet (body Pet) (error) {
|
||||||
|
func (a PetApi) UpdatePet (body Pet) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Put(a.basePath)
|
_sling := sling.New().Put(a.basePath)
|
||||||
|
|
||||||
@ -47,163 +534,58 @@ func (a PetApi) UpdatePet (Body Pet) (error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(Body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("UpdatePet response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Add a new pet to the store
|
|
||||||
*
|
|
||||||
* @param Body Pet object that needs to be added to the store
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
//func (a PetApi) AddPet (Body Pet) (error) {
|
|
||||||
func (a PetApi) AddPet (Body Pet) (error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/pet"
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
// body params
|
|
||||||
_sling = _sling.BodyJSON(Body)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
|
||||||
//fmt.Println("AddPet response: void, ", resp, err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Finds Pets by status
|
|
||||||
* Multiple status values can be provided with comma seperated strings
|
|
||||||
* @param Status Status values that need to be considered for filter
|
|
||||||
* @return []Pet
|
|
||||||
*/
|
|
||||||
//func (a PetApi) FindPetsByStatus (Status []string) ([]Pet, error) {
|
|
||||||
func (a PetApi) FindPetsByStatus (Status []string) ([]Pet, error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/pet/findByStatus"
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
type QueryParams struct {
|
|
||||||
Status []string `url:"status,omitempty"`
|
|
||||||
|
|
||||||
}
|
|
||||||
_sling = _sling.QueryStruct(&QueryParams{ Status: Status })
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response := new([]Pet)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
|
||||||
//fmt.Println("FindPetsByStatus response: ", response, resp, err)
|
|
||||||
return *response, err
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Finds Pets by tags
|
|
||||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
|
||||||
* @param Tags Tags to filter by
|
|
||||||
* @return []Pet
|
|
||||||
*/
|
|
||||||
//func (a PetApi) FindPetsByTags (Tags []string) ([]Pet, error) {
|
|
||||||
func (a PetApi) FindPetsByTags (Tags []string) ([]Pet, error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/pet/findByTags"
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
type QueryParams struct {
|
|
||||||
Tags []string `url:"tags,omitempty"`
|
|
||||||
|
|
||||||
}
|
|
||||||
_sling = _sling.QueryStruct(&QueryParams{ Tags: Tags })
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response := new([]Pet)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
|
||||||
//fmt.Println("FindPetsByTags response: ", response, resp, err)
|
|
||||||
return *response, err
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Find pet by ID
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param PetId ID of pet that needs to be fetched
|
|
||||||
* @return Pet
|
|
||||||
*/
|
|
||||||
//func (a PetApi) GetPetById (PetId int64) (Pet, error) {
|
|
||||||
func (a PetApi) GetPetById (PetId int64) (Pet, error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/pet/{petId}"
|
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", PetId), -1)
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response := new(Pet)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
|
||||||
//fmt.Println("GetPetById response: ", response, resp, err)
|
|
||||||
return *response, err
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Updates a pet in the store with form data
|
* Updates a pet in the store with form data
|
||||||
*
|
*
|
||||||
* @param PetId ID of pet that needs to be updated
|
* @param petId ID of pet that needs to be updated
|
||||||
* @param Name Updated name of the pet
|
* @param name Updated name of the pet
|
||||||
* @param Status Updated status of the pet
|
* @param status Updated status of the pet
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a PetApi) UpdatePetWithForm (PetId string, Name string, Status string) (error) {
|
//func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (error) {
|
||||||
func (a PetApi) UpdatePetWithForm (PetId string, Name string, Status string) (error) {
|
func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pet/{petId}"
|
path := "/v2/pet/{petId}"
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", PetId), -1)
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
@ -215,96 +597,61 @@ func (a PetApi) UpdatePetWithForm (PetId string, Name string, Status string) (er
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FormParams struct {
|
type FormParams struct {
|
||||||
Name string `url:"name,omitempty"`
|
name string `url:"name,omitempty"`
|
||||||
Status string `url:"status,omitempty"`
|
status string `url:"status,omitempty"`
|
||||||
}
|
}
|
||||||
_sling = _sling.BodyForm(&FormParams{ Name: Name,Status: Status })
|
_sling = _sling.BodyForm(&FormParams{ name: name,status: status })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("UpdatePetWithForm response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Deletes a pet
|
|
||||||
*
|
|
||||||
* @param PetId Pet id to delete
|
|
||||||
* @param ApiKey
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
//func (a PetApi) DeletePet (PetId int64, ApiKey string) (error) {
|
|
||||||
func (a PetApi) DeletePet (PetId int64, ApiKey string) (error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Delete(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/pet/{petId}"
|
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", PetId), -1)
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
// header params "api_key"
|
|
||||||
_sling = _sling.Set("api_key", ApiKey)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
|
||||||
//fmt.Println("DeletePet response: void, ", resp, err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* downloads an image
|
|
||||||
*
|
|
||||||
* @return *os.File
|
|
||||||
*/
|
|
||||||
//func (a PetApi) DownloadFile () (*os.File, error) {
|
|
||||||
func (a PetApi) DownloadFile () (*os.File, error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/pet/{petId}/downloadImage"
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/octet-stream" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response := new(*os.File)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
|
||||||
//fmt.Println("DownloadFile response: ", response, resp, err)
|
|
||||||
return *response, err
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* uploads an image
|
* uploads an image
|
||||||
*
|
*
|
||||||
* @param PetId ID of pet to update
|
* @param petId ID of pet to update
|
||||||
* @param AdditionalMetadata Additional data to pass to server
|
* @param additionalMetadata Additional data to pass to server
|
||||||
* @param File file to upload
|
* @param file file to upload
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a PetApi) UploadFile (PetId int64, AdditionalMetadata string, File *os.File) (error) {
|
//func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (error) {
|
||||||
func (a PetApi) UploadFile (PetId int64, AdditionalMetadata string, File *os.File) (error) {
|
func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pet/{petId}/uploadImage"
|
path := "/v2/pet/{petId}/uploadImage"
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", PetId), -1)
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
@ -316,14 +663,42 @@ func (a PetApi) UploadFile (PetId int64, AdditionalMetadata string, File *os.Fil
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FormParams struct {
|
type FormParams struct {
|
||||||
AdditionalMetadata string `url:"additionalMetadata,omitempty"`
|
additionalMetadata string `url:"additionalMetadata,omitempty"`
|
||||||
File *os.File `url:"file,omitempty"`
|
file *os.File `url:"file,omitempty"`
|
||||||
}
|
}
|
||||||
_sling = _sling.BodyForm(&FormParams{ AdditionalMetadata: AdditionalMetadata,File: File })
|
_sling = _sling.BodyForm(&FormParams{ additionalMetadata: additionalMetadata,file: file })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("UploadFile response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
9
samples/client/petstore/go/swagger/SpecialModelName.go
Normal file
9
samples/client/petstore/go/swagger/SpecialModelName.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
)
|
||||||
|
|
||||||
|
type SpecialModelName struct {
|
||||||
|
$Special[propertyName] int64 `json:"$special[property.name],omitempty"`
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,8 @@ package swagger
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"github.com/dghubble/sling"
|
"github.com/dghubble/sling"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,6 +24,128 @@ func NewStoreApiWithBasePath(basePath string) *StoreApi{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
//func (a StoreApi) DeleteOrder (orderId string) (error) {
|
||||||
|
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Delete(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/store/order/{orderId}"
|
||||||
|
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds orders by status
|
||||||
|
* A single status value can be provided as a string
|
||||||
|
* @param status Status value that needs to be considered for query
|
||||||
|
* @return []Order
|
||||||
|
*/
|
||||||
|
//func (a StoreApi) FindOrdersByStatus (status string) ([]Order, error) {
|
||||||
|
func (a StoreApi) FindOrdersByStatus (status string) ([]Order, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/store/findByStatus"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
type QueryParams struct {
|
||||||
|
status string `url:"status,omitempty"`
|
||||||
|
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ status: status })
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new([]Order)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
@ -45,20 +169,164 @@ func (a StoreApi) GetInventory () (map[string]int32, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(map[string]int32)
|
||||||
|
|
||||||
response := new(map[string]int32)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
//fmt.Println("GetInventory response: ", response, resp, err)
|
// response (error) models, which needs to be implemented at some point.
|
||||||
return *response, err
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
* Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
//func (a StoreApi) GetInventoryInObject () (Object, error) {
|
||||||
|
func (a StoreApi) GetInventoryInObject () (Object, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/store/inventory?response=arbitrary_object"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(Object)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
* @return Order
|
||||||
|
*/
|
||||||
|
//func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
||||||
|
func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/store/order/{orderId}"
|
||||||
|
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(Order)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
* @param Body order placed for purchasing the pet
|
* @param body order placed for purchasing the pet
|
||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
//func (a StoreApi) PlaceOrder (Body Order) (Order, error) {
|
//func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
||||||
func (a StoreApi) PlaceOrder (Body Order) (Order, error) {
|
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
@ -75,73 +343,39 @@ func (a StoreApi) PlaceOrder (Body Order) (Order, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(Body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
var successPayload = new(Order)
|
||||||
|
|
||||||
response := new(Order)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
//fmt.Println("PlaceOrder response: ", response, resp, err)
|
// response (error) models, which needs to be implemented at some point.
|
||||||
return *response, err
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
* @return Order
|
|
||||||
*/
|
|
||||||
//func (a StoreApi) GetOrderById (OrderId string) (Order, error) {
|
|
||||||
func (a StoreApi) GetOrderById (OrderId string) (Order, error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/store/order/{orderId}"
|
|
||||||
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", OrderId), -1)
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
|
||||||
response := new(Order)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
|
||||||
//fmt.Println("GetOrderById response: ", response, resp, err)
|
|
||||||
return *response, err
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
//func (a StoreApi) DeleteOrder (OrderId string) (error) {
|
|
||||||
func (a StoreApi) DeleteOrder (OrderId string) (error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Delete(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/store/order/{orderId}"
|
|
||||||
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", OrderId), -1)
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
|
||||||
//fmt.Println("DeleteOrder response: void, ", resp, err)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package swagger
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"github.com/dghubble/sling"
|
"github.com/dghubble/sling"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -25,11 +27,11 @@ func NewUserApiWithBasePath(basePath string) *UserApi{
|
|||||||
/**
|
/**
|
||||||
* Create user
|
* Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
* @param Body Created user object
|
* @param body Created user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a UserApi) CreateUser (Body User) (error) {
|
//func (a UserApi) CreateUser (body User) (error) {
|
||||||
func (a UserApi) CreateUser (Body User) (error) {
|
func (a UserApi) CreateUser (body User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
@ -46,22 +48,50 @@ func (a UserApi) CreateUser (Body User) (error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(Body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("CreateUser response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
* @param Body List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a UserApi) CreateUsersWithArrayInput (Body []User) (error) {
|
//func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
||||||
func (a UserApi) CreateUsersWithArrayInput (Body []User) (error) {
|
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
@ -78,22 +108,50 @@ func (a UserApi) CreateUsersWithArrayInput (Body []User) (error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(Body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("CreateUsersWithArrayInput response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
* @param Body List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a UserApi) CreateUsersWithListInput (Body []User) (error) {
|
//func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
||||||
func (a UserApi) CreateUsersWithListInput (Body []User) (error) {
|
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.basePath)
|
||||||
|
|
||||||
@ -110,37 +168,59 @@ func (a UserApi) CreateUsersWithListInput (Body []User) (error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(Body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("CreateUsersWithListInput response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Logs user into the system
|
* Delete user
|
||||||
*
|
* This can only be done by the logged in user.
|
||||||
* @param Username The user name for login
|
* @param username The name that needs to be deleted
|
||||||
* @param Password The password for login in clear text
|
* @return void
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
//func (a UserApi) LoginUser (Username string, Password string) (string, error) {
|
//func (a UserApi) DeleteUser (username string) (error) {
|
||||||
func (a UserApi) LoginUser (Username string, Password string) (string, error) {
|
func (a UserApi) DeleteUser (username string) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Delete(a.basePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/user/login"
|
path := "/v2/user/{username}"
|
||||||
|
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
type QueryParams struct {
|
|
||||||
Username string `url:"username,omitempty"`
|
|
||||||
Password string `url:"password,omitempty"`
|
|
||||||
|
|
||||||
}
|
|
||||||
_sling = _sling.QueryStruct(&QueryParams{ Username: Username,Password: Password })
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -150,10 +230,162 @@ func (a UserApi) LoginUser (Username string, Password string) (string, error) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
response := new(string)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("LoginUser response: ", response, resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
return *response, err
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
|
* @return User
|
||||||
|
*/
|
||||||
|
//func (a UserApi) GetUserByName (username string) (User, error) {
|
||||||
|
func (a UserApi) GetUserByName (username string) (User, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/user/{username}"
|
||||||
|
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(User)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Logs user into the system
|
||||||
|
*
|
||||||
|
* @param username The user name for login
|
||||||
|
* @param password The password for login in clear text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
//func (a UserApi) LoginUser (username string, password string) (string, error) {
|
||||||
|
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
||||||
|
|
||||||
|
_sling := sling.New().Get(a.basePath)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "/v2/user/login"
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
type QueryParams struct {
|
||||||
|
username string `url:"username,omitempty"`
|
||||||
|
password string `url:"password,omitempty"`
|
||||||
|
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ username: username,password: password })
|
||||||
|
// accept header
|
||||||
|
accepts := []string { "application/json", "application/xml" }
|
||||||
|
for key := range accepts {
|
||||||
|
_sling = _sling.Set("Accept", accepts[key])
|
||||||
|
break // only use the first Accept
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var successPayload = new(string)
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(successPayload, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Logs out current logged in user session
|
* Logs out current logged in user session
|
||||||
@ -180,56 +412,53 @@ func (a UserApi) LogoutUser () (error) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("LogoutUser response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Get user by user name
|
|
||||||
*
|
|
||||||
* @param Username The name that needs to be fetched. Use user1 for testing.
|
|
||||||
* @return User
|
|
||||||
*/
|
|
||||||
//func (a UserApi) GetUserByName (Username string) (User, error) {
|
|
||||||
func (a UserApi) GetUserByName (Username string) (User, error) {
|
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
path := "/v2/user/{username}"
|
|
||||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", Username), -1)
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
|
||||||
|
|
||||||
// accept header
|
|
||||||
accepts := []string { "application/json", "application/xml" }
|
|
||||||
for key := range accepts {
|
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
|
||||||
break // only use the first Accept
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response := new(User)
|
|
||||||
_, err := _sling.ReceiveSuccess(response)
|
|
||||||
//fmt.Println("GetUserByName response: ", response, resp, err)
|
|
||||||
return *response, err
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Updated user
|
* Updated user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
* @param Username name that need to be deleted
|
* @param username name that need to be deleted
|
||||||
* @param Body Updated user object
|
* @param body Updated user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
//func (a UserApi) UpdateUser (Username string, Body User) (error) {
|
//func (a UserApi) UpdateUser (username string, body User) (error) {
|
||||||
func (a UserApi) UpdateUser (Username string, Body User) (error) {
|
func (a UserApi) UpdateUser (username string, body User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Put(a.basePath)
|
_sling := sling.New().Put(a.basePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/user/{username}"
|
path := "/v2/user/{username}"
|
||||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", Username), -1)
|
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
@ -241,42 +470,39 @@ func (a UserApi) UpdateUser (Username string, Body User) (error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(Body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
//fmt.Println("UpdateUser response: void, ", resp, err)
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
return err
|
// response (error) models, which needs to be implemented at some point.
|
||||||
}
|
var failurePayload map[string]interface{}
|
||||||
/**
|
|
||||||
* Delete user
|
httpResponse, err := _sling.Receive(nil, &failurePayload)
|
||||||
* This can only be done by the logged in user.
|
|
||||||
* @param Username The name that needs to be deleted
|
if err == nil {
|
||||||
* @return void
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
*/
|
if failurePayload != nil {
|
||||||
//func (a UserApi) DeleteUser (Username string) (error) {
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
func (a UserApi) DeleteUser (Username string) (error) {
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
_sling := sling.New().Delete(a.basePath)
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
// create path and map variables
|
// This will return the JSON error body as a string
|
||||||
path := "/v2/user/{username}"
|
err = errors.New(string(str))
|
||||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", Username), -1)
|
}
|
||||||
|
} else {
|
||||||
_sling = _sling.Path(path)
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
// accept header
|
if httpResponse == nil {
|
||||||
accepts := []string { "application/json", "application/xml" }
|
// This should never happen...
|
||||||
for key := range accepts {
|
err = errors.New("No HTTP Response received.")
|
||||||
_sling = _sling.Set("Accept", accepts[key])
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
break // only use the first Accept
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
_, err := _sling.ReceiveSuccess(nil)
|
|
||||||
//fmt.Println("DeleteUser response: void, ", resp, err)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
12
samples/client/petstore/java/default/.gitignore
vendored
Normal file
12
samples/client/petstore/java/default/.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
*.class
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
52
samples/client/petstore/java/default/git_push.sh
Normal file
52
samples/client/petstore/java/default/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="YOUR_GIT_USR_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="YOUR_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'
|
||||||
|
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
private int code = 0;
|
private int code = 0;
|
||||||
private Map<String, List<String>> responseHeaders = null;
|
private Map<String, List<String>> responseHeaders = null;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Configuration {
|
public class Configuration {
|
||||||
private static ApiClient defaultApiClient = new ApiClient();
|
private static ApiClient defaultApiClient = new ApiClient();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Pair {
|
public class Pair {
|
||||||
private String name = "";
|
private String name = "";
|
||||||
private String value = "";
|
private String value = "";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
/**
|
/**
|
||||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
@ -16,7 +16,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class PetApi {
|
public class PetApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ public class PetApi {
|
|||||||
};
|
};
|
||||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||||
@ -342,7 +342,7 @@ public class PetApi {
|
|||||||
};
|
};
|
||||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
|
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
|
||||||
@ -390,7 +390,7 @@ public class PetApi {
|
|||||||
};
|
};
|
||||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class StoreApi {
|
public class StoreApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ public class StoreApi {
|
|||||||
};
|
};
|
||||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class UserApi {
|
public class UserApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class ApiKeyAuth implements Authentication {
|
public class ApiKeyAuth implements Authentication {
|
||||||
private final String location;
|
private final String location;
|
||||||
private final String paramName;
|
private final String paramName;
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class HttpBasicAuth implements Authentication {
|
public class HttpBasicAuth implements Authentication {
|
||||||
private String username;
|
private String username;
|
||||||
private String password;
|
private String password;
|
||||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class OAuth implements Authentication {
|
public class OAuth implements Authentication {
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Category {
|
public class Category {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -13,14 +13,12 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class InlineResponse200 {
|
public class InlineResponse200 {
|
||||||
|
|
||||||
private List<String> photoUrls = new ArrayList<String>();
|
private List<Tag> tags = new ArrayList<Tag>();
|
||||||
private String name = null;
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
private Object category = null;
|
private Object category = null;
|
||||||
private List<Tag> tags = new ArrayList<Tag>();
|
|
||||||
|
|
||||||
|
|
||||||
public enum StatusEnum {
|
public enum StatusEnum {
|
||||||
@ -42,39 +40,24 @@ public class InlineResponse200 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
|
private String name = null;
|
||||||
|
private List<String> photoUrls = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public InlineResponse200 photoUrls(List<String> photoUrls) {
|
public InlineResponse200 tags(List<Tag> tags) {
|
||||||
this.photoUrls = photoUrls;
|
this.tags = tags;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(example = "null", value = "")
|
@ApiModelProperty(example = "null", value = "")
|
||||||
@JsonProperty("photoUrls")
|
@JsonProperty("tags")
|
||||||
public List<String> getPhotoUrls() {
|
public List<Tag> getTags() {
|
||||||
return photoUrls;
|
return tags;
|
||||||
}
|
}
|
||||||
public void setPhotoUrls(List<String> photoUrls) {
|
public void setTags(List<Tag> tags) {
|
||||||
this.photoUrls = photoUrls;
|
this.tags = tags;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
public InlineResponse200 name(String name) {
|
|
||||||
this.name = name;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiModelProperty(example = "doggie", value = "")
|
|
||||||
@JsonProperty("name")
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -112,23 +95,6 @@ public class InlineResponse200 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
public InlineResponse200 tags(List<Tag> tags) {
|
|
||||||
this.tags = tags;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiModelProperty(example = "null", value = "")
|
|
||||||
@JsonProperty("tags")
|
|
||||||
public List<Tag> getTags() {
|
|
||||||
return tags;
|
|
||||||
}
|
|
||||||
public void setTags(List<Tag> tags) {
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pet status in the store
|
* pet status in the store
|
||||||
**/
|
**/
|
||||||
@ -147,6 +113,40 @@ public class InlineResponse200 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
public InlineResponse200 name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty(example = "doggie", value = "")
|
||||||
|
@JsonProperty("name")
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
public InlineResponse200 photoUrls(List<String> photoUrls) {
|
||||||
|
this.photoUrls = photoUrls;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty(example = "null", value = "")
|
||||||
|
@JsonProperty("photoUrls")
|
||||||
|
public List<String> getPhotoUrls() {
|
||||||
|
return photoUrls;
|
||||||
|
}
|
||||||
|
public void setPhotoUrls(List<String> photoUrls) {
|
||||||
|
this.photoUrls = photoUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
@ -157,17 +157,17 @@ public class InlineResponse200 {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
||||||
return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) &&
|
return Objects.equals(this.tags, inlineResponse200.tags) &&
|
||||||
Objects.equals(this.name, inlineResponse200.name) &&
|
|
||||||
Objects.equals(this.id, inlineResponse200.id) &&
|
Objects.equals(this.id, inlineResponse200.id) &&
|
||||||
Objects.equals(this.category, inlineResponse200.category) &&
|
Objects.equals(this.category, inlineResponse200.category) &&
|
||||||
Objects.equals(this.tags, inlineResponse200.tags) &&
|
Objects.equals(this.status, inlineResponse200.status) &&
|
||||||
Objects.equals(this.status, inlineResponse200.status);
|
Objects.equals(this.name, inlineResponse200.name) &&
|
||||||
|
Objects.equals(this.photoUrls, inlineResponse200.photoUrls);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(photoUrls, name, id, category, tags, status);
|
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -175,12 +175,12 @@ public class InlineResponse200 {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class InlineResponse200 {\n");
|
sb.append("class InlineResponse200 {\n");
|
||||||
|
|
||||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
|
||||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
|
||||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||||
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class ModelReturn {
|
public class ModelReturn {
|
||||||
|
|
||||||
private Integer _return = null;
|
private Integer _return = null;
|
||||||
|
@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Name {
|
public class Name {
|
||||||
|
|
||||||
private Integer name = null;
|
private Integer name = null;
|
||||||
|
@ -11,7 +11,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Order {
|
public class Order {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Pet {
|
public class Pet {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class SpecialModelName {
|
public class SpecialModelName {
|
||||||
|
|
||||||
private Long specialPropertyName = null;
|
private Long specialPropertyName = null;
|
||||||
|
@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class Tag {
|
public class Tag {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-10T11:48:21.307-08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-03-12T17:08:42.639+08:00")
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
52
samples/client/petstore/javascript/git_push.sh
Normal file
52
samples/client/petstore/javascript/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="YOUR_GIT_USR_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="YOUR_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'
|
||||||
|
|
@ -22,12 +22,12 @@
|
|||||||
this.basePath = 'http://petstore.swagger.io/v2'.replace(/\/+$/, '');
|
this.basePath = 'http://petstore.swagger.io/v2'.replace(/\/+$/, '');
|
||||||
|
|
||||||
this.authentications = {
|
this.authentications = {
|
||||||
'petstore_auth': {type: 'oauth2'},
|
'test_api_key_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'},
|
||||||
'test_api_client_id': {type: 'apiKey', in: 'header', name: 'x-test_api_client_id'},
|
|
||||||
'test_api_client_secret': {type: 'apiKey', in: 'header', name: 'x-test_api_client_secret'},
|
|
||||||
'api_key': {type: 'apiKey', in: 'header', name: 'api_key'},
|
'api_key': {type: 'apiKey', in: 'header', name: 'api_key'},
|
||||||
|
'test_api_client_secret': {type: 'apiKey', in: 'header', name: 'x-test_api_client_secret'},
|
||||||
|
'test_api_client_id': {type: 'apiKey', in: 'header', name: 'x-test_api_client_id'},
|
||||||
'test_api_key_query': {type: 'apiKey', in: 'query', name: 'test_api_key_query'},
|
'test_api_key_query': {type: 'apiKey', in: 'query', name: 'test_api_key_query'},
|
||||||
'test_api_key_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'}
|
'petstore_auth': {type: 'oauth2'}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,39 +21,6 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update an existing pet
|
|
||||||
*
|
|
||||||
* @param {Pet} opts['body'] Pet object that needs to be added to the store
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
*/
|
|
||||||
self.updatePet = function(opts, callback) {
|
|
||||||
opts = opts || {};
|
|
||||||
var postBody = opts['body'];
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = ['petstore_auth'];
|
|
||||||
var contentTypes = ['application/json', 'application/xml'];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/pet', 'PUT',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
@ -87,6 +54,80 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
*
|
||||||
|
* @param {String} opts['body'] Pet object in the form of byte array
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
*/
|
||||||
|
self.addPetUsingByteArray = function(opts, callback) {
|
||||||
|
opts = opts || {};
|
||||||
|
var postBody = opts['body'];
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = ['petstore_auth'];
|
||||||
|
var contentTypes = ['application/json', 'application/xml'];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = null;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/pet?testing_byte_array=true', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
* @param {Integer} petId Pet id to delete
|
||||||
|
* @param {String} opts['apiKey']
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
*/
|
||||||
|
self.deletePet = function(petId, opts, callback) {
|
||||||
|
opts = opts || {};
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw "Missing the required parameter 'petId' when calling deletePet";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'petId': petId
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
'api_key': opts['apiKey']
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = ['petstore_auth'];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = null;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/pet/{petId}', 'DELETE',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
@ -183,7 +224,7 @@
|
|||||||
var formParams = {
|
var formParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var authNames = ['petstore_auth', 'api_key'];
|
var authNames = ['api_key', 'petstore_auth'];
|
||||||
var contentTypes = [];
|
var contentTypes = [];
|
||||||
var accepts = ['application/json', 'application/xml'];
|
var accepts = ['application/json', 'application/xml'];
|
||||||
var returnType = Pet;
|
var returnType = Pet;
|
||||||
@ -196,6 +237,117 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param {Integer} petId ID of pet that needs to be fetched
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
* data is of type: InlineResponse200
|
||||||
|
*/
|
||||||
|
self.getPetByIdInObject = function(petId, callback) {
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw "Missing the required parameter 'petId' when calling getPetByIdInObject";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'petId': petId
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = ['api_key', 'petstore_auth'];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = InlineResponse200;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/pet/{petId}?response=inline_arbitrary_object', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
* @param {Integer} petId ID of pet that needs to be fetched
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
* data is of type: 'String'
|
||||||
|
*/
|
||||||
|
self.petPetIdtestingByteArraytrueGet = function(petId, callback) {
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null) {
|
||||||
|
throw "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'petId': petId
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = ['api_key', 'petstore_auth'];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = 'String';
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/pet/{petId}?testing_byte_array=true', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
* @param {Pet} opts['body'] Pet object that needs to be added to the store
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
*/
|
||||||
|
self.updatePet = function(opts, callback) {
|
||||||
|
opts = opts || {};
|
||||||
|
var postBody = opts['body'];
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = ['petstore_auth'];
|
||||||
|
var contentTypes = ['application/json', 'application/xml'];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = null;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/pet', 'PUT',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a pet in the store with form data
|
* Updates a pet in the store with form data
|
||||||
*
|
*
|
||||||
@ -239,47 +391,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes a pet
|
|
||||||
*
|
|
||||||
* @param {Integer} petId Pet id to delete
|
|
||||||
* @param {String} opts['apiKey']
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
*/
|
|
||||||
self.deletePet = function(petId, opts, callback) {
|
|
||||||
opts = opts || {};
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
throw "Missing the required parameter 'petId' when calling deletePet";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'petId': petId
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
'api_key': opts['apiKey']
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = ['petstore_auth'];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/pet/{petId}', 'DELETE',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploads an image
|
* uploads an image
|
||||||
*
|
*
|
||||||
@ -323,117 +434,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param {Integer} petId ID of pet that needs to be fetched
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
* data is of type: InlineResponse200
|
|
||||||
*/
|
|
||||||
self.getPetByIdInObject = function(petId, callback) {
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
throw "Missing the required parameter 'petId' when calling getPetByIdInObject";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'petId': petId
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = ['petstore_auth', 'api_key'];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = InlineResponse200;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/pet/{petId}?response=inline_arbitrary_object', 'GET',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param {Integer} petId ID of pet that needs to be fetched
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
* data is of type: 'String'
|
|
||||||
*/
|
|
||||||
self.petPetIdtestingByteArraytrueGet = function(petId, callback) {
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
throw "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'petId': petId
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = ['petstore_auth', 'api_key'];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = 'String';
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/pet/{petId}?testing_byte_array=true', 'GET',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
*
|
|
||||||
* @param {String} opts['body'] Pet object in the form of byte array
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
*/
|
|
||||||
self.addPetUsingByteArray = function(opts, callback) {
|
|
||||||
opts = opts || {};
|
|
||||||
var postBody = opts['body'];
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = ['petstore_auth'];
|
|
||||||
var contentTypes = ['application/json', 'application/xml'];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/pet?testing_byte_array=true', 'POST',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,6 +21,44 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete purchase order by ID
|
||||||
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
* @param {String} orderId ID of the order that needs to be deleted
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
*/
|
||||||
|
self.deleteOrder = function(orderId, callback) {
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null) {
|
||||||
|
throw "Missing the required parameter 'orderId' when calling deleteOrder";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'orderId': orderId
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = [];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = null;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/store/order/{orderId}', 'DELETE',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds orders by status
|
* Finds orders by status
|
||||||
* A single status value can be provided as a string
|
* A single status value can be provided as a string
|
||||||
@ -120,6 +158,45 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find purchase order by ID
|
||||||
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
* @param {String} orderId ID of pet that needs to be fetched
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
* data is of type: Order
|
||||||
|
*/
|
||||||
|
self.getOrderById = function(orderId, callback) {
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null) {
|
||||||
|
throw "Missing the required parameter 'orderId' when calling getOrderById";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'orderId': orderId
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = ['test_api_key_header', 'test_api_key_query'];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = Order;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/store/order/{orderId}', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
@ -154,83 +231,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Find purchase order by ID
|
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
|
||||||
* @param {String} orderId ID of pet that needs to be fetched
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
* data is of type: Order
|
|
||||||
*/
|
|
||||||
self.getOrderById = function(orderId, callback) {
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
|
||||||
if (orderId == null) {
|
|
||||||
throw "Missing the required parameter 'orderId' when calling getOrderById";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'orderId': orderId
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = ['test_api_key_query', 'test_api_key_header'];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = Order;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/store/order/{orderId}', 'GET',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete purchase order by ID
|
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
|
||||||
* @param {String} orderId ID of the order that needs to be deleted
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
*/
|
|
||||||
self.deleteOrder = function(orderId, callback) {
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
|
||||||
if (orderId == null) {
|
|
||||||
throw "Missing the required parameter 'orderId' when calling deleteOrder";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'orderId': orderId
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = [];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/store/order/{orderId}', 'DELETE',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,6 +120,83 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param {String} username The name that needs to be deleted
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
*/
|
||||||
|
self.deleteUser = function(username, callback) {
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
throw "Missing the required parameter 'username' when calling deleteUser";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'username': username
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = [];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = null;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/user/{username}', 'DELETE',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
||||||
|
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
||||||
|
* data is of type: User
|
||||||
|
*/
|
||||||
|
self.getUserByName = function(username, callback) {
|
||||||
|
var postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
throw "Missing the required parameter 'username' when calling getUserByName";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pathParams = {
|
||||||
|
'username': username
|
||||||
|
};
|
||||||
|
var queryParams = {
|
||||||
|
};
|
||||||
|
var headerParams = {
|
||||||
|
};
|
||||||
|
var formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
var authNames = [];
|
||||||
|
var contentTypes = [];
|
||||||
|
var accepts = ['application/json', 'application/xml'];
|
||||||
|
var returnType = User;
|
||||||
|
|
||||||
|
return this.apiClient.callApi(
|
||||||
|
'/user/{username}', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, callback
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs user into the system
|
* Logs user into the system
|
||||||
*
|
*
|
||||||
@ -188,45 +265,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get user by user name
|
|
||||||
*
|
|
||||||
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
* data is of type: User
|
|
||||||
*/
|
|
||||||
self.getUserByName = function(username, callback) {
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
|
||||||
if (username == null) {
|
|
||||||
throw "Missing the required parameter 'username' when calling getUserByName";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'username': username
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = [];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = User;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/user/{username}', 'GET',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updated user
|
* Updated user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -267,44 +305,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete user
|
|
||||||
* This can only be done by the logged in user.
|
|
||||||
* @param {String} username The name that needs to be deleted
|
|
||||||
* @param {function} callback the callback function, accepting three arguments: error, data, response
|
|
||||||
*/
|
|
||||||
self.deleteUser = function(username, callback) {
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
|
||||||
if (username == null) {
|
|
||||||
throw "Missing the required parameter 'username' when calling deleteUser";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
'username': username
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = [];
|
|
||||||
var contentTypes = [];
|
|
||||||
var accepts = ['application/json', 'application/xml'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/user/{username}', 'DELETE',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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