forked from loafle/openapi-generator-original
add git_push and gitignore to most client generators
This commit is contained in:
@@ -157,6 +157,9 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
@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'.
|
||||
|
||||
// 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'.
|
||||
|
||||
@@ -302,6 +305,8 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
(sourceFolder + File.separator + invokerPackage).replace(".", File.separator), "ApiException.java"));
|
||||
supportingFiles.add(new SupportingFile("Pair.mustache",
|
||||
(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() {
|
||||
|
||||
@@ -210,6 +210,9 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
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("README.md", "", "README.md"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||
|
||||
|
||||
if (optionalAssemblyInfoFlag) {
|
||||
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);
|
||||
supportingFiles.add(new SupportingFile("project.mustache", "", "project.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
|
||||
|
||||
@@ -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/api_key_auth.mustache", authFolder, "api_key_auth.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"));
|
||||
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"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||
}
|
||||
|
||||
private static String dropDots(String str) {
|
||||
|
||||
@@ -129,6 +129,8 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
apiPackage = packageName;
|
||||
|
||||
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
|
||||
|
||||
@@ -301,6 +301,10 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
importMapping.put("LocalDate", "java.time.LocalDate");
|
||||
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() {
|
||||
|
||||
@@ -241,6 +241,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", sourceFolder, "index.js"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", sourceFolder, "ApiClient.js"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
}
|
||||
|
||||
@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("podspec.mustache", "", podName + ".podspec"));
|
||||
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
|
||||
|
||||
@@ -225,6 +225,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
supportingFiles.add(new SupportingFile("autoload.mustache", getPackagePath(), "autoload.php"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md"));
|
||||
supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
|
||||
}
|
||||
|
||||
@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__model.mustache", modelPackage, "__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) {
|
||||
|
||||
@@ -220,6 +220,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb"));
|
||||
supportingFiles.add(new SupportingFile("version.mustache", gemFolder, "version.rb"));
|
||||
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"));
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ public class ScalaClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||
supportingFiles.add(new SupportingFile("apiInvoker.mustache",
|
||||
(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("Set");
|
||||
|
||||
@@ -195,6 +195,9 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift"));
|
||||
supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.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
|
||||
|
||||
@@ -19,6 +19,10 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
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() {
|
||||
|
||||
@@ -18,6 +18,8 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
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() {
|
||||
|
||||
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
|
||||
@@ -35,24 +35,40 @@ public class JsonUtil {
|
||||
public static Type getListTypeForDeserialization(Class cls) {
|
||||
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)) {
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Category".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Category>>(){}.getType();
|
||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<SpecialModelName>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Tag>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken<List<Object>>(){}.getType();
|
||||
@@ -61,26 +77,42 @@ public class JsonUtil {
|
||||
public static Type getTypeForDeserialization(Class cls) {
|
||||
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)) {
|
||||
return new TypeToken<Category>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Tag>(){}.getType();
|
||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
||||
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)) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import io.swagger.client.model.*;
|
||||
import java.util.*;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import io.swagger.client.model.InlineResponse200;
|
||||
import java.io.File;
|
||||
|
||||
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
|
||||
*
|
||||
@@ -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
|
||||
* 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
|
||||
*
|
||||
@@ -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
|
||||
*
|
||||
@@ -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
|
||||
* A single status value can be provided as a string
|
||||
@@ -146,17 +204,16 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Order
|
||||
* 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
|
||||
*/
|
||||
public Order placeOrder (Order body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
public Object getInventoryInObject () throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
@@ -186,9 +243,9 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
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){
|
||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||
return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@@ -257,22 +314,17 @@ 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
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Order
|
||||
*/
|
||||
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");
|
||||
}
|
||||
public Order placeOrder (Order body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
@@ -302,12 +354,12 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
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){
|
||||
return ;
|
||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException 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
|
||||
*
|
||||
@@ -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
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
20
samples/client/petstore/clojure/.gitignore
vendored
20
samples/client/petstore/clojure/.gitignore
vendored
@@ -1,10 +1,12 @@
|
||||
/target
|
||||
/classes
|
||||
/checkouts
|
||||
pom.xml
|
||||
pom.xml.asc
|
||||
*.jar
|
||||
*.class
|
||||
/.lein-*
|
||||
/.nrepl-port
|
||||
.hgignore
|
||||
.hg/
|
||||
*jar
|
||||
/lib/
|
||||
/classes/
|
||||
/target/
|
||||
/checkouts/
|
||||
.lein-deps-sum
|
||||
.lein-repl-history
|
||||
.lein-plugins/
|
||||
.lein-failures
|
||||
.nrepl-port
|
||||
|
||||
@@ -2,28 +2,6 @@
|
||||
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
||||
(: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
|
||||
"Add a new pet to the store
|
||||
"
|
||||
@@ -46,6 +24,49 @@
|
||||
([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
|
||||
"Finds Pets by status
|
||||
Multiple status values can be provided with comma separated strings"
|
||||
@@ -99,7 +120,7 @@
|
||||
:form-params {}
|
||||
:content-types []
|
||||
:accepts ["application/json" "application/xml"]
|
||||
:auth-names ["petstore_auth" "api_key"]}))
|
||||
:auth-names ["api_key" "petstore_auth"]}))
|
||||
|
||||
(defn get-pet-by-id
|
||||
"Find pet by ID
|
||||
@@ -107,6 +128,66 @@
|
||||
[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
|
||||
"Updates a pet in the store with form data
|
||||
"
|
||||
@@ -128,27 +209,6 @@
|
||||
([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
|
||||
"uploads an image
|
||||
"
|
||||
@@ -169,44 +229,3 @@
|
||||
([pet-id ] (upload-file pet-id nil))
|
||||
([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]])
|
||||
(: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
|
||||
"Finds orders by status
|
||||
A single status value can be provided as a string"
|
||||
@@ -42,6 +61,44 @@
|
||||
[]
|
||||
(: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
|
||||
"Place an order for a pet
|
||||
"
|
||||
@@ -63,41 +120,3 @@
|
||||
([] (place-order nil))
|
||||
([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]
|
||||
(: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
|
||||
"Logs user into the system
|
||||
"
|
||||
@@ -108,25 +146,6 @@
|
||||
[]
|
||||
(: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
|
||||
"Updated user
|
||||
This can only be done by the logged in user."
|
||||
@@ -148,22 +167,3 @@
|
||||
([username ] (update-user username nil))
|
||||
([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)))
|
||||
|
||||
(def auth-definitions
|
||||
{"petstore_auth" {:type :oauth2}
|
||||
"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"}
|
||||
{"test_api_key_header" {:type :api-key :in :header :param-name "test_api_key_header"}
|
||||
"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_header" {:type :api-key :in :header :param-name "test_api_key_header"}})
|
||||
"petstore_auth" {:type :oauth2}})
|
||||
|
||||
(def default-api-context
|
||||
"Default API context."
|
||||
@@ -21,12 +21,12 @@
|
||||
:date-format "yyyy-MM-dd"
|
||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||
:debug false
|
||||
:auths {"petstore_auth" nil
|
||||
"test_api_client_id" nil
|
||||
"test_api_client_secret" nil
|
||||
:auths {"test_api_key_header" nil
|
||||
"api_key" nil
|
||||
"test_api_client_secret" nil
|
||||
"test_api_client_id" nil
|
||||
"test_api_key_query" nil
|
||||
"test_api_key_header" nil}})
|
||||
"petstore_auth" nil}})
|
||||
|
||||
(def ^:dynamic *api-context*
|
||||
"Dynamic API context to be applied in API calls."
|
||||
|
||||
@@ -1,2 +1,185 @@
|
||||
vendor/Newtonsoft.Json.8.0.2/
|
||||
vendor/RestSharp.105.2.3/
|
||||
# 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
|
||||
|
||||
@@ -3,6 +3,8 @@ package swagger
|
||||
import (
|
||||
"strings"
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/dghubble/sling"
|
||||
"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
|
||||
*/
|
||||
//func (a PetApi) UpdatePet (Body Pet) (error) {
|
||||
func (a PetApi) UpdatePet (Body Pet) (error) {
|
||||
//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)
|
||||
|
||||
|
||||
|
||||
// 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)
|
||||
|
||||
@@ -47,163 +534,58 @@ func (a PetApi) UpdatePet (Body Pet) (error) {
|
||||
}
|
||||
|
||||
// body params
|
||||
_sling = _sling.BodyJSON(Body)
|
||||
_sling = _sling.BodyJSON(body)
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("UpdatePet response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param PetId ID of pet that needs to be updated
|
||||
* @param Name Updated name of the pet
|
||||
* @param Status Updated status of the pet
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @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)
|
||||
|
||||
// create path and map variables
|
||||
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)
|
||||
|
||||
@@ -215,96 +597,61 @@ func (a PetApi) UpdatePetWithForm (PetId string, Name string, Status string) (er
|
||||
}
|
||||
|
||||
type FormParams struct {
|
||||
Name string `url:"name,omitempty"`
|
||||
Status string `url:"status,omitempty"`
|
||||
name string `url:"name,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)
|
||||
//fmt.Println("UpdatePetWithForm response: void, ", resp, err)
|
||||
// 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)
|
||||
|
||||
|
||||
|
||||
|
||||
_, 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
|
||||
*
|
||||
* @param PetId ID of pet to update
|
||||
* @param AdditionalMetadata Additional data to pass to server
|
||||
* @param File file to upload
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @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)
|
||||
|
||||
// create path and map variables
|
||||
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)
|
||||
|
||||
@@ -316,14 +663,42 @@ func (a PetApi) UploadFile (PetId int64, AdditionalMetadata string, File *os.Fil
|
||||
}
|
||||
|
||||
type FormParams struct {
|
||||
AdditionalMetadata string `url:"additionalMetadata,omitempty"`
|
||||
File *os.File `url:"file,omitempty"`
|
||||
additionalMetadata string `url:"additionalMetadata,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)
|
||||
//fmt.Println("UploadFile response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package swagger
|
||||
import (
|
||||
"strings"
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"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 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)
|
||||
_, err := _sling.ReceiveSuccess(response)
|
||||
//fmt.Println("GetInventory response: ", response, resp, err)
|
||||
return *response, err
|
||||
// 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 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
|
||||
*
|
||||
* @param Body order placed for purchasing the pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @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)
|
||||
|
||||
@@ -75,73 +343,39 @@ func (a StoreApi) PlaceOrder (Body Order) (Order, error) {
|
||||
}
|
||||
|
||||
// body params
|
||||
_sling = _sling.BodyJSON(Body)
|
||||
_sling = _sling.BodyJSON(body)
|
||||
|
||||
var successPayload = new(Order)
|
||||
|
||||
response := new(Order)
|
||||
_, err := _sling.ReceiveSuccess(response)
|
||||
//fmt.Println("PlaceOrder response: ", response, resp, err)
|
||||
return *response, err
|
||||
// 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))
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
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
|
||||
return *successPayload, err
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package swagger
|
||||
import (
|
||||
"strings"
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/dghubble/sling"
|
||||
)
|
||||
|
||||
@@ -25,11 +27,11 @@ func NewUserApiWithBasePath(basePath string) *UserApi{
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param Body Created user object
|
||||
* @param body Created user object
|
||||
* @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)
|
||||
|
||||
@@ -46,22 +48,50 @@ func (a UserApi) CreateUser (Body User) (error) {
|
||||
}
|
||||
|
||||
// body params
|
||||
_sling = _sling.BodyJSON(Body)
|
||||
_sling = _sling.BodyJSON(body)
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("CreateUser response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param Body List of user object
|
||||
* @param body List of user object
|
||||
* @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)
|
||||
|
||||
@@ -78,22 +108,50 @@ func (a UserApi) CreateUsersWithArrayInput (Body []User) (error) {
|
||||
}
|
||||
|
||||
// body params
|
||||
_sling = _sling.BodyJSON(Body)
|
||||
_sling = _sling.BodyJSON(body)
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("CreateUsersWithArrayInput response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param Body List of user object
|
||||
* @param body List of user object
|
||||
* @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)
|
||||
|
||||
@@ -110,37 +168,59 @@ func (a UserApi) CreateUsersWithListInput (Body []User) (error) {
|
||||
}
|
||||
|
||||
// body params
|
||||
_sling = _sling.BodyJSON(Body)
|
||||
_sling = _sling.BodyJSON(body)
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("CreateUsersWithListInput response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param Username The user name for login
|
||||
* @param Password The password for login in clear text
|
||||
* @return string
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
//func (a UserApi) LoginUser (Username string, Password string) (string, error) {
|
||||
func (a UserApi) LoginUser (Username string, Password string) (string, error) {
|
||||
//func (a UserApi) DeleteUser (username 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
|
||||
path := "/v2/user/login"
|
||||
path := "/v2/user/{username}"
|
||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||
|
||||
_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 {
|
||||
@@ -150,10 +230,162 @@ func (a UserApi) LoginUser (Username string, Password string) (string, error) {
|
||||
|
||||
|
||||
|
||||
response := new(string)
|
||||
_, err := _sling.ReceiveSuccess(response)
|
||||
//fmt.Println("LoginUser response: ", response, resp, err)
|
||||
return *response, err
|
||||
|
||||
// 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
|
||||
}
|
||||
/**
|
||||
* 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
|
||||
@@ -180,56 +412,53 @@ func (a UserApi) LogoutUser () (error) {
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("LogoutUser response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
/**
|
||||
* 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
|
||||
* This can only be done by the logged in user.
|
||||
* @param Username name that need to be deleted
|
||||
* @param Body Updated user object
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @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)
|
||||
|
||||
// create path and map variables
|
||||
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)
|
||||
|
||||
@@ -241,42 +470,39 @@ func (a UserApi) UpdateUser (Username string, Body User) (error) {
|
||||
}
|
||||
|
||||
// body params
|
||||
_sling = _sling.BodyJSON(Body)
|
||||
_sling = _sling.BodyJSON(body)
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("UpdateUser response: void, ", resp, err)
|
||||
return err
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param Username The name that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
//func (a UserApi) DeleteUser (Username string) (error) {
|
||||
func (a UserApi) DeleteUser (Username string) (error) {
|
||||
|
||||
_sling := sling.New().Delete(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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
_, err := _sling.ReceiveSuccess(nil)
|
||||
//fmt.Println("DeleteUser response: void, ", resp, err)
|
||||
// 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
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.swagger.client;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private int code = 0;
|
||||
private Map<String, List<String>> responseHeaders = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private static ApiClient defaultApiClient = new ApiClient();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 {
|
||||
private String name = "";
|
||||
private String value = "";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* 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.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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@@ -294,7 +294,7 @@ public class PetApi {
|
||||
};
|
||||
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>() {};
|
||||
@@ -342,7 +342,7 @@ public class PetApi {
|
||||
};
|
||||
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>() {};
|
||||
@@ -390,7 +390,7 @@ public class PetApi {
|
||||
};
|
||||
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[]>() {};
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@@ -247,7 +247,7 @@ public class StoreApi {
|
||||
};
|
||||
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>() {};
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private final String location;
|
||||
private final String paramName;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
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 {
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
private String name = null;
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
private Long id = null;
|
||||
private Object category = null;
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@@ -42,39 +40,24 @@ public class InlineResponse200 {
|
||||
}
|
||||
|
||||
private StatusEnum status = null;
|
||||
private String name = null;
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
public InlineResponse200 photoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
public InlineResponse200 tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("photoUrls")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
@JsonProperty("tags")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
**/
|
||||
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 void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
**/
|
||||
@@ -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
|
||||
public boolean equals(java.lang.Object o) {
|
||||
@@ -157,17 +157,17 @@ public class InlineResponse200 {
|
||||
return false;
|
||||
}
|
||||
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
|
||||
return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) &&
|
||||
Objects.equals(this.name, inlineResponse200.name) &&
|
||||
return Objects.equals(this.tags, inlineResponse200.tags) &&
|
||||
Objects.equals(this.id, inlineResponse200.id) &&
|
||||
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
|
||||
public int hashCode() {
|
||||
return Objects.hash(photoUrls, name, id, category, tags, status);
|
||||
return Objects.hash(tags, id, category, status, name, photoUrls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,12 +175,12 @@ public class InlineResponse200 {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponse200 {\n");
|
||||
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).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(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append("}");
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
private Long id = null;
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
this.basePath = 'http://petstore.swagger.io/v2'.replace(/\/+$/, '');
|
||||
|
||||
this.authentications = {
|
||||
'petstore_auth': {type: 'oauth2'},
|
||||
'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'},
|
||||
'test_api_key_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'},
|
||||
'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_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'}
|
||||
'petstore_auth': {type: 'oauth2'}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,39 +21,6 @@
|
||||
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
|
||||
*
|
||||
@@ -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
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
@@ -183,7 +224,7 @@
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['petstore_auth', 'api_key'];
|
||||
var authNames = ['api_key', 'petstore_auth'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
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
|
||||
*
|
||||
@@ -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
|
||||
*
|
||||
@@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
*
|
||||
@@ -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
|
||||
*
|
||||
@@ -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
|
||||
* 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
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['./ApiClient', './model/Order', './model/SpecialModelName', './model/User', './model/Category', './model/ObjectReturn', './model/InlineResponse200', './model/Tag', './model/Pet', './api/UserApi', './api/StoreApi', './api/PetApi'], factory);
|
||||
define(['./ApiClient', './model/Category', './model/InlineResponse200', './model/ModelReturn', './model/Name', './model/Order', './model/Pet', './model/SpecialModelName', './model/Tag', './model/User', './api/PetApi', './api/StoreApi', './api/UserApi'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Order'), require('./model/SpecialModelName'), require('./model/User'), require('./model/Category'), require('./model/ObjectReturn'), require('./model/InlineResponse200'), require('./model/Tag'), require('./model/Pet'), require('./api/UserApi'), require('./api/StoreApi'), require('./api/PetApi'));
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/InlineResponse200'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
}
|
||||
}(function(ApiClient, Order, SpecialModelName, User, Category, ObjectReturn, InlineResponse200, Tag, Pet, UserApi, StoreApi, PetApi) {
|
||||
}(function(ApiClient, Category, InlineResponse200, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, PetApi, StoreApi, UserApi) {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
ApiClient: ApiClient,
|
||||
Order: Order,
|
||||
SpecialModelName: SpecialModelName,
|
||||
User: User,
|
||||
Category: Category,
|
||||
ObjectReturn: ObjectReturn,
|
||||
InlineResponse200: InlineResponse200,
|
||||
Tag: Tag,
|
||||
ModelReturn: ModelReturn,
|
||||
Name: Name,
|
||||
Order: Order,
|
||||
Pet: Pet,
|
||||
UserApi: UserApi,
|
||||
SpecialModelName: SpecialModelName,
|
||||
Tag: Tag,
|
||||
User: User,
|
||||
PetApi: PetApi,
|
||||
StoreApi: StoreApi,
|
||||
PetApi: PetApi
|
||||
UserApi: UserApi
|
||||
};
|
||||
}));
|
||||
|
||||
@@ -31,12 +31,8 @@
|
||||
}
|
||||
var _this = new InlineResponse200();
|
||||
|
||||
if (data['photoUrls']) {
|
||||
_this['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']);
|
||||
}
|
||||
|
||||
if (data['name']) {
|
||||
_this['name'] = ApiClient.convertToType(data['name'], 'String');
|
||||
if (data['tags']) {
|
||||
_this['tags'] = ApiClient.convertToType(data['tags'], [Tag]);
|
||||
}
|
||||
|
||||
if (data['id']) {
|
||||
@@ -47,45 +43,35 @@
|
||||
_this['category'] = ApiClient.convertToType(data['category'], Object);
|
||||
}
|
||||
|
||||
if (data['tags']) {
|
||||
_this['tags'] = ApiClient.convertToType(data['tags'], [Tag]);
|
||||
}
|
||||
|
||||
if (data['status']) {
|
||||
_this['status'] = ApiClient.convertToType(data['status'], 'String');
|
||||
}
|
||||
|
||||
if (data['name']) {
|
||||
_this['name'] = ApiClient.convertToType(data['name'], 'String');
|
||||
}
|
||||
|
||||
if (data['photoUrls']) {
|
||||
_this['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']);
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return {[String]}
|
||||
* @return {[Tag]}
|
||||
**/
|
||||
InlineResponse200.prototype.getPhotoUrls = function() {
|
||||
return this['photoUrls'];
|
||||
InlineResponse200.prototype.getTags = function() {
|
||||
return this['tags'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {[String]} photoUrls
|
||||
* @param {[Tag]} tags
|
||||
**/
|
||||
InlineResponse200.prototype.setPhotoUrls = function(photoUrls) {
|
||||
this['photoUrls'] = photoUrls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {String}
|
||||
**/
|
||||
InlineResponse200.prototype.getName = function() {
|
||||
return this['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} name
|
||||
**/
|
||||
InlineResponse200.prototype.setName = function(name) {
|
||||
this['name'] = name;
|
||||
InlineResponse200.prototype.setTags = function(tags) {
|
||||
this['tags'] = tags;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,20 +102,6 @@
|
||||
this['category'] = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {[Tag]}
|
||||
**/
|
||||
InlineResponse200.prototype.getTags = function() {
|
||||
return this['tags'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {[Tag]} tags
|
||||
**/
|
||||
InlineResponse200.prototype.setTags = function(tags) {
|
||||
this['tags'] = tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* get pet status in the store
|
||||
* @return {StatusEnum}
|
||||
@@ -146,6 +118,34 @@
|
||||
this['status'] = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {String}
|
||||
**/
|
||||
InlineResponse200.prototype.getName = function() {
|
||||
return this['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} name
|
||||
**/
|
||||
InlineResponse200.prototype.setName = function(name) {
|
||||
this['name'] = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {[String]}
|
||||
**/
|
||||
InlineResponse200.prototype.getPhotoUrls = function() {
|
||||
return this['photoUrls'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {[String]} photoUrls
|
||||
**/
|
||||
InlineResponse200.prototype.setPhotoUrls = function(photoUrls) {
|
||||
this['photoUrls'] = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var StatusEnum = {
|
||||
|
||||
@@ -12,14 +12,15 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
#import "SWGUser.h"
|
||||
#import "SWGCategory.h"
|
||||
#import "SWGPet.h"
|
||||
#import "SWGTag.h"
|
||||
#import "SWGReturn.h"
|
||||
#import "SWGOrder.h"
|
||||
#import "SWGSpecialModelName_.h"
|
||||
#import "SWGInlineResponse200.h"
|
||||
#import "SWGName.h"
|
||||
#import "SWGOrder.h"
|
||||
#import "SWGPet.h"
|
||||
#import "SWGReturn.h"
|
||||
#import "SWGSpecialModelName_.h"
|
||||
#import "SWGTag.h"
|
||||
#import "SWGUser.h"
|
||||
|
||||
|
||||
@class SWGConfiguration;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
#import "SWGTag.h"
|
||||
|
||||
|
||||
@protocol SWGInlineResponse200
|
||||
@@ -15,10 +16,17 @@
|
||||
@interface SWGInlineResponse200 : SWGObject
|
||||
|
||||
|
||||
@property(nonatomic) NSArray<SWGTag>* tags;
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
|
||||
@property(nonatomic) NSObject* category;
|
||||
/* pet status in the store [optional]
|
||||
*/
|
||||
@property(nonatomic) NSString* status;
|
||||
|
||||
@property(nonatomic) NSString* name;
|
||||
|
||||
@property(nonatomic) NSArray* /* NSString */ photoUrls;
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
+ (JSONKeyMapper *)keyMapper
|
||||
{
|
||||
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"category": @"category", @"name": @"name" }];
|
||||
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"tags": @"tags", @"id": @"_id", @"category": @"category", @"status": @"status", @"name": @"name", @"photoUrls": @"photoUrls" }];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
+ (BOOL)propertyIsOptional:(NSString *)propertyName
|
||||
{
|
||||
NSArray *optionalProperties = @[@"category", @"name"];
|
||||
NSArray *optionalProperties = @[@"tags", @"category", @"status", @"name", @"photoUrls"];
|
||||
|
||||
if ([optionalProperties containsObject:propertyName]) {
|
||||
return YES;
|
||||
|
||||
@@ -20,19 +20,6 @@
|
||||
-(unsigned long) requestQueueSize;
|
||||
+(SWGPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;
|
||||
+(SWGPetApi*) sharedAPI;
|
||||
///
|
||||
///
|
||||
/// Update an existing pet
|
||||
///
|
||||
///
|
||||
/// @param body Pet object that needs to be added to the store
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) updatePetWithBody: (SWGPet*) body
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Add a new pet to the store
|
||||
@@ -46,6 +33,34 @@
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// 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
|
||||
-(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Deletes a pet
|
||||
///
|
||||
///
|
||||
/// @param petId Pet id to delete
|
||||
/// @param apiKey
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
|
||||
apiKey: (NSString*) apiKey
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Finds Pets by status
|
||||
@@ -85,55 +100,6 @@
|
||||
completionHandler: (void (^)(SWGPet* output, NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Updates a pet in the store with form data
|
||||
///
|
||||
///
|
||||
/// @param petId ID of pet that needs to be updated
|
||||
/// @param name Updated name of the pet
|
||||
/// @param status Updated status of the pet
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
|
||||
name: (NSString*) name
|
||||
status: (NSString*) status
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Deletes a pet
|
||||
///
|
||||
///
|
||||
/// @param petId Pet id to delete
|
||||
/// @param apiKey
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
|
||||
apiKey: (NSString*) apiKey
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// uploads an image
|
||||
///
|
||||
///
|
||||
/// @param petId ID of pet to update
|
||||
/// @param additionalMetadata Additional data to pass to server
|
||||
/// @param file file to upload
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
|
||||
additionalMetadata: (NSString*) additionalMetadata
|
||||
file: (NSURL*) file
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
@@ -162,14 +128,48 @@
|
||||
|
||||
///
|
||||
///
|
||||
/// Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
/// Update an existing pet
|
||||
///
|
||||
///
|
||||
/// @param body Pet object in the form of byte array
|
||||
/// @param body Pet object that needs to be added to the store
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body
|
||||
-(NSNumber*) updatePetWithBody: (SWGPet*) body
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Updates a pet in the store with form data
|
||||
///
|
||||
///
|
||||
/// @param petId ID of pet that needs to be updated
|
||||
/// @param name Updated name of the pet
|
||||
/// @param status Updated status of the pet
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
|
||||
name: (NSString*) name
|
||||
status: (NSString*) status
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// uploads an image
|
||||
///
|
||||
///
|
||||
/// @param petId ID of pet to update
|
||||
/// @param additionalMetadata Additional data to pass to server
|
||||
/// @param file file to upload
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
|
||||
additionalMetadata: (NSString*) additionalMetadata
|
||||
file: (NSURL*) file
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
|
||||
@@ -70,81 +70,6 @@ static SWGPetApi* singletonAPI = nil;
|
||||
|
||||
#pragma mark - Api Methods
|
||||
|
||||
///
|
||||
/// Update an existing pet
|
||||
///
|
||||
/// @param body Pet object that needs to be added to the store
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) updatePetWithBody: (SWGPet*) body
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
bodyParam = body;
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"PUT"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Add a new pet to the store
|
||||
///
|
||||
@@ -220,6 +145,170 @@ static SWGPetApi* singletonAPI = nil;
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// 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
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet?testing_byte_array=true"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
bodyParam = body;
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Deletes a pet
|
||||
///
|
||||
/// @param petId Pet id to delete
|
||||
///
|
||||
/// @param apiKey
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
|
||||
apiKey: (NSString*) apiKey
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `deletePet`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (petId != nil) {
|
||||
pathParams[@"petId"] = petId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
if (apiKey != nil) {
|
||||
headerParams[@"api_key"] = apiKey;
|
||||
}
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"DELETE"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Finds Pets by status
|
||||
/// Multiple status values can be provided with comma separated strings
|
||||
@@ -465,295 +554,6 @@ static SWGPetApi* singletonAPI = nil;
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Updates a pet in the store with form data
|
||||
///
|
||||
/// @param petId ID of pet that needs to be updated
|
||||
///
|
||||
/// @param name Updated name of the pet
|
||||
///
|
||||
/// @param status Updated status of the pet
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
|
||||
name: (NSString*) name
|
||||
status: (NSString*) status
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `updatePetWithForm`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (petId != nil) {
|
||||
pathParams[@"petId"] = petId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/x-www-form-urlencoded"]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
if (name) {
|
||||
formParams[@"name"] = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (status) {
|
||||
formParams[@"status"] = status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Deletes a pet
|
||||
///
|
||||
/// @param petId Pet id to delete
|
||||
///
|
||||
/// @param apiKey
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
|
||||
apiKey: (NSString*) apiKey
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `deletePet`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (petId != nil) {
|
||||
pathParams[@"petId"] = petId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
if (apiKey != nil) {
|
||||
headerParams[@"api_key"] = apiKey;
|
||||
}
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"DELETE"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// uploads an image
|
||||
///
|
||||
/// @param petId ID of pet to update
|
||||
///
|
||||
/// @param additionalMetadata Additional data to pass to server
|
||||
///
|
||||
/// @param file file to upload
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
|
||||
additionalMetadata: (NSString*) additionalMetadata
|
||||
file: (NSURL*) file
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `uploadFile`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (petId != nil) {
|
||||
pathParams[@"petId"] = petId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"multipart/form-data"]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata) {
|
||||
formParams[@"additionalMetadata"] = additionalMetadata;
|
||||
}
|
||||
|
||||
|
||||
|
||||
localVarFiles[@"file"] = file;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// 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
|
||||
@@ -921,18 +721,18 @@ static SWGPetApi* singletonAPI = nil;
|
||||
}
|
||||
|
||||
///
|
||||
/// Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
/// Update an existing pet
|
||||
///
|
||||
/// @param body Pet object in the form of byte array
|
||||
/// @param body Pet object that needs to be added to the store
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) addPetUsingByteArrayWithBody: (NSString*) body
|
||||
-(NSNumber*) updatePetWithBody: (SWGPet*) body
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet?testing_byte_array=true"];
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
@@ -977,6 +777,206 @@ static SWGPetApi* singletonAPI = nil;
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"PUT"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Updates a pet in the store with form data
|
||||
///
|
||||
/// @param petId ID of pet that needs to be updated
|
||||
///
|
||||
/// @param name Updated name of the pet
|
||||
///
|
||||
/// @param status Updated status of the pet
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
|
||||
name: (NSString*) name
|
||||
status: (NSString*) status
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `updatePetWithForm`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (petId != nil) {
|
||||
pathParams[@"petId"] = petId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/x-www-form-urlencoded"]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
if (name) {
|
||||
formParams[@"name"] = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (status) {
|
||||
formParams[@"status"] = status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// uploads an image
|
||||
///
|
||||
/// @param petId ID of pet to update
|
||||
///
|
||||
/// @param additionalMetadata Additional data to pass to server
|
||||
///
|
||||
/// @param file file to upload
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
|
||||
additionalMetadata: (NSString*) additionalMetadata
|
||||
file: (NSURL*) file
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `uploadFile`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (petId != nil) {
|
||||
pathParams[@"petId"] = petId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"multipart/form-data"]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata) {
|
||||
formParams[@"additionalMetadata"] = additionalMetadata;
|
||||
}
|
||||
|
||||
|
||||
|
||||
localVarFiles[@"file"] = file;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
|
||||
@@ -19,6 +19,19 @@
|
||||
-(unsigned long) requestQueueSize;
|
||||
+(SWGStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;
|
||||
+(SWGStoreApi*) sharedAPI;
|
||||
///
|
||||
///
|
||||
/// 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
|
||||
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Finds orders by status
|
||||
@@ -56,19 +69,6 @@
|
||||
(void (^)(NSObject* output, NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Place an order for a pet
|
||||
///
|
||||
///
|
||||
/// @param body order placed for purchasing the pet
|
||||
///
|
||||
///
|
||||
/// @return SWGOrder*
|
||||
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Find purchase order by ID
|
||||
@@ -84,15 +84,15 @@
|
||||
|
||||
///
|
||||
///
|
||||
/// 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
|
||||
/// Place an order for a pet
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
/// @param body order placed for purchasing the pet
|
||||
///
|
||||
///
|
||||
/// @return SWGOrder*
|
||||
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -69,6 +69,89 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
|
||||
#pragma mark - Api Methods
|
||||
|
||||
///
|
||||
/// 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
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `orderId` when calling `deleteOrder`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (orderId != nil) {
|
||||
pathParams[@"orderId"] = orderId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"DELETE"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Finds orders by status
|
||||
/// A single status value can be provided as a string
|
||||
@@ -294,81 +377,6 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Place an order for a pet
|
||||
///
|
||||
/// @param body order placed for purchasing the pet
|
||||
///
|
||||
/// @returns SWGOrder*
|
||||
///
|
||||
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
|
||||
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"test_api_client_id", @"test_api_client_secret"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
bodyParam = body;
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: @"SWGOrder*"
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler((SWGOrder*)data, error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Find purchase order by ID
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
@@ -453,23 +461,18 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
}
|
||||
|
||||
///
|
||||
/// 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
|
||||
/// Place an order for a pet
|
||||
///
|
||||
/// @returns void
|
||||
/// @param body order placed for purchasing the pet
|
||||
///
|
||||
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
/// @returns SWGOrder*
|
||||
///
|
||||
-(NSNumber*) placeOrderWithBody: (SWGOrder*) body
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `orderId` when calling `deleteOrder`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"];
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
@@ -477,9 +480,6 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (orderId != nil) {
|
||||
pathParams[@"orderId"] = orderId;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
@@ -507,18 +507,18 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
NSArray *authSettings = @[@"test_api_client_id", @"test_api_client_secret"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
bodyParam = body;
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"DELETE"
|
||||
method: @"POST"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
@@ -528,9 +528,9 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
responseType: @"SWGOrder*"
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
handler((SWGOrder*)data, error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -58,6 +58,32 @@
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Delete user
|
||||
/// This can only be done by the logged in user.
|
||||
///
|
||||
/// @param username The name that needs to be deleted
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) deleteUserWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Get user by user name
|
||||
///
|
||||
///
|
||||
/// @param username The name that needs to be fetched. Use user1 for testing.
|
||||
///
|
||||
///
|
||||
/// @return SWGUser*
|
||||
-(NSNumber*) getUserByNameWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Logs user into the system
|
||||
@@ -85,19 +111,6 @@
|
||||
(void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Get user by user name
|
||||
///
|
||||
///
|
||||
/// @param username The name that needs to be fetched. Use user1 for testing.
|
||||
///
|
||||
///
|
||||
/// @return SWGUser*
|
||||
-(NSNumber*) getUserByNameWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Updated user
|
||||
@@ -113,18 +126,5 @@
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// Delete user
|
||||
/// This can only be done by the logged in user.
|
||||
///
|
||||
/// @param username The name that needs to be deleted
|
||||
///
|
||||
///
|
||||
/// @return
|
||||
-(NSNumber*) deleteUserWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -294,6 +294,172 @@ static SWGUserApi* singletonAPI = nil;
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Delete user
|
||||
/// This can only be done by the logged in user.
|
||||
/// @param username The name that needs to be deleted
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) deleteUserWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `deleteUser`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (username != nil) {
|
||||
pathParams[@"username"] = username;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"DELETE"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Get user by user name
|
||||
///
|
||||
/// @param username The name that needs to be fetched. Use user1 for testing.
|
||||
///
|
||||
/// @returns SWGUser*
|
||||
///
|
||||
-(NSNumber*) getUserByNameWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `getUserByName`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (username != nil) {
|
||||
pathParams[@"username"] = username;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"GET"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: @"SWGUser*"
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler((SWGUser*)data, error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Logs user into the system
|
||||
///
|
||||
@@ -453,89 +619,6 @@ static SWGUserApi* singletonAPI = nil;
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Get user by user name
|
||||
///
|
||||
/// @param username The name that needs to be fetched. Use user1 for testing.
|
||||
///
|
||||
/// @returns SWGUser*
|
||||
///
|
||||
-(NSNumber*) getUserByNameWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(SWGUser* output, NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `getUserByName`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (username != nil) {
|
||||
pathParams[@"username"] = username;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"GET"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: @"SWGUser*"
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler((SWGUser*)data, error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Updated user
|
||||
/// This can only be done by the logged in user.
|
||||
@@ -622,89 +705,6 @@ static SWGUserApi* singletonAPI = nil;
|
||||
];
|
||||
}
|
||||
|
||||
///
|
||||
/// Delete user
|
||||
/// This can only be done by the logged in user.
|
||||
/// @param username The name that needs to be deleted
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSNumber*) deleteUserWithUsername: (NSString*) username
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `deleteUser`"];
|
||||
}
|
||||
|
||||
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];
|
||||
|
||||
// remove format in URL if needed
|
||||
if ([resourcePath rangeOfString:@".{format}"].location != NSNotFound) {
|
||||
[resourcePath replaceCharactersInRange: [resourcePath rangeOfString:@".{format}"] withString:@".json"];
|
||||
}
|
||||
|
||||
NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
|
||||
if (username != nil) {
|
||||
pathParams[@"username"] = username;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
|
||||
|
||||
// HTTP header `Accept`
|
||||
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||
if ([headerParams[@"Accept"] length] == 0) {
|
||||
[headerParams removeObjectForKey:@"Accept"];
|
||||
}
|
||||
|
||||
// response content type
|
||||
NSString *responseContentType;
|
||||
if ([headerParams objectForKey:@"Accept"]) {
|
||||
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||
}
|
||||
else {
|
||||
responseContentType = @"";
|
||||
}
|
||||
|
||||
// request content type
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return [self.apiClient requestWithPath: resourcePath
|
||||
method: @"DELETE"
|
||||
pathParams: pathParams
|
||||
queryParams: queryParams
|
||||
formParams: formParams
|
||||
files: localVarFiles
|
||||
body: bodyParam
|
||||
headerParams: headerParams
|
||||
authSettings: authSettings
|
||||
requestContentType: requestContentType
|
||||
responseContentType: responseContentType
|
||||
responseType: nil
|
||||
completionBlock: ^(id data, NSError *error) {
|
||||
handler(error);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore
|
||||
|
||||
Automatically generated by the Perl Swagger Codegen project:
|
||||
|
||||
- Build date: 2016-03-11T16:15:14.769+08:00
|
||||
- Build date: 2016-03-12T17:06:52.449+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
- Codegen version:
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
|
||||
default => sub { {
|
||||
app_name => 'Swagger Petstore',
|
||||
app_version => '1.0.0',
|
||||
generated_date => '2016-03-11T16:15:14.769+08:00',
|
||||
generated_date => '2016-03-12T17:06:52.449+08:00',
|
||||
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
|
||||
} },
|
||||
documentation => 'Information about the application version and the codegen codebase version'
|
||||
@@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project:
|
||||
|
||||
=over 4
|
||||
|
||||
=item Build date: 2016-03-11T16:15:14.769+08:00
|
||||
=item Build date: 2016-03-12T17:06:52.449+08:00
|
||||
|
||||
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
|
||||
@@ -91,90 +91,6 @@ class PetApi
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* updatePet
|
||||
*
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePet($body = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->updatePetWithHttpInfo ($body);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* updatePetWithHttpInfo
|
||||
*
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePetWithHttpInfo($body = null)
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml'));
|
||||
|
||||
|
||||
|
||||
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($body)) {
|
||||
$_tempBody = $body;
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'PUT',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* addPet
|
||||
*
|
||||
@@ -259,6 +175,188 @@ class PetApi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* addPetUsingByteArray
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
* @param string $body Pet object in the form of byte array (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetUsingByteArray($body = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->addPetUsingByteArrayWithHttpInfo ($body);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addPetUsingByteArrayWithHttpInfo
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
* @param string $body Pet object in the form of byte array (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetUsingByteArrayWithHttpInfo($body = null)
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet?testing_byte_array=true";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml'));
|
||||
|
||||
|
||||
|
||||
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($body)) {
|
||||
$_tempBody = $body;
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deletePet
|
||||
*
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param int $pet_id Pet id to delete (required)
|
||||
* @param string $api_key (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deletePet($pet_id, $api_key = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->deletePetWithHttpInfo ($pet_id, $api_key);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deletePetWithHttpInfo
|
||||
*
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param int $pet_id Pet id to delete (required)
|
||||
* @param string $api_key (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deletePetWithHttpInfo($pet_id, $api_key = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
// header params
|
||||
|
||||
if ($api_key !== null) {
|
||||
$headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key);
|
||||
}
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* findPetsByStatus
|
||||
*
|
||||
@@ -558,326 +656,6 @@ class PetApi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* updatePetWithForm
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param string $pet_id ID of pet that needs to be updated (required)
|
||||
* @param string $name Updated name of the pet (optional)
|
||||
* @param string $status Updated status of the pet (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePetWithForm($pet_id, $name = null, $status = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* updatePetWithFormWithHttpInfo
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param string $pet_id ID of pet that needs to be updated (required)
|
||||
* @param string $name Updated name of the pet (optional)
|
||||
* @param string $status Updated status of the pet (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/x-www-form-urlencoded'));
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
// form params
|
||||
if ($name !== null) {
|
||||
|
||||
|
||||
$formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name);
|
||||
|
||||
}// form params
|
||||
if ($status !== null) {
|
||||
|
||||
|
||||
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deletePet
|
||||
*
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param int $pet_id Pet id to delete (required)
|
||||
* @param string $api_key (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deletePet($pet_id, $api_key = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->deletePetWithHttpInfo ($pet_id, $api_key);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deletePetWithHttpInfo
|
||||
*
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param int $pet_id Pet id to delete (required)
|
||||
* @param string $api_key (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deletePetWithHttpInfo($pet_id, $api_key = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
// header params
|
||||
|
||||
if ($api_key !== null) {
|
||||
$headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key);
|
||||
}
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* uploadFile
|
||||
*
|
||||
* uploads an image
|
||||
*
|
||||
* @param int $pet_id ID of pet to update (required)
|
||||
* @param string $additional_metadata Additional data to pass to server (optional)
|
||||
* @param \SplFileObject $file file to upload (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function uploadFile($pet_id, $additional_metadata = null, $file = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploadFileWithHttpInfo
|
||||
*
|
||||
* uploads an image
|
||||
*
|
||||
* @param int $pet_id ID of pet to update (required)
|
||||
* @param string $additional_metadata Additional data to pass to server (optional)
|
||||
* @param \SplFileObject $file file to upload (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}/uploadImage";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('multipart/form-data'));
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
// form params
|
||||
if ($additional_metadata !== null) {
|
||||
|
||||
|
||||
$formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata);
|
||||
|
||||
}// form params
|
||||
if ($file !== null) {
|
||||
|
||||
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
|
||||
// See: https://wiki.php.net/rfc/curl-file-upload
|
||||
if (function_exists('curl_file_create')) {
|
||||
$formParams['file'] = curl_file_create($this->apiClient->getSerializer()->toFormValue($file));
|
||||
} else {
|
||||
$formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPetByIdInObject
|
||||
*
|
||||
@@ -1093,36 +871,36 @@ class PetApi
|
||||
}
|
||||
|
||||
/**
|
||||
* addPetUsingByteArray
|
||||
* updatePet
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param string $body Pet object in the form of byte array (optional)
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetUsingByteArray($body = null)
|
||||
public function updatePet($body = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->addPetUsingByteArrayWithHttpInfo ($body);
|
||||
list($response, $statusCode, $httpHeader) = $this->updatePetWithHttpInfo ($body);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addPetUsingByteArrayWithHttpInfo
|
||||
* updatePetWithHttpInfo
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param string $body Pet object in the form of byte array (optional)
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetUsingByteArrayWithHttpInfo($body = null)
|
||||
public function updatePetWithHttpInfo($body = null)
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet?testing_byte_array=true";
|
||||
$resourcePath = "/pet";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
@@ -1146,6 +924,228 @@ class PetApi
|
||||
$_tempBody = $body;
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'PUT',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* updatePetWithForm
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param string $pet_id ID of pet that needs to be updated (required)
|
||||
* @param string $name Updated name of the pet (optional)
|
||||
* @param string $status Updated status of the pet (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePetWithForm($pet_id, $name = null, $status = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* updatePetWithFormWithHttpInfo
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param string $pet_id ID of pet that needs to be updated (required)
|
||||
* @param string $name Updated name of the pet (optional)
|
||||
* @param string $status Updated status of the pet (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/x-www-form-urlencoded'));
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
// form params
|
||||
if ($name !== null) {
|
||||
|
||||
|
||||
$formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name);
|
||||
|
||||
}// form params
|
||||
if ($status !== null) {
|
||||
|
||||
|
||||
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* uploadFile
|
||||
*
|
||||
* uploads an image
|
||||
*
|
||||
* @param int $pet_id ID of pet to update (required)
|
||||
* @param string $additional_metadata Additional data to pass to server (optional)
|
||||
* @param \SplFileObject $file file to upload (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function uploadFile($pet_id, $additional_metadata = null, $file = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploadFileWithHttpInfo
|
||||
*
|
||||
* uploads an image
|
||||
*
|
||||
* @param int $pet_id ID of pet to update (required)
|
||||
* @param string $additional_metadata Additional data to pass to server (optional)
|
||||
* @param \SplFileObject $file file to upload (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}/uploadImage";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('multipart/form-data'));
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
// form params
|
||||
if ($additional_metadata !== null) {
|
||||
|
||||
|
||||
$formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata);
|
||||
|
||||
}// form params
|
||||
if ($file !== null) {
|
||||
|
||||
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
|
||||
// See: https://wiki.php.net/rfc/curl-file-upload
|
||||
if (function_exists('curl_file_create')) {
|
||||
$formParams['file'] = curl_file_create($this->apiClient->getSerializer()->toFormValue($file));
|
||||
} else {
|
||||
$formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
|
||||
@@ -91,6 +91,93 @@ class StoreApi
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteOrder
|
||||
*
|
||||
* Delete purchase order by ID
|
||||
*
|
||||
* @param string $order_id ID of the order that needs to be deleted (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteOrder($order_id)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->deleteOrderWithHttpInfo ($order_id);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteOrderWithHttpInfo
|
||||
*
|
||||
* Delete purchase order by ID
|
||||
*
|
||||
* @param string $order_id ID of the order that needs to be deleted (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteOrderWithHttpInfo($order_id)
|
||||
{
|
||||
|
||||
// verify the required parameter 'order_id' is set
|
||||
if ($order_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/order/{orderId}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($order_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "orderId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($order_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* findOrdersByStatus
|
||||
*
|
||||
@@ -368,107 +455,6 @@ class StoreApi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* placeOrder
|
||||
*
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (optional)
|
||||
* @return \Swagger\Client\Model\Order
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function placeOrder($body = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->placeOrderWithHttpInfo ($body);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* placeOrderWithHttpInfo
|
||||
*
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (optional)
|
||||
* @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function placeOrderWithHttpInfo($body = null)
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/order";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($body)) {
|
||||
$_tempBody = $body;
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_id');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_id'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Order'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getOrderById
|
||||
*
|
||||
@@ -579,40 +565,36 @@ class StoreApi
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteOrder
|
||||
* placeOrder
|
||||
*
|
||||
* Delete purchase order by ID
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param string $order_id ID of the order that needs to be deleted (required)
|
||||
* @return void
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (optional)
|
||||
* @return \Swagger\Client\Model\Order
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteOrder($order_id)
|
||||
public function placeOrder($body = null)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->deleteOrderWithHttpInfo ($order_id);
|
||||
list($response, $statusCode, $httpHeader) = $this->placeOrderWithHttpInfo ($body);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteOrderWithHttpInfo
|
||||
* placeOrderWithHttpInfo
|
||||
*
|
||||
* Delete purchase order by ID
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param string $order_id ID of the order that needs to be deleted (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (optional)
|
||||
* @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteOrderWithHttpInfo($order_id)
|
||||
public function placeOrderWithHttpInfo($body = null)
|
||||
{
|
||||
|
||||
// verify the required parameter 'order_id' is set
|
||||
if ($order_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/order/{orderId}";
|
||||
$resourcePath = "/store/order";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
@@ -625,20 +607,16 @@ class StoreApi
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($order_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "orderId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($order_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($body)) {
|
||||
$_tempBody = $body;
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
@@ -647,18 +625,40 @@ class StoreApi
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_id');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_id'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
$headerParams, '\Swagger\Client\Model\Order'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
|
||||
@@ -328,6 +328,188 @@ class UserApi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteUser
|
||||
*
|
||||
* Delete user
|
||||
*
|
||||
* @param string $username The name that needs to be deleted (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteUser($username)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->deleteUserWithHttpInfo ($username);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteUserWithHttpInfo
|
||||
*
|
||||
* Delete user
|
||||
*
|
||||
* @param string $username The name that needs to be deleted (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteUserWithHttpInfo($username)
|
||||
{
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/{username}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($username),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getUserByName
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return \Swagger\Client\Model\User
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getUserByName($username)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->getUserByNameWithHttpInfo ($username);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getUserByNameWithHttpInfo
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getUserByNameWithHttpInfo($username)
|
||||
{
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/{username}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($username),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\User'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* loginUser
|
||||
*
|
||||
@@ -494,101 +676,6 @@ class UserApi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getUserByName
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return \Swagger\Client\Model\User
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getUserByName($username)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->getUserByNameWithHttpInfo ($username);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getUserByNameWithHttpInfo
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getUserByNameWithHttpInfo($username)
|
||||
{
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/{username}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($username),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\User'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* updateUser
|
||||
*
|
||||
@@ -682,91 +769,4 @@ class UserApi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteUser
|
||||
*
|
||||
* Delete user
|
||||
*
|
||||
* @param string $username The name that needs to be deleted (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteUser($username)
|
||||
{
|
||||
list($response, $statusCode, $httpHeader) = $this->deleteUserWithHttpInfo ($username);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteUserWithHttpInfo
|
||||
*
|
||||
* Delete user
|
||||
*
|
||||
* @param string $username The name that needs to be deleted (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function deleteUserWithHttpInfo($username)
|
||||
{
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/{username}";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($username),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,16 +65,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test case for updatePet
|
||||
*
|
||||
* Update an existing pet
|
||||
*
|
||||
*/
|
||||
public function test_updatePet() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for addPet
|
||||
*
|
||||
@@ -85,6 +75,26 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for addPetUsingByteArray
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
*/
|
||||
public function test_addPetUsingByteArray() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for deletePet
|
||||
*
|
||||
* Deletes a pet
|
||||
*
|
||||
*/
|
||||
public function test_deletePet() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for findPetsByStatus
|
||||
*
|
||||
@@ -115,36 +125,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for updatePetWithForm
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
*/
|
||||
public function test_updatePetWithForm() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for deletePet
|
||||
*
|
||||
* Deletes a pet
|
||||
*
|
||||
*/
|
||||
public function test_deletePet() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for uploadFile
|
||||
*
|
||||
* uploads an image
|
||||
*
|
||||
*/
|
||||
public function test_uploadFile() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for getPetByIdInObject
|
||||
*
|
||||
@@ -166,12 +146,32 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for addPetUsingByteArray
|
||||
* Test case for updatePet
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
* Update an existing pet
|
||||
*
|
||||
*/
|
||||
public function test_addPetUsingByteArray() {
|
||||
public function test_updatePet() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for updatePetWithForm
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
*/
|
||||
public function test_updatePetWithForm() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for uploadFile
|
||||
*
|
||||
* uploads an image
|
||||
*
|
||||
*/
|
||||
public function test_uploadFile() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,16 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test case for deleteOrder
|
||||
*
|
||||
* Delete purchase order by ID
|
||||
*
|
||||
*/
|
||||
public function test_deleteOrder() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for findOrdersByStatus
|
||||
*
|
||||
@@ -95,16 +105,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for placeOrder
|
||||
*
|
||||
* Place an order for a pet
|
||||
*
|
||||
*/
|
||||
public function test_placeOrder() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for getOrderById
|
||||
*
|
||||
@@ -116,12 +116,12 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for deleteOrder
|
||||
* Test case for placeOrder
|
||||
*
|
||||
* Delete purchase order by ID
|
||||
* Place an order for a pet
|
||||
*
|
||||
*/
|
||||
public function test_deleteOrder() {
|
||||
public function test_placeOrder() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,26 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for deleteUser
|
||||
*
|
||||
* Delete user
|
||||
*
|
||||
*/
|
||||
public function test_deleteUser() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for getUserByName
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
*/
|
||||
public function test_getUserByName() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for loginUser
|
||||
*
|
||||
@@ -115,16 +135,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for getUserByName
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
*/
|
||||
public function test_getUserByName() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for updateUser
|
||||
*
|
||||
@@ -135,14 +145,4 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for deleteUser
|
||||
*
|
||||
* Delete user
|
||||
*
|
||||
*/
|
||||
public function test_deleteUser() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
# import models into sdk package
|
||||
from .models.user import User
|
||||
from .models.category import Category
|
||||
from .models.pet import Pet
|
||||
from .models.tag import Tag
|
||||
from .models.object_return import ObjectReturn
|
||||
from .models.order import Order
|
||||
from .models.special_model_name import SpecialModelName
|
||||
from .models.inline_response_200 import InlineResponse200
|
||||
from .models.model_return import ModelReturn
|
||||
from .models.name import Name
|
||||
from .models.order import Order
|
||||
from .models.pet import Pet
|
||||
from .models.special_model_name import SpecialModelName
|
||||
from .models.tag import Tag
|
||||
from .models.user import User
|
||||
|
||||
# import apis into sdk package
|
||||
from .apis.user_api import UserApi
|
||||
from .apis.pet_api import PetApi
|
||||
from .apis.store_api import StoreApi
|
||||
from .apis.user_api import UserApi
|
||||
|
||||
# import ApiClient
|
||||
from .api_client import ApiClient
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
# import apis into api package
|
||||
from .user_api import UserApi
|
||||
from .pet_api import PetApi
|
||||
from .store_api import StoreApi
|
||||
from .user_api import UserApi
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user