forked from loafle/openapi-generator-original
Merge remote-tracking branch 'main/master'
This commit is contained in:
commit
cbbc2cf5ae
@ -705,6 +705,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
|
|||||||
- [StyleRecipe](http://stylerecipe.co.jp)
|
- [StyleRecipe](http://stylerecipe.co.jp)
|
||||||
- [ThoughtWorks](https://www.thoughtworks.com)
|
- [ThoughtWorks](https://www.thoughtworks.com)
|
||||||
- [uShip](https://www.uship.com/)
|
- [uShip](https://www.uship.com/)
|
||||||
|
- [Zalando](https://tech.zalando.com)
|
||||||
- [ZEEF.com](https://zeef.com/)
|
- [ZEEF.com](https://zeef.com/)
|
||||||
|
|
||||||
License
|
License
|
||||||
|
@ -5,18 +5,11 @@ import io.airlift.airline.Option;
|
|||||||
import io.swagger.codegen.ClientOptInput;
|
import io.swagger.codegen.ClientOptInput;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
import io.swagger.codegen.CodegenConstants;
|
||||||
import io.swagger.codegen.DefaultGenerator;
|
import io.swagger.codegen.DefaultGenerator;
|
||||||
import io.swagger.codegen.utils.OptionUtils;
|
|
||||||
import io.swagger.codegen.config.CodegenConfigurator;
|
import io.swagger.codegen.config.CodegenConfigurator;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import static io.swagger.codegen.config.CodegenConfiguratorUtils.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -190,74 +183,15 @@ public class Generate implements Runnable {
|
|||||||
configurator.setLibrary(library);
|
configurator.setLibrary(library);
|
||||||
}
|
}
|
||||||
|
|
||||||
setSystemProperties(configurator);
|
applySystemPropertiesKvp(systemProperties, configurator);
|
||||||
setInstantiationTypes(configurator);
|
applyInstantiationTypesKvp(instantiationTypes, configurator);
|
||||||
setImportMappings(configurator);
|
applyImportMappingsKvp(importMappings, configurator);
|
||||||
setTypeMappings(configurator);
|
applyTypeMappingsKvp(typeMappings, configurator);
|
||||||
setAdditionalProperties(configurator);
|
applyAdditionalPropertiesKvp(additionalProperties, configurator);
|
||||||
setLanguageSpecificPrimitives(configurator);
|
applyLanguageSpecificPrimitivesCsv(languageSpecificPrimitives, configurator);
|
||||||
|
|
||||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||||
|
|
||||||
new DefaultGenerator().opts(clientOptInput).generate();
|
new DefaultGenerator().opts(clientOptInput).generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSystemProperties(CodegenConfigurator configurator) {
|
|
||||||
final Map<String, String> map = createMapFromKeyValuePairs(systemProperties);
|
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
||||||
configurator.addSystemProperty(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setInstantiationTypes(CodegenConfigurator configurator) {
|
|
||||||
final Map<String, String> map = createMapFromKeyValuePairs(instantiationTypes);
|
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
||||||
configurator.addInstantiationType(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setImportMappings(CodegenConfigurator configurator) {
|
|
||||||
final Map<String, String> map = createMapFromKeyValuePairs(importMappings);
|
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
||||||
configurator.addImportMapping(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setTypeMappings(CodegenConfigurator configurator) {
|
|
||||||
final Map<String, String> map = createMapFromKeyValuePairs(typeMappings);
|
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
||||||
configurator.addTypeMapping(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAdditionalProperties(CodegenConfigurator configurator) {
|
|
||||||
final Map<String, String> map = createMapFromKeyValuePairs(additionalProperties);
|
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
||||||
configurator.addAdditionalProperty(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setLanguageSpecificPrimitives(CodegenConfigurator configurator) {
|
|
||||||
final Set<String> set = createSetFromCsvList(languageSpecificPrimitives);
|
|
||||||
for (String item : set) {
|
|
||||||
configurator.addLanguageSpecificPrimitive(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Set<String> createSetFromCsvList(String csvProperty) {
|
|
||||||
final List<String> values = OptionUtils.splitCommaSeparatedList(csvProperty);
|
|
||||||
return new HashSet<String>(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Map<String, String> createMapFromKeyValuePairs(String commaSeparatedKVPairs) {
|
|
||||||
final List<Pair<String, String>> pairs = OptionUtils.parseCommaSeparatedTuples(commaSeparatedKVPairs);
|
|
||||||
|
|
||||||
Map<String, String> result = new HashMap<String, String>();
|
|
||||||
|
|
||||||
for (Pair<String, String> pair : pairs) {
|
|
||||||
result.put(pair.getLeft(), pair.getRight());
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
package io.swagger.codegen.plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User: lanwen
|
|
||||||
* Date: 24.03.15
|
|
||||||
* Time: 14:47
|
|
||||||
*/
|
|
||||||
public final class AdditionalParams {
|
|
||||||
public static final String TEMPLATE_DIR_PARAM = "templateDir";
|
|
||||||
public static final String MODEL_PACKAGE_PARAM = "modelPackage";
|
|
||||||
public static final String API_PACKAGE_PARAM = "apiPackage";
|
|
||||||
public static final String INVOKER_PACKAGE_PARAM = "invokerPackage";
|
|
||||||
public static final String LIBRARY_PARAM = "library";
|
|
||||||
|
|
||||||
private AdditionalParams() {}
|
|
||||||
}
|
|
@ -16,13 +16,13 @@ package io.swagger.codegen.plugin;
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import config.Config;
|
import io.swagger.codegen.CliOption;
|
||||||
import config.ConfigParser;
|
import io.swagger.codegen.ClientOptInput;
|
||||||
import io.swagger.codegen.*;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.utils.OptionUtils;
|
import io.swagger.codegen.DefaultGenerator;
|
||||||
|
import io.swagger.codegen.config.CodegenConfigurator;
|
||||||
import io.swagger.models.Swagger;
|
import io.swagger.models.Swagger;
|
||||||
import io.swagger.parser.SwaggerParser;
|
import io.swagger.parser.SwaggerParser;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
|
||||||
import org.apache.maven.plugin.AbstractMojo;
|
import org.apache.maven.plugin.AbstractMojo;
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||||
@ -33,17 +33,27 @@ import org.apache.maven.project.MavenProject;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static io.swagger.codegen.plugin.AdditionalParams.*;
|
import static io.swagger.codegen.config.CodegenConfiguratorUtils.*;
|
||||||
|
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Goal which generates client/server code from a swagger json/yaml definition.
|
* Goal which generates client/server code from a swagger json/yaml definition.
|
||||||
*/
|
*/
|
||||||
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
||||||
public class CodeGenMojo extends AbstractMojo {
|
public class CodeGenMojo extends AbstractMojo {
|
||||||
|
|
||||||
|
@Parameter(name="verbose", required = false, defaultValue = "false")
|
||||||
|
private boolean verbose;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client language to generate.
|
||||||
|
*/
|
||||||
|
@Parameter(name = "language", required = true)
|
||||||
|
private String language;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location of the output directory.
|
* Location of the output directory.
|
||||||
*/
|
*/
|
||||||
@ -65,10 +75,23 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
private File templateDirectory;
|
private File templateDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The package to use for generated model objects/classes
|
* Adds authorization headers when fetching the swagger definitions remotely.
|
||||||
|
" Pass in a URL-encoded string of name:header with a comma separating multiple values
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "modelPackage")
|
@Parameter(name="auth")
|
||||||
private String modelPackage;
|
private String auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to separate json configuration file.
|
||||||
|
*/
|
||||||
|
@Parameter(name = "configurationFile", required = false)
|
||||||
|
private String configurationFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies if the existing files should be overwritten during the generation.
|
||||||
|
*/
|
||||||
|
@Parameter(name="skipOverwrite", required=false)
|
||||||
|
private Boolean skipOverwrite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The package to use for generated api objects/classes
|
* The package to use for generated api objects/classes
|
||||||
@ -76,6 +99,12 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
@Parameter(name = "apiPackage")
|
@Parameter(name = "apiPackage")
|
||||||
private String apiPackage;
|
private String apiPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package to use for generated model objects/classes
|
||||||
|
*/
|
||||||
|
@Parameter(name = "modelPackage")
|
||||||
|
private String modelPackage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The package to use for the generated invoker objects
|
* The package to use for the generated invoker objects
|
||||||
*/
|
*/
|
||||||
@ -83,16 +112,22 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
private String invokerPackage;
|
private String invokerPackage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client language to generate.
|
* groupId in generated pom.xml
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "language", required = true)
|
@Parameter(name = "groupId")
|
||||||
private String language;
|
private String groupId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to separate json configuration file.
|
* artifactId in generated pom.xml
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "configurationFile", required = false)
|
@Parameter(name = "artifactId")
|
||||||
private String configurationFile;
|
private String artifactId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* artifact version in generated pom.xml
|
||||||
|
*/
|
||||||
|
@Parameter(name = "artifactVersion")
|
||||||
|
private String artifactVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the library
|
* Sets the library
|
||||||
@ -127,12 +162,92 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws MojoExecutionException {
|
public void execute() throws MojoExecutionException {
|
||||||
|
|
||||||
Swagger swagger = new SwaggerParser().read(inputSpec);
|
Swagger swagger = new SwaggerParser().read(inputSpec);
|
||||||
|
|
||||||
CodegenConfig config = CodegenConfigLoader.forName(language);
|
//attempt to read from config file
|
||||||
config.setOutputDir(output.getAbsolutePath());
|
CodegenConfigurator configurator = CodegenConfigurator.fromFile(configurationFile);
|
||||||
|
|
||||||
|
//if a config file wasn't specified or we were unable to read it
|
||||||
|
if(configurator == null) {
|
||||||
|
configurator = new CodegenConfigurator();
|
||||||
|
}
|
||||||
|
|
||||||
|
configurator.setVerbose(verbose);
|
||||||
|
|
||||||
|
if(skipOverwrite != null) {
|
||||||
|
configurator.setSkipOverwrite(skipOverwrite);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(inputSpec)) {
|
||||||
|
configurator.setInputSpec(inputSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
configurator.setLang(language);
|
||||||
|
|
||||||
|
configurator.setOutputDir(output.getAbsolutePath());
|
||||||
|
|
||||||
|
if(isNotEmpty(auth)) {
|
||||||
|
configurator.setAuth(auth);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(apiPackage)) {
|
||||||
|
configurator.setApiPackage(apiPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(modelPackage)) {
|
||||||
|
configurator.setModelPackage(modelPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(invokerPackage)) {
|
||||||
|
configurator.setInvokerPackage(invokerPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(groupId)) {
|
||||||
|
configurator.setGroupId(groupId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(artifactId)) {
|
||||||
|
configurator.setArtifactId(artifactId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(artifactVersion)) {
|
||||||
|
configurator.setArtifactVersion(artifactVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isNotEmpty(library)) {
|
||||||
|
configurator.setLibrary(library);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null != templateDirectory) {
|
||||||
|
configurator.setTemplateDir(templateDirectory.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configOptions != null) {
|
||||||
|
|
||||||
|
if(configOptions.containsKey("instantiation-types")) {
|
||||||
|
applyInstantiationTypesKvp(configOptions.get("instantiation-types").toString(), configurator);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(configOptions.containsKey("import-mappings")) {
|
||||||
|
applyImportMappingsKvp(configOptions.get("import-mappings").toString(), configurator);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(configOptions.containsKey("type-mappings")) {
|
||||||
|
applyTypeMappingsKvp(configOptions.get("type-mappings").toString(), configurator);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(configOptions.containsKey("language-specific-primitives")) {
|
||||||
|
applyLanguageSpecificPrimitivesCsv(configOptions.get("language-specific-primitives").toString(), configurator);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(configOptions.containsKey("additional-properties")) {
|
||||||
|
applyAdditionalPropertiesKvp(configOptions.get("additional-properties").toString(), configurator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (environmentVariables != null) {
|
if (environmentVariables != null) {
|
||||||
|
|
||||||
for(String key : environmentVariables.keySet()) {
|
for(String key : environmentVariables.keySet()) {
|
||||||
String value = environmentVariables.get(key);
|
String value = environmentVariables.get(key);
|
||||||
if(value == null) {
|
if(value == null) {
|
||||||
@ -140,58 +255,21 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
value = "";
|
value = "";
|
||||||
}
|
}
|
||||||
System.setProperty(key, value);
|
System.setProperty(key, value);
|
||||||
|
configurator.addSystemProperty(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (null != library) {
|
|
||||||
config.setLibrary(library);
|
|
||||||
}
|
|
||||||
if (null != templateDirectory) {
|
|
||||||
config.additionalProperties().put(TEMPLATE_DIR_PARAM, templateDirectory.getAbsolutePath());
|
|
||||||
}
|
|
||||||
if (null != modelPackage) {
|
|
||||||
config.additionalProperties().put(MODEL_PACKAGE_PARAM, modelPackage);
|
|
||||||
}
|
|
||||||
if (null != apiPackage) {
|
|
||||||
config.additionalProperties().put(API_PACKAGE_PARAM, apiPackage);
|
|
||||||
}
|
|
||||||
if (null != invokerPackage) {
|
|
||||||
config.additionalProperties().put(INVOKER_PACKAGE_PARAM, invokerPackage);
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<String> definedOptions = new HashSet<String>();
|
final ClientOptInput input = configurator.toClientOptInput();
|
||||||
for (CliOption langCliOption : config.cliOptions()) {
|
final CodegenConfig config = input.getConfig();
|
||||||
definedOptions.add(langCliOption.getOpt());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(configOptions != null) {
|
if(configOptions != null) {
|
||||||
if(configOptions.containsKey("import-mappings")) {
|
for (CliOption langCliOption : config.cliOptions()) {
|
||||||
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("import-mappings").toString());
|
if (configOptions.containsKey(langCliOption.getOpt())) {
|
||||||
config.importMapping().putAll(mappings);
|
input.getConfig().additionalProperties().put(langCliOption.getOpt(),
|
||||||
}
|
configOptions.get(langCliOption.getOpt()));
|
||||||
|
}
|
||||||
if(configOptions.containsKey("type-mappings")) {
|
|
||||||
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("type-mappings").toString());
|
|
||||||
config.typeMapping().putAll(mappings);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(configOptions.containsKey("instantiation-types")) {
|
|
||||||
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("instantiation-types").toString());
|
|
||||||
config.instantiationTypes().putAll(mappings);
|
|
||||||
}
|
|
||||||
addAdditionalProperties(config, definedOptions, configOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null != configurationFile) {
|
|
||||||
Config genConfig = ConfigParser.read(configurationFile);
|
|
||||||
if (null != genConfig) {
|
|
||||||
addAdditionalProperties(config, definedOptions, genConfig.getOptions());
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException("Unable to read configuration file");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientOptInput input = new ClientOptInput().opts(new ClientOpts()).swagger(swagger);
|
|
||||||
input.setConfig(config);
|
|
||||||
|
|
||||||
if(configHelp) {
|
if(configHelp) {
|
||||||
for (CliOption langCliOption : config.cliOptions()) {
|
for (CliOption langCliOption : config.cliOptions()) {
|
||||||
@ -215,25 +293,4 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
project.addCompileSourceRoot(output.toString());
|
project.addCompileSourceRoot(output.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAdditionalProperties(CodegenConfig config, Set<String> definedOptions, Map<?,?> configOptions) {
|
|
||||||
for(Map.Entry<?, ?> configEntry : configOptions.entrySet()) {
|
|
||||||
config.additionalProperties().put(configEntry.getKey().toString(), configEntry.getValue());
|
|
||||||
if(!definedOptions.contains(configEntry.getKey())) {
|
|
||||||
getLog().warn("Additional property: " + configEntry.getKey() + " is not defined for this language.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Map<String, String> createMapFromKeyValuePairs(String commaSeparatedKVPairs) {
|
|
||||||
final List<Pair<String, String>> pairs = OptionUtils.parseCommaSeparatedTuples(commaSeparatedKVPairs);
|
|
||||||
|
|
||||||
Map<String, String> result = new HashMap<String, String>();
|
|
||||||
|
|
||||||
for (Pair<String, String> pair : pairs) {
|
|
||||||
result.put(pair.getLeft(), pair.getRight());
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,77 @@
|
|||||||
|
package io.swagger.codegen.config;
|
||||||
|
|
||||||
|
import io.swagger.codegen.utils.OptionUtils;
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains shared logic for applying key-value pairs and CSV strings
|
||||||
|
* to specific settings in CodegenConfigurator.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This class exists to facilitate testing. These methods could be applied
|
||||||
|
* to CodegenConfigurator, but this complicates things when mocking CodegenConfigurator.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public final class CodegenConfiguratorUtils {
|
||||||
|
|
||||||
|
public static void applySystemPropertiesKvp(String systemProperties, CodegenConfigurator configurator) {
|
||||||
|
final Map<String, String> map = createMapFromKeyValuePairs(systemProperties);
|
||||||
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
|
configurator.addSystemProperty(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void applyInstantiationTypesKvp(String instantiationTypes, CodegenConfigurator configurator) {
|
||||||
|
final Map<String, String> map = createMapFromKeyValuePairs(instantiationTypes);
|
||||||
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
|
configurator.addInstantiationType(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void applyImportMappingsKvp(String importMappings, CodegenConfigurator configurator) {
|
||||||
|
final Map<String, String> map = createMapFromKeyValuePairs(importMappings);
|
||||||
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
|
configurator.addImportMapping(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void applyTypeMappingsKvp(String typeMappings, CodegenConfigurator configurator) {
|
||||||
|
final Map<String, String> map = createMapFromKeyValuePairs(typeMappings);
|
||||||
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
|
configurator.addTypeMapping(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void applyAdditionalPropertiesKvp(String additionalProperties, CodegenConfigurator configurator) {
|
||||||
|
final Map<String, String> map = createMapFromKeyValuePairs(additionalProperties);
|
||||||
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
|
configurator.addAdditionalProperty(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void applyLanguageSpecificPrimitivesCsv(String languageSpecificPrimitives, CodegenConfigurator configurator) {
|
||||||
|
final Set<String> set = createSetFromCsvList(languageSpecificPrimitives);
|
||||||
|
for (String item : set) {
|
||||||
|
configurator.addLanguageSpecificPrimitive(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Set<String> createSetFromCsvList(String csvProperty) {
|
||||||
|
final List<String> values = OptionUtils.splitCommaSeparatedList(csvProperty);
|
||||||
|
return new HashSet<String>(values);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, String> createMapFromKeyValuePairs(String commaSeparatedKVPairs) {
|
||||||
|
final List<Pair<String, String>> pairs = OptionUtils.parseCommaSeparatedTuples(commaSeparatedKVPairs);
|
||||||
|
|
||||||
|
Map<String, String> result = new HashMap<String, String>();
|
||||||
|
|
||||||
|
for (Pair<String, String> pair : pairs) {
|
||||||
|
result.put(pair.getLeft(), pair.getRight());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@ -45,9 +45,9 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
setReservedWordsLowerCase(
|
setReservedWordsLowerCase(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
// local variable names used in API methods (endpoints)
|
// local variable names used in API methods (endpoints)
|
||||||
"postBody", "path", "queryParams", "headerParams", "formParams",
|
"localVarPostBody", "localVarPath", "localVarQueryParams", "localVarHeaderParams",
|
||||||
"contentTypes", "contentType", "response", "builder", "httpEntity",
|
"localVarFormParams", "localVarContentTypes", "localVarContentType",
|
||||||
"authNames", "basePath", "apiInvoker",
|
"localVarResponse", "localVarBuilder", "authNames", "basePath", "apiInvoker",
|
||||||
|
|
||||||
// android reserved words
|
// android reserved words
|
||||||
"abstract", "continue", "for", "new", "switch", "assert",
|
"abstract", "continue", "for", "new", "switch", "assert",
|
||||||
@ -68,10 +68,13 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
"Integer",
|
"Integer",
|
||||||
"Long",
|
"Long",
|
||||||
"Float",
|
"Float",
|
||||||
|
"byte[]",
|
||||||
"Object")
|
"Object")
|
||||||
);
|
);
|
||||||
instantiationTypes.put("array", "ArrayList");
|
instantiationTypes.put("array", "ArrayList");
|
||||||
instantiationTypes.put("map", "HashMap");
|
instantiationTypes.put("map", "HashMap");
|
||||||
|
typeMapping.put("date", "Date");
|
||||||
|
typeMapping.put("file", "File");
|
||||||
|
|
||||||
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||||
@ -141,8 +144,10 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
String type = null;
|
String type = null;
|
||||||
if (typeMapping.containsKey(swaggerType)) {
|
if (typeMapping.containsKey(swaggerType)) {
|
||||||
type = typeMapping.get(swaggerType);
|
type = typeMapping.get(swaggerType);
|
||||||
if (languageSpecificPrimitives.contains(type)) {
|
if (languageSpecificPrimitives.contains(type) || type.indexOf(".") >= 0 ||
|
||||||
return toModelName(type);
|
type.equals("Map") || type.equals("List") ||
|
||||||
|
type.equals("File") || type.equals("Date")) {
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
type = swaggerType;
|
type = swaggerType;
|
||||||
@ -182,7 +187,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
public String toModelName(String name) {
|
public String toModelName(String name) {
|
||||||
// camelize the model name
|
// camelize the model name
|
||||||
// phone_number => PhoneNumber
|
// phone_number => PhoneNumber
|
||||||
name = camelize(sanitizeName(name));
|
name = camelize(sanitizeName(modelNamePrefix + name + modelNameSuffix));
|
||||||
|
|
||||||
// model name cannot use reserved keyword, e.g. return
|
// model name cannot use reserved keyword, e.g. return
|
||||||
if (isReservedWord(name)) {
|
if (isReservedWord(name)) {
|
||||||
|
@ -55,8 +55,9 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
setReservedWordsLowerCase(
|
setReservedWordsLowerCase(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
// used as internal variables, can collide with parameter names
|
// used as internal variables, can collide with parameter names
|
||||||
"path", "queryParams", "headerParams", "formParams", "postBody", "accepts", "accept", "contentTypes",
|
"localVarPath", "localVarQueryParams", "localVarHeaderParams", "localVarFormParams",
|
||||||
"contentType", "authNames",
|
"localVarPostBody", "localVarAccepts", "localVarAccept", "localVarContentTypes",
|
||||||
|
"localVarContentType", "localVarAuthNames", "localReturnType",
|
||||||
|
|
||||||
// language reserved words
|
// language reserved words
|
||||||
"abstract", "continue", "for", "new", "switch", "assert",
|
"abstract", "continue", "for", "new", "switch", "assert",
|
||||||
@ -102,7 +103,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.6");
|
supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.6");
|
||||||
supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1");
|
supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1");
|
||||||
supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)");
|
supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)");
|
||||||
supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2). Enable the RxJava adapter using '-DuseRxJava=true'.");
|
supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta4). Enable the RxJava adapter using '-DuseRxJava=true'.");
|
||||||
|
|
||||||
CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
|
CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
|
||||||
library.setDefault(DEFAULT_LIBRARY);
|
library.setDefault(DEFAULT_LIBRARY);
|
||||||
|
@ -55,9 +55,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
modelTestTemplateFiles.put("model_test.mustache", ".rb");
|
modelTestTemplateFiles.put("model_test.mustache", ".rb");
|
||||||
apiTestTemplateFiles.put("api_test.mustache", ".rb");
|
apiTestTemplateFiles.put("api_test.mustache", ".rb");
|
||||||
|
|
||||||
typeMapping.clear();
|
|
||||||
languageSpecificPrimitives.clear();
|
|
||||||
|
|
||||||
setReservedWordsLowerCase(
|
setReservedWordsLowerCase(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
// local variable names used in API methods (endpoints)
|
// local variable names used in API methods (endpoints)
|
||||||
@ -71,11 +68,24 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
"if", "not", "return", "undef", "yield")
|
"if", "not", "return", "undef", "yield")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typeMapping.clear();
|
||||||
|
languageSpecificPrimitives.clear();
|
||||||
|
|
||||||
|
// primitives in ruby lang
|
||||||
languageSpecificPrimitives.add("int");
|
languageSpecificPrimitives.add("int");
|
||||||
languageSpecificPrimitives.add("array");
|
languageSpecificPrimitives.add("array");
|
||||||
languageSpecificPrimitives.add("map");
|
languageSpecificPrimitives.add("map");
|
||||||
languageSpecificPrimitives.add("string");
|
languageSpecificPrimitives.add("string");
|
||||||
|
// primitives in the typeMapping
|
||||||
|
languageSpecificPrimitives.add("String");
|
||||||
|
languageSpecificPrimitives.add("Integer");
|
||||||
|
languageSpecificPrimitives.add("Float");
|
||||||
|
languageSpecificPrimitives.add("Date");
|
||||||
languageSpecificPrimitives.add("DateTime");
|
languageSpecificPrimitives.add("DateTime");
|
||||||
|
languageSpecificPrimitives.add("BOOLEAN");
|
||||||
|
languageSpecificPrimitives.add("Array");
|
||||||
|
languageSpecificPrimitives.add("Hash");
|
||||||
|
languageSpecificPrimitives.add("File");
|
||||||
|
|
||||||
typeMapping.put("string", "String");
|
typeMapping.put("string", "String");
|
||||||
typeMapping.put("char", "String");
|
typeMapping.put("char", "String");
|
||||||
@ -333,7 +343,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
public String toVarName(String name) {
|
public String toVarName(String name) {
|
||||||
// sanitize name
|
// sanitize name
|
||||||
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
// if it's all uppper case, convert to lower case
|
// if it's all uppper case, convert to lower case
|
||||||
if (name.matches("^[A-Z_]*$")) {
|
if (name.matches("^[A-Z_]*$")) {
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
@ -361,6 +370,14 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
public String toModelName(String name) {
|
public String toModelName(String name) {
|
||||||
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||||
|
name = modelNamePrefix + "_" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
||||||
|
name = name + "_" + modelNameSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
// model name cannot use reserved keyword, e.g. return
|
// model name cannot use reserved keyword, e.g. return
|
||||||
if (isReservedWord(name)) {
|
if (isReservedWord(name)) {
|
||||||
String modelName = camelize("object_" + name);
|
String modelName = camelize("object_" + name);
|
||||||
@ -375,6 +392,15 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toModelFilename(String name) {
|
public String toModelFilename(String name) {
|
||||||
|
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||||
|
name = modelNamePrefix + "_" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
||||||
|
name = name + "_" + modelNameSuffix;
|
||||||
|
}
|
||||||
// model name cannot use reserved keyword, e.g. return
|
// model name cannot use reserved keyword, e.g. return
|
||||||
if (isReservedWord(name)) {
|
if (isReservedWord(name)) {
|
||||||
String filename = underscore("object_" + name);
|
String filename = underscore("object_" + name);
|
||||||
@ -398,12 +424,12 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toApiTestFilename(String name) {
|
public String toApiTestFilename(String name) {
|
||||||
return toApiName(name) + "_spec";
|
return toApiFilename(name) + "_spec";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toModelTestFilename(String name) {
|
public String toModelTestFilename(String name) {
|
||||||
return toModelName(name) + "_spec";
|
return toModelFilename(name) + "_spec";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,7 +47,7 @@ public class {{classname}} {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||||
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}{{#required}}
|
||||||
// verify the required parameter '{{paramName}}' is set
|
// verify the required parameter '{{paramName}}' is set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
@ -55,43 +55,43 @@ public class {{classname}} {
|
|||||||
}
|
}
|
||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String {{localVariablePrefix}}path = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}
|
String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}
|
||||||
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}queryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}headerParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}formParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
||||||
|
|
||||||
{{#queryParams}}
|
{{#queryParams}}
|
||||||
{{localVariablePrefix}}queryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
{{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||||
{{/queryParams}}
|
{{/queryParams}}
|
||||||
|
|
||||||
{{#headerParams}}if ({{paramName}} != null)
|
{{#headerParams}}if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}headerParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
{{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
|
|
||||||
{{#formParams}}if ({{paramName}} != null)
|
{{#formParams}}if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}formParams.put("{{baseName}}", {{paramName}});
|
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});
|
||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
|
|
||||||
final String[] {{localVariablePrefix}}accepts = {
|
final String[] {{localVariablePrefix}}localVarAccepts = {
|
||||||
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||||
};
|
};
|
||||||
final String {{localVariablePrefix}}accept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}accepts);
|
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
|
||||||
|
|
||||||
final String[] {{localVariablePrefix}}contentTypes = {
|
final String[] {{localVariablePrefix}}localVarContentTypes = {
|
||||||
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||||
};
|
};
|
||||||
final String {{localVariablePrefix}}contentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}contentTypes);
|
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
|
||||||
|
|
||||||
String[] {{localVariablePrefix}}authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||||
|
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
GenericType<{{{returnType}}}> {{localVariablePrefix}}returnType = new GenericType<{{{returnType}}}>() {};
|
GenericType<{{{returnType}}}> {{localVariablePrefix}}localVarReturnType = new GenericType<{{{returnType}}}>() {};
|
||||||
return {{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}path, "{{httpMethod}}", {{localVariablePrefix}}queryParams, {{localVariablePrefix}}postBody, {{localVariablePrefix}}headerParams, {{localVariablePrefix}}formParams, {{localVariablePrefix}}accept, {{localVariablePrefix}}contentType, {{localVariablePrefix}}authNames, {{localVariablePrefix}}returnType);
|
return {{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAccept, {{localVariablePrefix}}localVarContentType, {{localVariablePrefix}}localVarAuthNames, {{localVariablePrefix}}localVarReturnType);
|
||||||
{{/returnType}}{{^returnType}}
|
{{/returnType}}{{^returnType}}
|
||||||
{{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}path, "{{httpMethod}}", {{localVariablePrefix}}queryParams, {{localVariablePrefix}}postBody, {{localVariablePrefix}}headerParams, {{localVariablePrefix}}formParams, {{localVariablePrefix}}accept, {{localVariablePrefix}}contentType, {{localVariablePrefix}}authNames, null);
|
{{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAccept, {{localVariablePrefix}}localVarContentType, {{localVariablePrefix}}localVarAuthNames, null);
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
}
|
}
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
|
@ -47,7 +47,7 @@ public class {{classname}} {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||||
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}{{#required}}
|
||||||
// verify the required parameter '{{paramName}}' is set
|
// verify the required parameter '{{paramName}}' is set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
@ -55,43 +55,43 @@ public class {{classname}} {
|
|||||||
}
|
}
|
||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String {{localVariablePrefix}}path = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}
|
String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}
|
||||||
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}queryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}headerParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}formParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
||||||
|
|
||||||
{{#queryParams}}
|
{{#queryParams}}
|
||||||
{{localVariablePrefix}}queryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
{{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||||
{{/queryParams}}
|
{{/queryParams}}
|
||||||
|
|
||||||
{{#headerParams}}if ({{paramName}} != null)
|
{{#headerParams}}if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}headerParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
{{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
|
|
||||||
{{#formParams}}if ({{paramName}} != null)
|
{{#formParams}}if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}formParams.put("{{baseName}}", {{paramName}});
|
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});
|
||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
|
|
||||||
final String[] {{localVariablePrefix}}accepts = {
|
final String[] {{localVariablePrefix}}localVarAccepts = {
|
||||||
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||||
};
|
};
|
||||||
final String {{localVariablePrefix}}accept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}accepts);
|
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
|
||||||
|
|
||||||
final String[] {{localVariablePrefix}}contentTypes = {
|
final String[] {{localVariablePrefix}}localVarContentTypes = {
|
||||||
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||||
};
|
};
|
||||||
final String {{localVariablePrefix}}contentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}contentTypes);
|
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
|
||||||
|
|
||||||
String[] {{localVariablePrefix}}authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||||
|
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
GenericType<{{{returnType}}}> {{localVariablePrefix}}returnType = new GenericType<{{{returnType}}}>() {};
|
GenericType<{{{returnType}}}> {{localVariablePrefix}}localVarReturnType = new GenericType<{{{returnType}}}>() {};
|
||||||
return {{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}path, "{{httpMethod}}", {{localVariablePrefix}}queryParams, {{localVariablePrefix}}postBody, {{localVariablePrefix}}headerParams, {{localVariablePrefix}}formParams, {{localVariablePrefix}}accept, {{localVariablePrefix}}contentType, {{localVariablePrefix}}authNames, {{localVariablePrefix}}returnType);
|
return {{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAccept, {{localVariablePrefix}}localVarContentType, {{localVariablePrefix}}localVarAuthNames, {{localVariablePrefix}}localVarReturnType);
|
||||||
{{/returnType}}{{^returnType}}
|
{{/returnType}}{{^returnType}}
|
||||||
{{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}path, "{{httpMethod}}", {{localVariablePrefix}}queryParams, {{localVariablePrefix}}postBody, {{localVariablePrefix}}headerParams, {{localVariablePrefix}}formParams, {{localVariablePrefix}}accept, {{localVariablePrefix}}contentType, {{localVariablePrefix}}authNames, null);
|
{{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAccept, {{localVariablePrefix}}localVarContentType, {{localVariablePrefix}}localVarAuthNames, null);
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
}
|
}
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
|
@ -51,7 +51,7 @@ public class {{classname}} {
|
|||||||
{{#operation}}
|
{{#operation}}
|
||||||
/* Build call for {{operationId}} */
|
/* Build call for {{operationId}} */
|
||||||
private Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}{{#required}}
|
||||||
// verify the required parameter '{{paramName}}' is set
|
// verify the required parameter '{{paramName}}' is set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
@ -60,32 +60,32 @@ public class {{classname}} {
|
|||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String {{localVariablePrefix}}path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}
|
String {{localVariablePrefix}}localVarPath = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}
|
||||||
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
||||||
|
|
||||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}queryParams = new {{javaUtilPrefix}}ArrayList<Pair>();{{#queryParams}}
|
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();{{#queryParams}}
|
||||||
if ({{paramName}} != null)
|
if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}queryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));{{/queryParams}}
|
{{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));{{/queryParams}}
|
||||||
|
|
||||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}headerParams = new {{javaUtilPrefix}}HashMap<String, String>();{{#headerParams}}
|
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();{{#headerParams}}
|
||||||
if ({{paramName}} != null)
|
if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}headerParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));{{/headerParams}}
|
{{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));{{/headerParams}}
|
||||||
|
|
||||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}formParams = new {{javaUtilPrefix}}HashMap<String, Object>();{{#formParams}}
|
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();{{#formParams}}
|
||||||
if ({{paramName}} != null)
|
if ({{paramName}} != null)
|
||||||
{{localVariablePrefix}}formParams.put("{{baseName}}", {{paramName}});{{/formParams}}
|
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});{{/formParams}}
|
||||||
|
|
||||||
final String[] {{localVariablePrefix}}accepts = {
|
final String[] {{localVariablePrefix}}localVarAccepts = {
|
||||||
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||||
};
|
};
|
||||||
final String {{localVariablePrefix}}accept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}accepts);
|
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
|
||||||
if ({{localVariablePrefix}}accept != null) {{localVariablePrefix}}headerParams.put("Accept", {{localVariablePrefix}}accept);
|
if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept);
|
||||||
|
|
||||||
final String[] {{localVariablePrefix}}contentTypes = {
|
final String[] {{localVariablePrefix}}localVarContentTypes = {
|
||||||
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||||
};
|
};
|
||||||
final String {{localVariablePrefix}}contentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}contentTypes);
|
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
|
||||||
{{localVariablePrefix}}headerParams.put("Content-Type", {{localVariablePrefix}}contentType);
|
{{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -99,8 +99,8 @@ public class {{classname}} {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] {{localVariablePrefix}}authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||||
return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}path, "{{httpMethod}}", {{localVariablePrefix}}queryParams, {{localVariablePrefix}}postBody, {{localVariablePrefix}}headerParams, {{localVariablePrefix}}formParams, {{localVariablePrefix}}authNames, progressRequestListener);
|
return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,8 +124,8 @@ public class {{classname}} {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||||
Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}null, null);
|
Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}null, null);
|
||||||
{{#returnType}}Type {{localVariablePrefix}}returnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||||
return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}returnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}}
|
return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -158,8 +158,8 @@ public class {{classname}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener);
|
Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener);
|
||||||
{{#returnType}}Type {{localVariablePrefix}}returnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||||
{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}returnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}}
|
{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}}
|
||||||
return {{localVariablePrefix}}call;
|
return {{localVariablePrefix}}call;
|
||||||
}
|
}
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
|
@ -12,8 +12,8 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil
|
|||||||
|
|
||||||
import retrofit2.Converter;
|
import retrofit2.Converter;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.GsonConverterFactory;
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
{{#useRxJava}}import retrofit2.RxJavaCallAdapterFactory;{{/useRxJava}}
|
{{#useRxJava}}import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;{{/useRxJava}}
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@ -339,8 +339,8 @@ class GsonCustomConverterFactory extends Converter.Factory
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||||
return gsonConverterFactory.requestBodyConverter(type, annotations, retrofit);
|
return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,9 +90,8 @@ if(hasProperty('target') && target == 'android') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
okhttp_version = "3.0.1"
|
|
||||||
oltu_version = "1.0.0"
|
oltu_version = "1.0.0"
|
||||||
retrofit_version = "2.0.0-beta3"
|
retrofit_version = "2.0.0-beta4"
|
||||||
gson_version = "2.4"
|
gson_version = "2.4"
|
||||||
swagger_annotations_version = "1.5.0"
|
swagger_annotations_version = "1.5.0"
|
||||||
junit_version = "4.12"
|
junit_version = "4.12"
|
||||||
@ -103,8 +102,6 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
|
|
||||||
|
|
||||||
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||||
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||||
{{#useRxJava}}
|
{{#useRxJava}}
|
||||||
@ -113,7 +110,6 @@ dependencies {
|
|||||||
{{/useRxJava}}
|
{{/useRxJava}}
|
||||||
{{^useRxJava}}{{/useRxJava}}
|
{{^useRxJava}}{{/useRxJava}}
|
||||||
|
|
||||||
compile "com.google.code.gson:gson:$gson_version"
|
|
||||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
||||||
<retrofit-version>2.0.0-beta3</retrofit-version>
|
<retrofit-version>2.0.0-beta4</retrofit-version>
|
||||||
{{#useRxJava}}<rxjava-version>1.0.16</rxjava-version>{{/useRxJava}}
|
{{#useRxJava}}<rxjava-version>1.0.16</rxjava-version>{{/useRxJava}}
|
||||||
<okhttp-version>3.0.1</okhttp-version>
|
<okhttp-version>3.0.1</okhttp-version>
|
||||||
<gson-version>2.4</gson-version>
|
<gson-version>2.4</gson-version>
|
||||||
|
@ -11,7 +11,6 @@ import java.util.*;
|
|||||||
{{#imports}}import {{import}};
|
{{#imports}}import {{import}};
|
||||||
{{/imports}}
|
{{/imports}}
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -47,7 +46,7 @@ public class {{classname}} {
|
|||||||
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
*/
|
*/
|
||||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||||
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}{{#required}}
|
||||||
// verify the required parameter '{{paramName}}' is set
|
// verify the required parameter '{{paramName}}' is set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
@ -56,53 +55,52 @@ public class {{classname}} {
|
|||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
String localVarPath = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
{{#queryParams}}
|
{{#queryParams}}
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||||
{{/queryParams}}
|
{{/queryParams}}
|
||||||
|
|
||||||
{{#headerParams}}
|
{{#headerParams}}
|
||||||
headerParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));
|
localVarHeaderParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
|
{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
{{#formParams}}{{#notFile}}
|
{{#formParams}}{{#notFile}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
builder.addTextBody("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), ApiInvoker.TEXT_PLAIN_UTF8);
|
localVarBuilder.addTextBody("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||||
}
|
}
|
||||||
{{/notFile}}{{#isFile}}
|
{{/notFile}}{{#isFile}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
builder.addBinaryBody("{{baseName}}", {{paramName}});
|
localVarBuilder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||||
}
|
}
|
||||||
{{/isFile}}{{/formParams}}
|
{{/isFile}}{{/formParams}}
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
{{#formParams}}{{#notFile}}formParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));{{/notFile}}
|
{{#formParams}}{{#notFile}}localVarFormParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));{{/notFile}}
|
||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(response, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(localVarResponse, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return {{#returnType}}null{{/returnType}};
|
return {{#returnType}}null{{/returnType}};
|
||||||
|
@ -87,18 +87,18 @@ public class {{classname}} {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
{{#formParams}}{{#notFile}}
|
{{#formParams}}{{#notFile}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
builder.addTextBody("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), ApiInvoker.TEXT_PLAIN_UTF8);
|
localVarBuilder.addTextBody("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||||
}
|
}
|
||||||
{{/notFile}}{{#isFile}}
|
{{/notFile}}{{#isFile}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
builder.addBinaryBody("{{baseName}}", {{paramName}});
|
localVarBuilder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||||
}
|
}
|
||||||
{{/isFile}}{{/formParams}}
|
{{/isFile}}{{/formParams}}
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -109,9 +109,9 @@ public class {{classname}} {
|
|||||||
String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI (basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(response, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(localVarResponse, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
||||||
} else {
|
} else {
|
||||||
return {{#returnType}}null{{/returnType}};
|
return {{#returnType}}null{{/returnType}};
|
||||||
}
|
}
|
||||||
@ -170,18 +170,18 @@ public class {{classname}} {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
{{#formParams}}{{#notFile}}
|
{{#formParams}}{{#notFile}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
builder.addTextBody("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), ApiInvoker.TEXT_PLAIN_UTF8);
|
localVarBuilder.addTextBody("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||||
}
|
}
|
||||||
{{/notFile}}{{#isFile}}
|
{{/notFile}}{{#isFile}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
builder.addBinaryBody("{{baseName}}", {{paramName}});
|
localVarBuilder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||||
}
|
}
|
||||||
{{/isFile}}{{/formParams}}
|
{{/isFile}}{{/formParams}}
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -195,13 +195,13 @@ public class {{classname}} {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
try {
|
try {
|
||||||
responseListener.onResponse(({{{returnType}}}) ApiInvoker.deserialize(response, "{{returnContainer}}", {{returnBaseType}}.class));
|
responseListener.onResponse(({{{returnType}}}) ApiInvoker.deserialize(localVarResponse, "{{returnContainer}}", {{returnBaseType}}.class));
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
{{^returnType}}
|
{{^returnType}}
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
} catch (ApiException exception) {
|
} catch (ApiException exception) {
|
||||||
|
@ -74,7 +74,7 @@ dependencies {
|
|||||||
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
||||||
testCompile "junit:junit:$junit_version"
|
testCompile "junit:junit:$junit_version"
|
||||||
testCompile "org.robolectric:robolectric:${robolectric_version}"
|
testCompile "org.robolectric:robolectric:${robolectric_version}"
|
||||||
testCompile "net.jodah:concurrentunit:${concurrentunitVersion}"
|
testCompile "net.jodah:concurrentunit:${concurrent_unit_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
@ -35,6 +35,10 @@ public class JsonUtil {
|
|||||||
public static Type getListTypeForDeserialization(Class cls) {
|
public static Type getListTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<List<Order>>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
if ("User".equalsIgnoreCase(className)) {
|
if ("User".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<User>>(){}.getType();
|
return new TypeToken<List<User>>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -43,16 +47,12 @@ public class JsonUtil {
|
|||||||
return new TypeToken<List<Category>>(){}.getType();
|
return new TypeToken<List<Category>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Pet".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Pet>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Tag>>(){}.getType();
|
return new TypeToken<List<Tag>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Pet".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Order>>(){}.getType();
|
return new TypeToken<List<Pet>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TypeToken<List<Object>>(){}.getType();
|
return new TypeToken<List<Object>>(){}.getType();
|
||||||
@ -61,6 +61,10 @@ public class JsonUtil {
|
|||||||
public static Type getTypeForDeserialization(Class cls) {
|
public static Type getTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<Order>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
if ("User".equalsIgnoreCase(className)) {
|
if ("User".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<User>(){}.getType();
|
return new TypeToken<User>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -69,16 +73,12 @@ public class JsonUtil {
|
|||||||
return new TypeToken<Category>(){}.getType();
|
return new TypeToken<Category>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Pet".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Pet>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Tag>(){}.getType();
|
return new TypeToken<Tag>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Pet".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Order>(){}.getType();
|
return new TypeToken<Pet>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TypeToken<Object>(){}.getType();
|
return new TypeToken<Object>(){}.getType();
|
||||||
|
@ -11,7 +11,6 @@ import java.util.*;
|
|||||||
import io.swagger.client.model.Pet;
|
import io.swagger.client.model.Pet;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -46,43 +45,42 @@ public class PetApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void updatePet (Pet body) throws ApiException {
|
public void updatePet (Pet body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"application/json","application/xml"
|
"application/json","application/xml"
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -100,43 +98,42 @@ public class PetApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void addPet (Pet body) throws ApiException {
|
public void addPet (Pet body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"application/json","application/xml"
|
"application/json","application/xml"
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -149,51 +146,50 @@ public class PetApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param status Status values that need to be considered for filter
|
* @param status Status values that need to be considered for query
|
||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByStatus (List<String> status) throws ApiException {
|
public List<Pet> findPetsByStatus (List<String> status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (List<Pet>) ApiInvoker.deserialize(response, "array", Pet.class);
|
return (List<Pet>) ApiInvoker.deserialize(localVarResponse, "array", Pet.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -210,46 +206,45 @@ public class PetApi {
|
|||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByTags (List<String> tags) throws ApiException {
|
public List<Pet> findPetsByTags (List<String> tags) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (List<Pet>) ApiInvoker.deserialize(response, "array", Pet.class);
|
return (List<Pet>) ApiInvoker.deserialize(localVarResponse, "array", Pet.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -266,7 +261,7 @@ public class PetApi {
|
|||||||
* @return Pet
|
* @return Pet
|
||||||
*/
|
*/
|
||||||
public Pet getPetById (Long petId) throws ApiException {
|
public Pet getPetById (Long petId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -275,40 +270,39 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (Pet) ApiInvoker.deserialize(response, "", Pet.class);
|
return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -327,7 +321,7 @@ public class PetApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
|
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -336,49 +330,48 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"application/x-www-form-urlencoded"
|
"application/x-www-form-urlencoded"
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
builder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8);
|
localVarBuilder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
builder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8);
|
localVarBuilder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
formParams.put("name", ApiInvoker.parameterToString(name));
|
localVarFormParams.put("name", ApiInvoker.parameterToString(name));
|
||||||
formParams.put("status", ApiInvoker.parameterToString(status));
|
localVarFormParams.put("status", ApiInvoker.parameterToString(status));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -397,7 +390,7 @@ public class PetApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void deletePet (Long petId, String apiKey) throws ApiException {
|
public void deletePet (Long petId, String apiKey) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -406,41 +399,40 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
headerParams.put("api_key", ApiInvoker.parameterToString(apiKey));
|
localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey));
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -460,7 +452,7 @@ public class PetApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
|
public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -469,49 +461,159 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
if (additionalMetadata != null) {
|
if (additionalMetadata != null) {
|
||||||
builder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8);
|
localVarBuilder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
builder.addBinaryBody("file", file);
|
localVarBuilder.addBinaryBody("file", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata));
|
localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -8,10 +8,9 @@ import io.swagger.client.model.*;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import io.swagger.client.model.Order;
|
import io.swagger.client.model.Order;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -40,49 +39,103 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Finds orders by status
|
||||||
* Returns a map of status codes to quantities
|
* A single status value can be provided as a string
|
||||||
* @return Map<String, Integer>
|
* @param status Status value that needs to be considered for query
|
||||||
|
* @return List<Order>
|
||||||
*/
|
*/
|
||||||
public Map<String, Integer> getInventory () throws ApiException {
|
public List<Order> findOrdersByStatus (String status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] localVarContentTypes = {
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (Map<String, Integer>) ApiInvoker.deserialize(response, "map", Map.class);
|
return (List<Order>) ApiInvoker.deserialize(localVarResponse, "array", Order.class);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns pet inventories by status
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
* @return Map<String, Integer>
|
||||||
|
*/
|
||||||
|
public Map<String, Integer> getInventory () throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
// 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 (Map<String, Integer>) ApiInvoker.deserialize(localVarResponse, "map", Map.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -99,44 +152,43 @@ public class StoreApi {
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
public Order placeOrder (Order body) throws ApiException {
|
public Order placeOrder (Order body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (Order) ApiInvoker.deserialize(response, "", Order.class);
|
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -153,7 +205,7 @@ public class StoreApi {
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
public Order getOrderById (String orderId) throws ApiException {
|
public Order getOrderById (String orderId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -162,40 +214,39 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (Order) ApiInvoker.deserialize(response, "", Order.class);
|
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -212,7 +263,7 @@ public class StoreApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void deleteOrder (String orderId) throws ApiException {
|
public void deleteOrder (String orderId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -221,39 +272,38 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -11,7 +11,6 @@ import java.util.*;
|
|||||||
import io.swagger.client.model.User;
|
import io.swagger.client.model.User;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -46,43 +45,42 @@ public class UserApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void createUser (User body) throws ApiException {
|
public void createUser (User body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -100,43 +98,42 @@ public class UserApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -154,43 +151,42 @@ public class UserApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void createUsersWithListInput (List<User> body) throws ApiException {
|
public void createUsersWithListInput (List<User> body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -209,48 +205,47 @@ public class UserApi {
|
|||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String loginUser (String username, String password) throws ApiException {
|
public String loginUser (String username, String password) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("", "username", username));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "username", username));
|
||||||
|
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (String) ApiInvoker.deserialize(response, "", String.class);
|
return (String) ApiInvoker.deserialize(localVarResponse, "", String.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -266,43 +261,42 @@ public class UserApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void logoutUser () throws ApiException {
|
public void logoutUser () throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -320,7 +314,7 @@ public class UserApi {
|
|||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
public User getUserByName (String username) throws ApiException {
|
public User getUserByName (String username) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -329,40 +323,39 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return (User) ApiInvoker.deserialize(response, "", User.class);
|
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
@ -380,7 +373,7 @@ public class UserApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void updateUser (String username, User body) throws ApiException {
|
public void updateUser (String username, User body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -389,39 +382,38 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -439,7 +431,7 @@ public class UserApi {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void deleteUser (String username) throws ApiException {
|
public void deleteUser (String username) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -448,39 +440,38 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
// header params
|
// header params
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
// form params
|
// form params
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (localVarContentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||||
if(response != null){
|
if(localVarResponse != null){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -24,11 +24,11 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'com.github.dcendents.android-maven'
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 23
|
||||||
buildToolsVersion '22.0.0'
|
buildToolsVersion '23.0.2'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 22
|
targetSdkVersion 23
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
@ -45,6 +45,10 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testOptions {
|
||||||
|
unitTests.returnDefaultValues = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -54,6 +58,8 @@ ext {
|
|||||||
httpclient_version = "4.3.3"
|
httpclient_version = "4.3.3"
|
||||||
volley_version = "1.0.19"
|
volley_version = "1.0.19"
|
||||||
junit_version = "4.8.1"
|
junit_version = "4.8.1"
|
||||||
|
robolectric_version = "3.0"
|
||||||
|
concurrent_unit_version = "0.4.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@ -63,6 +69,8 @@ dependencies {
|
|||||||
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
|
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
|
||||||
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
||||||
testCompile "junit:junit:$junit_version"
|
testCompile "junit:junit:$junit_version"
|
||||||
|
testCompile "org.robolectric:robolectric:${robolectric_version}"
|
||||||
|
testCompile "net.jodah:concurrentunit:${concurrent_unit_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
import android.content.Context;
|
import com.android.volley.Cache;
|
||||||
|
import com.android.volley.Network;
|
||||||
|
import com.android.volley.Request;
|
||||||
import com.android.volley.RequestQueue;
|
import com.android.volley.RequestQueue;
|
||||||
import com.android.volley.Response;
|
import com.android.volley.Response;
|
||||||
import com.android.volley.toolbox.Volley;
|
import com.android.volley.ResponseDelivery;
|
||||||
|
import com.android.volley.toolbox.BasicNetwork;
|
||||||
|
import com.android.volley.toolbox.HttpStack;
|
||||||
|
import com.android.volley.toolbox.HurlStack;
|
||||||
|
import com.android.volley.toolbox.NoCache;
|
||||||
|
import com.android.volley.toolbox.RequestFuture;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
|
|
||||||
import org.apache.http.Consts;
|
import org.apache.http.Consts;
|
||||||
@ -22,6 +28,9 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
import io.swagger.client.auth.Authentication;
|
import io.swagger.client.auth.Authentication;
|
||||||
import io.swagger.client.auth.ApiKeyAuth;
|
import io.swagger.client.auth.ApiKeyAuth;
|
||||||
@ -36,11 +45,12 @@ public class ApiInvoker {
|
|||||||
private static ApiInvoker INSTANCE;
|
private static ApiInvoker INSTANCE;
|
||||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
|
|
||||||
private Context context;
|
|
||||||
private RequestQueue mRequestQueue;
|
private RequestQueue mRequestQueue;
|
||||||
|
|
||||||
private Map<String, Authentication> authentications;
|
private Map<String, Authentication> authentications;
|
||||||
|
|
||||||
|
private int connectionTimeout;
|
||||||
|
|
||||||
/** Content type "text/plain" with UTF-8 encoding. */
|
/** Content type "text/plain" with UTF-8 encoding. */
|
||||||
public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8);
|
public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8);
|
||||||
|
|
||||||
@ -165,8 +175,16 @@ public class ApiInvoker {
|
|||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initializeInstance(Context context) {
|
public static void initializeInstance() {
|
||||||
INSTANCE = new ApiInvoker(context);
|
initializeInstance(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initializeInstance(Cache cache) {
|
||||||
|
initializeInstance(cache, null, 0, null, 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
|
||||||
|
INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout);
|
||||||
setUserAgent("Android-Volley-Swagger");
|
setUserAgent("Android-Volley-Swagger");
|
||||||
|
|
||||||
// Setup authentications (key: authentication name, value: authentication).
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
@ -175,21 +193,56 @@ public class ApiInvoker {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSTANCE.authentications.put("petstore_auth", new OAuth());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSTANCE.authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSTANCE.authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSTANCE.authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSTANCE.authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
|
INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
|
||||||
}
|
}
|
||||||
private ApiInvoker(Context context) {
|
|
||||||
this.context = context;
|
private ApiInvoker(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
|
||||||
initConnectionManager();
|
if(cache == null) cache = new NoCache();
|
||||||
|
if(network == null) {
|
||||||
|
HttpStack stack = new HurlStack();
|
||||||
|
network = new BasicNetwork(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiInvoker() {
|
if(delivery == null) {
|
||||||
initConnectionManager();
|
initConnectionRequest(cache, network);
|
||||||
|
} else {
|
||||||
|
initConnectionRequest(cache, network, threadPoolSize, delivery);
|
||||||
|
}
|
||||||
|
this.connectionTimeout = connectionTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ApiInvoker getInstance() {
|
public static ApiInvoker getInstance() {
|
||||||
@ -305,6 +358,14 @@ public class ApiInvoker {
|
|||||||
throw new RuntimeException("No API key authentication configured!");
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setConnectionTimeout(int connectionTimeout){
|
||||||
|
this.connectionTimeout = connectionTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getConnectionTimeout() {
|
||||||
|
return connectionTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update query and header parameters based on authentication settings.
|
* Update query and header parameters based on authentication settings.
|
||||||
*
|
*
|
||||||
@ -318,7 +379,21 @@ public class ApiInvoker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String invokeAPI(String host, String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException {
|
||||||
|
RequestFuture<String> future = RequestFuture.newFuture();
|
||||||
|
Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future);
|
||||||
|
if(request != null) {
|
||||||
|
mRequestQueue.add(request);
|
||||||
|
return future.get(connectionTimeout, TimeUnit.SECONDS);
|
||||||
|
} else return "no data";
|
||||||
|
}
|
||||||
|
|
||||||
public void invokeAPI(String host, String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String contentType, String[] authNames, Response.Listener<String> stringRequest, Response.ErrorListener errorListener) throws ApiException {
|
public void invokeAPI(String host, String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String contentType, String[] authNames, Response.Listener<String> stringRequest, Response.ErrorListener errorListener) throws ApiException {
|
||||||
|
Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener);
|
||||||
|
if (request != null) mRequestQueue.add(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Request<String> createRequest(String host, String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String contentType, String[] authNames, Response.Listener<String> stringRequest, Response.ErrorListener errorListener) throws ApiException {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
b.append("?");
|
b.append("?");
|
||||||
|
|
||||||
@ -375,13 +450,13 @@ public class ApiInvoker {
|
|||||||
}
|
}
|
||||||
formParamStr = formParamBuilder.toString();
|
formParamStr = formParamBuilder.toString();
|
||||||
}
|
}
|
||||||
|
Request request = null;
|
||||||
|
|
||||||
if ("GET".equals(method)) {
|
if ("GET".equals(method)) {
|
||||||
GetRequest request = new GetRequest(url, headers, null, stringRequest, errorListener);
|
request = new GetRequest(url, headers, null, stringRequest, errorListener);
|
||||||
mRequestQueue.add(request);
|
|
||||||
}
|
}
|
||||||
else if ("POST".equals(method)) {
|
else if ("POST".equals(method)) {
|
||||||
PostRequest request = null;
|
request = null;
|
||||||
if (formParamStr != null) {
|
if (formParamStr != null) {
|
||||||
request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||||
} else if (body != null) {
|
} else if (body != null) {
|
||||||
@ -390,11 +465,12 @@ public class ApiInvoker {
|
|||||||
} else {
|
} else {
|
||||||
request = new PostRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
request = new PostRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
request = new PostRequest(url, headers, null, null, stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
if(request != null) mRequestQueue.add(request);
|
|
||||||
}
|
}
|
||||||
else if ("PUT".equals(method)) {
|
else if ("PUT".equals(method)) {
|
||||||
PutRequest request = null;
|
request = null;
|
||||||
if (formParamStr != null) {
|
if (formParamStr != null) {
|
||||||
request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||||
} else if (body != null) {
|
} else if (body != null) {
|
||||||
@ -403,11 +479,12 @@ public class ApiInvoker {
|
|||||||
} else {
|
} else {
|
||||||
request = new PutRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
request = new PutRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
request = new PutRequest(url, headers, null, null, stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
if(request != null) mRequestQueue.add(request);
|
|
||||||
}
|
}
|
||||||
else if ("DELETE".equals(method)) {
|
else if ("DELETE".equals(method)) {
|
||||||
DeleteRequest request = null;
|
request = null;
|
||||||
if (formParamStr != null) {
|
if (formParamStr != null) {
|
||||||
request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||||
} else if (body != null) {
|
} else if (body != null) {
|
||||||
@ -416,11 +493,12 @@ public class ApiInvoker {
|
|||||||
} else {
|
} else {
|
||||||
request = new DeleteRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
request = new DeleteRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
request = new DeleteRequest(url, headers, null, null, stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
if(request != null) mRequestQueue.add(request);
|
|
||||||
}
|
}
|
||||||
else if ("PATCH".equals(method)) {
|
else if ("PATCH".equals(method)) {
|
||||||
PatchRequest request = null;
|
request = null;
|
||||||
if (formParamStr != null) {
|
if (formParamStr != null) {
|
||||||
request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||||
} else if (body != null) {
|
} else if (body != null) {
|
||||||
@ -429,12 +507,24 @@ public class ApiInvoker {
|
|||||||
} else {
|
} else {
|
||||||
request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
request = new PatchRequest(url, headers, null, null, stringRequest, errorListener);
|
||||||
}
|
}
|
||||||
if(request != null) mRequestQueue.add(request);
|
|
||||||
}
|
}
|
||||||
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initConnectionManager() {
|
private void initConnectionRequest(Cache cache, Network network) {
|
||||||
mRequestQueue = Volley.newRequestQueue(context);
|
mRequestQueue = new RequestQueue(cache, network);
|
||||||
|
mRequestQueue.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initConnectionRequest(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery) {
|
||||||
|
mRequestQueue = new RequestQueue(cache, network, threadPoolSize, delivery);
|
||||||
|
mRequestQueue.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopQueue() {
|
||||||
|
mRequestQueue.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,10 @@ public class JsonUtil {
|
|||||||
public static Type getListTypeForDeserialization(Class cls) {
|
public static Type getListTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<List<Order>>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
if ("User".equalsIgnoreCase(className)) {
|
if ("User".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<User>>(){}.getType();
|
return new TypeToken<List<User>>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -43,16 +47,12 @@ public class JsonUtil {
|
|||||||
return new TypeToken<List<Category>>(){}.getType();
|
return new TypeToken<List<Category>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Pet".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Pet>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Tag>>(){}.getType();
|
return new TypeToken<List<Tag>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Pet".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Order>>(){}.getType();
|
return new TypeToken<List<Pet>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TypeToken<List<Object>>(){}.getType();
|
return new TypeToken<List<Object>>(){}.getType();
|
||||||
@ -61,6 +61,10 @@ public class JsonUtil {
|
|||||||
public static Type getTypeForDeserialization(Class cls) {
|
public static Type getTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
|
return new TypeToken<Order>(){}.getType();
|
||||||
|
}
|
||||||
|
|
||||||
if ("User".equalsIgnoreCase(className)) {
|
if ("User".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<User>(){}.getType();
|
return new TypeToken<User>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -69,16 +73,12 @@ public class JsonUtil {
|
|||||||
return new TypeToken<Category>(){}.getType();
|
return new TypeToken<Category>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Pet".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Pet>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Tag>(){}.getType();
|
return new TypeToken<Tag>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Pet".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Order>(){}.getType();
|
return new TypeToken<Pet>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TypeToken<Object>(){}.getType();
|
return new TypeToken<Object>(){}.getType();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,5 @@
|
|||||||
package io.swagger.client.api;
|
package io.swagger.client.api;
|
||||||
|
|
||||||
import io.swagger.client.Responses;
|
|
||||||
import io.swagger.client.ApiInvoker;
|
import io.swagger.client.ApiInvoker;
|
||||||
import io.swagger.client.ApiException;
|
import io.swagger.client.ApiException;
|
||||||
import io.swagger.client.Pair;
|
import io.swagger.client.Pair;
|
||||||
@ -12,15 +11,18 @@ import java.util.*;
|
|||||||
import com.android.volley.Response;
|
import com.android.volley.Response;
|
||||||
import com.android.volley.VolleyError;
|
import com.android.volley.VolleyError;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import io.swagger.client.model.Order;
|
import io.swagger.client.model.Order;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.io.File;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
public class StoreApi {
|
public class StoreApi {
|
||||||
String basePath = "http://petstore.swagger.io/v2";
|
String basePath = "http://petstore.swagger.io/v2";
|
||||||
@ -43,12 +45,213 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 List<Order>
|
||||||
|
*/
|
||||||
|
public List<Order> findOrdersByStatus (String status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
queryParams.addAll(ApiInvoker.parameterToPairs("", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (List<Order>) ApiInvoker.deserialize(localVarResponse, "array", Order.class);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
public void findOrdersByStatus (String status, final Response.Listener<List<Order>> responseListener, final Response.ErrorListener errorListener) {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
queryParams.addAll(ApiInvoker.parameterToPairs("", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
try {
|
||||||
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
|
new Response.Listener<String>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
responseListener.onResponse((List<Order>) ApiInvoker.deserialize(localVarResponse, "array", Order.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} catch (ApiException exception) {
|
||||||
|
errorListener.onErrorResponse(new VolleyError(exception));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, new Response.ErrorListener() {
|
||||||
|
@Override
|
||||||
|
public void onErrorResponse(VolleyError error) {
|
||||||
|
errorListener.onErrorResponse(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
errorListener.onErrorResponse(new VolleyError(ex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
* @return Map<String, Integer>
|
* @return Map<String, Integer>
|
||||||
*/
|
*/
|
||||||
public void getInventory (final Responses.MapResponse responseListener, final Response.ErrorListener errorListener) {
|
public Map<String, Integer> getInventory () throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { "api_key" };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (Map<String, Integer>) ApiInvoker.deserialize(localVarResponse, "map", Map.class);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns pet inventories by status
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
*/
|
||||||
|
public void getInventory (final Response.Listener<Map<String, Integer>> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -74,10 +277,10 @@ public class StoreApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -90,10 +293,10 @@ public class StoreApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
responseListener.onResponse((Map<String, Integer>) ApiInvoker.deserialize(response, "map", Map.class));
|
responseListener.onResponse((Map<String, Integer>) ApiInvoker.deserialize(localVarResponse, "map", Map.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -119,7 +322,70 @@ public class StoreApi {
|
|||||||
* @param body order placed for purchasing the pet
|
* @param body order placed for purchasing the pet
|
||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
public void placeOrder (Order body, final Responses.OrderResponse responseListener, final Response.ErrorListener errorListener) {
|
public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place an order for a pet
|
||||||
|
*
|
||||||
|
* @param body order placed for purchasing the pet
|
||||||
|
*/
|
||||||
|
public void placeOrder (Order body, final Response.Listener<Order> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = body;
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
@ -145,26 +411,26 @@ public class StoreApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
responseListener.onResponse((Order) ApiInvoker.deserialize(response, "", Order.class));
|
responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -190,7 +456,76 @@ public class StoreApi {
|
|||||||
* @param orderId ID of pet that needs to be fetched
|
* @param orderId ID of pet that needs to be fetched
|
||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
public void getOrderById (String orderId, final Responses.OrderResponse responseListener, final Response.ErrorListener errorListener) {
|
public Order getOrderById (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null) {
|
||||||
|
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById",
|
||||||
|
new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
public void getOrderById (String orderId, final Response.Listener<Order> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -222,26 +557,26 @@ public class StoreApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
responseListener.onResponse((Order) ApiInvoker.deserialize(response, "", Order.class));
|
responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -267,7 +602,76 @@ public class StoreApi {
|
|||||||
* @param orderId ID of the order that needs to be deleted
|
* @param orderId ID of the order that needs to be deleted
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void deleteOrder (String orderId, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void deleteOrder (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null) {
|
||||||
|
VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
|
||||||
|
new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
public void deleteOrder (String orderId, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -299,10 +703,10 @@ public class StoreApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -315,10 +719,10 @@ public class StoreApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package io.swagger.client.api;
|
package io.swagger.client.api;
|
||||||
|
|
||||||
import io.swagger.client.Responses;
|
|
||||||
import io.swagger.client.ApiInvoker;
|
import io.swagger.client.ApiInvoker;
|
||||||
import io.swagger.client.ApiException;
|
import io.swagger.client.ApiException;
|
||||||
import io.swagger.client.Pair;
|
import io.swagger.client.Pair;
|
||||||
@ -18,9 +17,12 @@ import java.util.*;
|
|||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.io.File;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
public class UserApi {
|
public class UserApi {
|
||||||
String basePath = "http://petstore.swagger.io/v2";
|
String basePath = "http://petstore.swagger.io/v2";
|
||||||
@ -49,7 +51,70 @@ public class UserApi {
|
|||||||
* @param body Created user object
|
* @param body Created user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void createUser (User body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param body Created user object
|
||||||
|
*/
|
||||||
|
public void createUser (User body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = body;
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
@ -75,10 +140,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -91,10 +156,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -115,7 +180,70 @@ public class UserApi {
|
|||||||
* @param body List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void createUsersWithArrayInput (List<User> body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void createUsersWithArrayInput (List<User> body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param body List of user object
|
||||||
|
*/
|
||||||
|
public void createUsersWithArrayInput (List<User> body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = body;
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
@ -141,10 +269,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -157,10 +285,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -181,7 +309,70 @@ public class UserApi {
|
|||||||
* @param body List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void createUsersWithListInput (List<User> body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void createUsersWithListInput (List<User> body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param body List of user object
|
||||||
|
*/
|
||||||
|
public void createUsersWithListInput (List<User> body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = body;
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
@ -207,10 +398,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -223,10 +414,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -248,7 +439,74 @@ public class UserApi {
|
|||||||
* @param password The password for login in clear text
|
* @param password The password for login in clear text
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public void loginUser (String username, String password, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public String loginUser (String username, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
queryParams.addAll(ApiInvoker.parameterToPairs("", "username", username));
|
||||||
|
|
||||||
|
queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (String) ApiInvoker.deserialize(localVarResponse, "", String.class);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs user into the system
|
||||||
|
*
|
||||||
|
* @param username The user name for login * @param password The password for login in clear text
|
||||||
|
*/
|
||||||
|
public void loginUser (String username, String password, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -278,10 +536,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -294,10 +552,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
responseListener.onResponse((String) ApiInvoker.deserialize(response, "", String.class));
|
responseListener.onResponse((String) ApiInvoker.deserialize(localVarResponse, "", String.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -322,7 +580,70 @@ public class UserApi {
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void logoutUser (final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void logoutUser () throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
public void logoutUser (final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -348,10 +669,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -364,10 +685,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -388,7 +709,76 @@ public class UserApi {
|
|||||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
public void getUserByName (String username, final Responses.UserResponse responseListener, final Response.ErrorListener errorListener) {
|
public User getUserByName (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName",
|
||||||
|
new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
|
*/
|
||||||
|
public void getUserByName (String username, final Response.Listener<User> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -420,10 +810,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -436,10 +826,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
responseListener.onResponse((User) ApiInvoker.deserialize(response, "", User.class));
|
responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -466,7 +856,76 @@ public class UserApi {
|
|||||||
* @param body Updated user object
|
* @param body Updated user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void updateUser (String username, User body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = body;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser",
|
||||||
|
new ApiException(400, "Missing the required parameter 'username' when calling updateUser"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
public void updateUser (String username, User body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = body;
|
Object postBody = body;
|
||||||
|
|
||||||
|
|
||||||
@ -498,10 +957,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -514,10 +973,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -538,7 +997,76 @@ public class UserApi {
|
|||||||
* @param username The name that needs to be deleted
|
* @param username The name that needs to be deleted
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void deleteUser (String username, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
public void deleteUser (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
|
Object postBody = null;
|
||||||
|
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null) {
|
||||||
|
VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser",
|
||||||
|
new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> queryParams = new ArrayList<Pair>();
|
||||||
|
// header params
|
||||||
|
Map<String, String> headerParams = new HashMap<String, String>();
|
||||||
|
// form params
|
||||||
|
Map<String, String> formParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String[] contentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||||
|
|
||||||
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
|
// file uploading
|
||||||
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
|
postBody = httpEntity;
|
||||||
|
} else {
|
||||||
|
// normal form params
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
|
try {
|
||||||
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
|
if(localVarResponse != null){
|
||||||
|
return ;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
} catch (ApiException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
throw ex;
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
if(ex.getCause() instanceof VolleyError) {
|
||||||
|
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
} catch (TimeoutException ex) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username The name that needs to be deleted
|
||||||
|
*/
|
||||||
|
public void deleteUser (String username, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
|
|
||||||
|
|
||||||
@ -570,10 +1098,10 @@ public class UserApi {
|
|||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
if (contentType.startsWith("multipart/form-data")) {
|
||||||
// file uploading
|
// file uploading
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = builder.build();
|
HttpEntity httpEntity = localVarBuilder.build();
|
||||||
postBody = httpEntity;
|
postBody = httpEntity;
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
@ -586,10 +1114,10 @@ public class UserApi {
|
|||||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String localVarResponse) {
|
||||||
|
|
||||||
|
|
||||||
responseListener.onResponse(response);
|
responseListener.onResponse(localVarResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,9 @@ public class ApiKeyAuth implements Authentication {
|
|||||||
@Override
|
@Override
|
||||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||||
String value;
|
String value;
|
||||||
|
if (apiKey == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (apiKeyPrefix != null) {
|
if (apiKeyPrefix != null) {
|
||||||
value = apiKeyPrefix + " " + apiKey;
|
value = apiKeyPrefix + " " + apiKey;
|
||||||
} else {
|
} else {
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
(defn find-pets-by-status-with-http-info
|
(defn find-pets-by-status-with-http-info
|
||||||
"Finds Pets by status
|
"Finds Pets by status
|
||||||
Multiple status values can be provided with comma seperated strings"
|
Multiple status values can be provided with comma separated strings"
|
||||||
([] (find-pets-by-status-with-http-info nil))
|
([] (find-pets-by-status-with-http-info nil))
|
||||||
([{:keys [status ]}]
|
([{:keys [status ]}]
|
||||||
(call-api "/pet/findByStatus" :get
|
(call-api "/pet/findByStatus" :get
|
||||||
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
(defn find-pets-by-status
|
(defn find-pets-by-status
|
||||||
"Finds Pets by status
|
"Finds Pets by status
|
||||||
Multiple status values can be provided with comma seperated strings"
|
Multiple status values can be provided with comma separated strings"
|
||||||
([] (find-pets-by-status nil))
|
([] (find-pets-by-status nil))
|
||||||
([optional-params]
|
([optional-params]
|
||||||
(:data (find-pets-by-status-with-http-info optional-params))))
|
(:data (find-pets-by-status-with-http-info optional-params))))
|
||||||
@ -99,7 +99,7 @@
|
|||||||
:form-params {}
|
:form-params {}
|
||||||
:content-types []
|
:content-types []
|
||||||
:accepts ["application/json" "application/xml"]
|
:accepts ["application/json" "application/xml"]
|
||||||
:auth-names ["api_key"]}))
|
:auth-names ["petstore_auth" "api_key"]}))
|
||||||
|
|
||||||
(defn get-pet-by-id
|
(defn get-pet-by-id
|
||||||
"Find pet by ID
|
"Find pet by ID
|
||||||
@ -169,3 +169,44 @@
|
|||||||
([pet-id ] (upload-file pet-id nil))
|
([pet-id ] (upload-file pet-id nil))
|
||||||
([pet-id optional-params]
|
([pet-id optional-params]
|
||||||
(:data (upload-file-with-http-info pet-id optional-params))))
|
(:data (upload-file-with-http-info pet-id optional-params))))
|
||||||
|
|
||||||
|
(defn pet-pet-idtesting-byte-arraytrue-get-with-http-info
|
||||||
|
"Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||||
|
[pet-id ]
|
||||||
|
(call-api "/pet/{petId}?testing_byte_array=true" :get
|
||||||
|
{:path-params {"petId" pet-id }
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["petstore_auth" "api_key"]}))
|
||||||
|
|
||||||
|
(defn pet-pet-idtesting-byte-arraytrue-get
|
||||||
|
"Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||||
|
[pet-id ]
|
||||||
|
(:data (pet-pet-idtesting-byte-arraytrue-get-with-http-info pet-id)))
|
||||||
|
|
||||||
|
(defn add-pet-using-byte-array-with-http-info
|
||||||
|
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
"
|
||||||
|
([] (add-pet-using-byte-array-with-http-info nil))
|
||||||
|
([{:keys [body ]}]
|
||||||
|
(call-api "/pet?testing_byte_array=true" :post
|
||||||
|
{:path-params {}
|
||||||
|
:header-params {}
|
||||||
|
:query-params {}
|
||||||
|
:form-params {}
|
||||||
|
:body-param body
|
||||||
|
:content-types ["application/json" "application/xml"]
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["petstore_auth"]})))
|
||||||
|
|
||||||
|
(defn add-pet-using-byte-array
|
||||||
|
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
"
|
||||||
|
([] (add-pet-using-byte-array nil))
|
||||||
|
([optional-params]
|
||||||
|
(:data (add-pet-using-byte-array-with-http-info optional-params))))
|
||||||
|
@ -2,6 +2,27 @@
|
|||||||
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
||||||
(:import (java.io File)))
|
(:import (java.io File)))
|
||||||
|
|
||||||
|
(defn find-orders-by-status-with-http-info
|
||||||
|
"Finds orders by status
|
||||||
|
A single status value can be provided as a string"
|
||||||
|
([] (find-orders-by-status-with-http-info nil))
|
||||||
|
([{:keys [status ]}]
|
||||||
|
(call-api "/store/findByStatus" :get
|
||||||
|
{:path-params {}
|
||||||
|
:header-params {}
|
||||||
|
:query-params {"status" status }
|
||||||
|
:form-params {}
|
||||||
|
:content-types []
|
||||||
|
:accepts ["application/json" "application/xml"]
|
||||||
|
:auth-names ["test_api_client_id" "test_api_client_secret"]})))
|
||||||
|
|
||||||
|
(defn find-orders-by-status
|
||||||
|
"Finds orders by status
|
||||||
|
A single status value can be provided as a string"
|
||||||
|
([] (find-orders-by-status nil))
|
||||||
|
([optional-params]
|
||||||
|
(:data (find-orders-by-status-with-http-info optional-params))))
|
||||||
|
|
||||||
(defn get-inventory-with-http-info
|
(defn get-inventory-with-http-info
|
||||||
"Returns pet inventories by status
|
"Returns pet inventories by status
|
||||||
Returns a map of status codes to quantities"
|
Returns a map of status codes to quantities"
|
||||||
@ -34,7 +55,7 @@
|
|||||||
:body-param body
|
:body-param body
|
||||||
:content-types []
|
:content-types []
|
||||||
:accepts ["application/json" "application/xml"]
|
:accepts ["application/json" "application/xml"]
|
||||||
:auth-names []})))
|
:auth-names ["test_api_client_id" "test_api_client_secret"]})))
|
||||||
|
|
||||||
(defn place-order
|
(defn place-order
|
||||||
"Place an order for a pet
|
"Place an order for a pet
|
||||||
@ -54,7 +75,7 @@
|
|||||||
:form-params {}
|
:form-params {}
|
||||||
:content-types []
|
:content-types []
|
||||||
:accepts ["application/json" "application/xml"]
|
:accepts ["application/json" "application/xml"]
|
||||||
:auth-names []}))
|
:auth-names ["test_api_key_query" "test_api_key_header"]}))
|
||||||
|
|
||||||
(defn get-order-by-id
|
(defn get-order-by-id
|
||||||
"Find purchase order by ID
|
"Find purchase order by ID
|
||||||
|
@ -9,7 +9,11 @@
|
|||||||
|
|
||||||
(def auth-definitions
|
(def auth-definitions
|
||||||
{"petstore_auth" {:type :oauth2}
|
{"petstore_auth" {:type :oauth2}
|
||||||
"api_key" {:type :api-key :in :header :param-name "api_key"}})
|
"test_api_client_id" {:type :api-key :in :header :param-name "x-test_api_client_id"}
|
||||||
|
"test_api_client_secret" {:type :api-key :in :header :param-name "x-test_api_client_secret"}
|
||||||
|
"api_key" {:type :api-key :in :header :param-name "api_key"}
|
||||||
|
"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"}})
|
||||||
|
|
||||||
(def default-api-context
|
(def default-api-context
|
||||||
"Default API context."
|
"Default API context."
|
||||||
@ -18,7 +22,11 @@
|
|||||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||||
:debug false
|
:debug false
|
||||||
:auths {"petstore_auth" nil
|
:auths {"petstore_auth" nil
|
||||||
"api_key" nil}})
|
"test_api_client_id" nil
|
||||||
|
"test_api_client_secret" nil
|
||||||
|
"api_key" nil
|
||||||
|
"test_api_key_query" nil
|
||||||
|
"test_api_key_header" nil}})
|
||||||
|
|
||||||
(def ^:dynamic *api-context*
|
(def ^:dynamic *api-context*
|
||||||
"Dynamic API context to be applied in API calls."
|
"Dynamic API context to be applied in API calls."
|
||||||
|
@ -11,7 +11,11 @@
|
|||||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||||
:debug false
|
:debug false
|
||||||
:auths {"api_key" nil
|
:auths {"api_key" nil
|
||||||
"petstore_auth" nil}}
|
"petstore_auth" nil
|
||||||
|
"test_api_client_id" nil
|
||||||
|
"test_api_client_secret" nil
|
||||||
|
"test_api_key_query" nil
|
||||||
|
"test_api_key_header" nil}}
|
||||||
default-api-context
|
default-api-context
|
||||||
*api-context*
|
*api-context*
|
||||||
(with-api-context {}
|
(with-api-context {}
|
||||||
@ -25,8 +29,9 @@
|
|||||||
:date-format "yyyy-MM-dd"
|
:date-format "yyyy-MM-dd"
|
||||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||||
:debug true
|
:debug true
|
||||||
:auths {"api_key" "key1"
|
:auths (merge (:auths default-api-context)
|
||||||
"petstore_auth" "token1"}}
|
{"api_key" "key1"
|
||||||
|
"petstore_auth" "token1"})}
|
||||||
*api-context*))
|
*api-context*))
|
||||||
;; nested with-api-context inherits values from the outer api context
|
;; nested with-api-context inherits values from the outer api context
|
||||||
(with-api-context {:datetime-format "yyyy-MM-dd HH:mm:ss"
|
(with-api-context {:datetime-format "yyyy-MM-dd HH:mm:ss"
|
||||||
@ -35,8 +40,9 @@
|
|||||||
:date-format "yyyy-MM-dd"
|
:date-format "yyyy-MM-dd"
|
||||||
:datetime-format "yyyy-MM-dd HH:mm:ss"
|
:datetime-format "yyyy-MM-dd HH:mm:ss"
|
||||||
:debug true
|
:debug true
|
||||||
:auths {"api_key" "key2"
|
:auths (merge (:auths default-api-context)
|
||||||
"petstore_auth" "token1"}}
|
{"api_key" "key2"
|
||||||
|
"petstore_auth" "token1"})}
|
||||||
*api-context*))))
|
*api-context*))))
|
||||||
;; back to default api context
|
;; back to default api context
|
||||||
(is (= {:base-url "http://petstore.swagger.io/v2"
|
(is (= {:base-url "http://petstore.swagger.io/v2"
|
||||||
@ -44,7 +50,11 @@
|
|||||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||||
:debug false
|
:debug false
|
||||||
:auths {"api_key" nil
|
:auths {"api_key" nil
|
||||||
"petstore_auth" nil}}
|
"petstore_auth" nil
|
||||||
|
"test_api_client_id" nil
|
||||||
|
"test_api_client_secret" nil
|
||||||
|
"test_api_key_query" nil
|
||||||
|
"test_api_key_header" nil}}
|
||||||
default-api-context
|
default-api-context
|
||||||
*api-context*))))
|
*api-context*))))
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-25T16:09:10.101+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:35.772+08:00")
|
||||||
public class PetApi {
|
public class PetApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -43,15 +43,15 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void updatePet(Pet body) throws ApiException {
|
public void updatePet(Pet body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -59,20 +59,20 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,15 +83,15 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void addPet(Pet body) throws ApiException {
|
public void addPet(Pet body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -99,64 +99,64 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param status Status values that need to be considered for filter
|
* @param status Status values that need to be considered for query
|
||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<List<Pet>> returnType = new GenericType<List<Pet>>() {};
|
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,39 +168,39 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<List<Pet>> returnType = new GenericType<List<Pet>>() {};
|
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Pet getPetById(Long petId) throws ApiException {
|
public Pet getPetById(Long petId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -220,13 +220,13 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -234,21 +234,21 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Pet> returnType = new GenericType<Pet>() {};
|
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -269,38 +269,38 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (name != null)
|
if (name != null)
|
||||||
formParams.put("name", name);
|
localVarFormParams.put("name", name);
|
||||||
if (status != null)
|
if (status != null)
|
||||||
formParams.put("status", status);
|
localVarFormParams.put("status", status);
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/x-www-form-urlencoded"
|
"application/x-www-form-urlencoded"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -320,36 +320,36 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (apiKey != null)
|
if (apiKey != null)
|
||||||
headerParams.put("api_key", apiClient.parameterToString(apiKey));
|
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -370,38 +370,38 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (additionalMetadata != null)
|
if (additionalMetadata != null)
|
||||||
formParams.put("additionalMetadata", additionalMetadata);
|
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||||
if (file != null)
|
if (file != null)
|
||||||
formParams.put("file", file);
|
localVarFormParams.put("file", file);
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
|
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -421,13 +421,13 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -435,21 +435,21 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<byte[]> returnType = new GenericType<byte[]>() {};
|
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,15 +460,15 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -476,20 +476,20 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-23T20:01:57.005+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:35.772+08:00")
|
||||||
public class StoreApi {
|
public class StoreApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -35,6 +35,50 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 List<Order>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public List<Order> findOrdersByStatus(String status) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json", "application/xml"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
|
||||||
|
GenericType<List<Order>> localVarReturnType = new GenericType<List<Order>>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
@ -42,15 +86,15 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Map<String, Integer> getInventory() throws ApiException {
|
public Map<String, Integer> getInventory() throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -58,21 +102,21 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "api_key" };
|
String[] localVarAuthNames = new String[] { "api_key" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Map<String, Integer>> returnType = new GenericType<Map<String, Integer>>() {};
|
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,15 +128,15 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Order placeOrder(Order body) throws ApiException {
|
public Order placeOrder(Order body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -100,21 +144,21 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Order> returnType = new GenericType<Order>() {};
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
return apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +170,7 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Order getOrderById(String orderId) throws ApiException {
|
public Order getOrderById(String orderId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -134,13 +178,13 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -148,21 +192,21 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Order> returnType = new GenericType<Order>() {};
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,7 +217,7 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void deleteOrder(String orderId) throws ApiException {
|
public void deleteOrder(String orderId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -181,13 +225,13 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -195,20 +239,20 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-23T20:01:57.005+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:35.772+08:00")
|
||||||
public class UserApi {
|
public class UserApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -42,15 +42,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void createUser(User body) throws ApiException {
|
public void createUser(User body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -58,20 +58,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,15 +82,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -98,20 +98,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,15 +122,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -138,20 +138,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,41 +164,41 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public String loginUser(String username, String password) throws ApiException {
|
public String loginUser(String username, String password) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
GenericType<String> returnType = new GenericType<String>() {};
|
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,15 +208,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void logoutUser() throws ApiException {
|
public void logoutUser() throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -224,20 +224,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public User getUserByName(String username) throws ApiException {
|
public User getUserByName(String username) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -257,13 +257,13 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -271,21 +271,21 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
GenericType<User> returnType = new GenericType<User>() {};
|
GenericType<User> localVarReturnType = new GenericType<User>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void updateUser(String username, User body) throws ApiException {
|
public void updateUser(String username, User body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -305,13 +305,13 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -319,20 +319,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void deleteUser(String username) throws ApiException {
|
public void deleteUser(String username) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -351,13 +351,13 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -365,20 +365,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-25T16:20:48.283+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:37.248+08:00")
|
||||||
public class PetApi {
|
public class PetApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -43,15 +43,15 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void updatePet(Pet body) throws ApiException {
|
public void updatePet(Pet body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -59,20 +59,20 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,15 +83,15 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void addPet(Pet body) throws ApiException {
|
public void addPet(Pet body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -99,64 +99,64 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param status Status values that need to be considered for filter
|
* @param status Status values that need to be considered for query
|
||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<List<Pet>> returnType = new GenericType<List<Pet>>() {};
|
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,39 +168,39 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<List<Pet>> returnType = new GenericType<List<Pet>>() {};
|
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Pet getPetById(Long petId) throws ApiException {
|
public Pet getPetById(Long petId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -220,13 +220,13 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -234,21 +234,21 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Pet> returnType = new GenericType<Pet>() {};
|
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -269,38 +269,38 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (name != null)
|
if (name != null)
|
||||||
formParams.put("name", name);
|
localVarFormParams.put("name", name);
|
||||||
if (status != null)
|
if (status != null)
|
||||||
formParams.put("status", status);
|
localVarFormParams.put("status", status);
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/x-www-form-urlencoded"
|
"application/x-www-form-urlencoded"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -320,36 +320,36 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (apiKey != null)
|
if (apiKey != null)
|
||||||
headerParams.put("api_key", apiClient.parameterToString(apiKey));
|
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -370,38 +370,38 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (additionalMetadata != null)
|
if (additionalMetadata != null)
|
||||||
formParams.put("additionalMetadata", additionalMetadata);
|
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||||
if (file != null)
|
if (file != null)
|
||||||
formParams.put("file", file);
|
localVarFormParams.put("file", file);
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
|
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -421,13 +421,13 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -435,21 +435,21 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<byte[]> returnType = new GenericType<byte[]>() {};
|
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,15 +460,15 @@ public class PetApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -476,20 +476,20 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-23T20:02:09.740+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:37.248+08:00")
|
||||||
public class StoreApi {
|
public class StoreApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -35,6 +35,50 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 List<Order>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public List<Order> findOrdersByStatus(String status) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
// query params
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json", "application/xml"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
|
||||||
|
GenericType<List<Order>> localVarReturnType = new GenericType<List<Order>>() {};
|
||||||
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
@ -42,15 +86,15 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Map<String, Integer> getInventory() throws ApiException {
|
public Map<String, Integer> getInventory() throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -58,21 +102,21 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "api_key" };
|
String[] localVarAuthNames = new String[] { "api_key" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Map<String, Integer>> returnType = new GenericType<Map<String, Integer>>() {};
|
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,15 +128,15 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Order placeOrder(Order body) throws ApiException {
|
public Order placeOrder(Order body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -100,21 +144,21 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Order> returnType = new GenericType<Order>() {};
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
return apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +170,7 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public Order getOrderById(String orderId) throws ApiException {
|
public Order getOrderById(String orderId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -134,13 +178,13 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -148,21 +192,21 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||||
|
|
||||||
|
|
||||||
GenericType<Order> returnType = new GenericType<Order>() {};
|
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,7 +217,7 @@ public class StoreApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void deleteOrder(String orderId) throws ApiException {
|
public void deleteOrder(String orderId) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -181,13 +225,13 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -195,20 +239,20 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-23T20:02:09.740+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-29T12:55:37.248+08:00")
|
||||||
public class UserApi {
|
public class UserApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
@ -42,15 +42,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void createUser(User body) throws ApiException {
|
public void createUser(User body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -58,20 +58,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,15 +82,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -98,20 +98,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,15 +122,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -138,20 +138,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,41 +164,41 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public String loginUser(String username, String password) throws ApiException {
|
public String loginUser(String username, String password) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||||
|
|
||||||
queryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
GenericType<String> returnType = new GenericType<String>() {};
|
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,15 +208,15 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void logoutUser() throws ApiException {
|
public void logoutUser() throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -224,20 +224,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public User getUserByName(String username) throws ApiException {
|
public User getUserByName(String username) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -257,13 +257,13 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -271,21 +271,21 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
GenericType<User> returnType = new GenericType<User>() {};
|
GenericType<User> localVarReturnType = new GenericType<User>() {};
|
||||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void updateUser(String username, User body) throws ApiException {
|
public void updateUser(String username, User body) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -305,13 +305,13 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -319,20 +319,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ public class UserApi {
|
|||||||
* @throws ApiException if fails to make API call
|
* @throws ApiException if fails to make API call
|
||||||
*/
|
*/
|
||||||
public void deleteUser(String username) throws ApiException {
|
public void deleteUser(String username) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -351,13 +351,13 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -365,20 +365,20 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
|
|
||||||
|
|
||||||
apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, null);
|
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,29 +48,29 @@ public class PetApi {
|
|||||||
|
|
||||||
/* Build call for updatePet */
|
/* Build call for updatePet */
|
||||||
private Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -84,8 +84,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "PUT", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,29 +146,29 @@ public class PetApi {
|
|||||||
|
|
||||||
/* Build call for addPet */
|
/* Build call for addPet */
|
||||||
private Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -182,8 +182,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -244,31 +244,31 @@ public class PetApi {
|
|||||||
|
|
||||||
/* Build call for findPetsByStatus */
|
/* Build call for findPetsByStatus */
|
||||||
private Call findPetsByStatusCall(List<String> status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call findPetsByStatusCall(List<String> status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
if (status != null)
|
if (status != null)
|
||||||
queryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -282,14 +282,14 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param status Status values that need to be considered for filter
|
* @param status Status values that need to be considered for query
|
||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
*/
|
*/
|
||||||
@ -300,21 +300,21 @@ public class PetApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param status Status values that need to be considered for filter
|
* @param status Status values that need to be considered for query
|
||||||
* @return ApiResponse<List<Pet>>
|
* @return ApiResponse<List<Pet>>
|
||||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
*/
|
*/
|
||||||
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
|
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
|
||||||
Call call = findPetsByStatusCall(status, null, null);
|
Call call = findPetsByStatusCall(status, null, null);
|
||||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status (asynchronously)
|
* Finds Pets by status (asynchronously)
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param status Status values that need to be considered for filter
|
* @param status Status values that need to be considered for query
|
||||||
* @param callback The callback to be executed when the API call finishes
|
* @param callback The callback to be executed when the API call finishes
|
||||||
* @return The request call
|
* @return The request call
|
||||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||||
@ -341,38 +341,38 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
|
Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for findPetsByTags */
|
/* Build call for findPetsByTags */
|
||||||
private Call findPetsByTagsCall(List<String> tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call findPetsByTagsCall(List<String> tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
if (tags != null)
|
if (tags != null)
|
||||||
queryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -386,8 +386,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -411,8 +411,8 @@ public class PetApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<List<Pet>> findPetsByTagsWithHttpInfo(List<String> tags) throws ApiException {
|
public ApiResponse<List<Pet>> findPetsByTagsWithHttpInfo(List<String> tags) throws ApiException {
|
||||||
Call call = findPetsByTagsCall(tags, null, null);
|
Call call = findPetsByTagsCall(tags, null, null);
|
||||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -445,14 +445,14 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
|
Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for getPetById */
|
/* Build call for getPetById */
|
||||||
private Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -461,26 +461,26 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -494,8 +494,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -519,8 +519,8 @@ public class PetApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
|
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
|
||||||
Call call = getPetByIdCall(petId, null, null);
|
Call call = getPetByIdCall(petId, null, null);
|
||||||
Type returnType = new TypeToken<Pet>(){}.getType();
|
Type localVarReturnType = new TypeToken<Pet>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -553,14 +553,14 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
|
Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<Pet>(){}.getType();
|
Type localVarReturnType = new TypeToken<Pet>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for updatePetWithForm */
|
/* Build call for updatePetWithForm */
|
||||||
private Call updatePetWithFormCall(String petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call updatePetWithFormCall(String petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -569,30 +569,30 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
if (name != null)
|
if (name != null)
|
||||||
formParams.put("name", name);
|
localVarFormParams.put("name", name);
|
||||||
if (status != null)
|
if (status != null)
|
||||||
formParams.put("status", status);
|
localVarFormParams.put("status", status);
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/x-www-form-urlencoded"
|
"application/x-www-form-urlencoded"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -606,8 +606,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -674,7 +674,7 @@ public class PetApi {
|
|||||||
|
|
||||||
/* Build call for deletePet */
|
/* Build call for deletePet */
|
||||||
private Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -683,28 +683,28 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
if (apiKey != null)
|
if (apiKey != null)
|
||||||
headerParams.put("api_key", apiClient.parameterToString(apiKey));
|
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -718,8 +718,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "DELETE", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -783,7 +783,7 @@ public class PetApi {
|
|||||||
|
|
||||||
/* Build call for uploadFile */
|
/* Build call for uploadFile */
|
||||||
private Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -792,30 +792,30 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
if (additionalMetadata != null)
|
if (additionalMetadata != null)
|
||||||
formParams.put("additionalMetadata", additionalMetadata);
|
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||||
if (file != null)
|
if (file != null)
|
||||||
formParams.put("file", file);
|
localVarFormParams.put("file", file);
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -829,8 +829,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -897,7 +897,7 @@ public class PetApi {
|
|||||||
|
|
||||||
/* Build call for petPetIdtestingByteArraytrueGet */
|
/* Build call for petPetIdtestingByteArraytrueGet */
|
||||||
private Call petPetIdtestingByteArraytrueGetCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call petPetIdtestingByteArraytrueGetCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
@ -906,26 +906,26 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -939,8 +939,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -964,8 +964,8 @@ public class PetApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<byte[]> petPetIdtestingByteArraytrueGetWithHttpInfo(Long petId) throws ApiException {
|
public ApiResponse<byte[]> petPetIdtestingByteArraytrueGetWithHttpInfo(Long petId) throws ApiException {
|
||||||
Call call = petPetIdtestingByteArraytrueGetCall(petId, null, null);
|
Call call = petPetIdtestingByteArraytrueGetCall(petId, null, null);
|
||||||
Type returnType = new TypeToken<byte[]>(){}.getType();
|
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -998,36 +998,36 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = petPetIdtestingByteArraytrueGetCall(petId, progressListener, progressRequestListener);
|
Call call = petPetIdtestingByteArraytrueGetCall(petId, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<byte[]>(){}.getType();
|
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for addPetUsingByteArray */
|
/* Build call for addPetUsingByteArray */
|
||||||
private Call addPetUsingByteArrayCall(byte[] body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call addPetUsingByteArrayCall(byte[] body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -1041,8 +1041,8 @@ public class PetApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,31 +45,33 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Build call for getInventory */
|
/* Build call for findOrdersByStatus */
|
||||||
private Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call findOrdersByStatusCall(String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
if (status != null)
|
||||||
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -83,8 +85,110 @@ public class StoreApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "api_key" };
|
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 List<Order>
|
||||||
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
|
*/
|
||||||
|
public List<Order> findOrdersByStatus(String status) throws ApiException {
|
||||||
|
ApiResponse<List<Order>> resp = findOrdersByStatusWithHttpInfo(status);
|
||||||
|
return resp.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 ApiResponse<List<Order>>
|
||||||
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
|
*/
|
||||||
|
public ApiResponse<List<Order>> findOrdersByStatusWithHttpInfo(String status) throws ApiException {
|
||||||
|
Call call = findOrdersByStatusCall(status, null, null);
|
||||||
|
Type localVarReturnType = new TypeToken<List<Order>>(){}.getType();
|
||||||
|
return apiClient.execute(call, localVarReturnType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds orders by status (asynchronously)
|
||||||
|
* A single status value can be provided as a string
|
||||||
|
* @param status Status value that needs to be considered for query
|
||||||
|
* @param callback The callback to be executed when the API call finishes
|
||||||
|
* @return The request call
|
||||||
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||||
|
*/
|
||||||
|
public Call findOrdersByStatusAsync(String status, final ApiCallback<List<Order>> callback) throws ApiException {
|
||||||
|
|
||||||
|
ProgressResponseBody.ProgressListener progressListener = null;
|
||||||
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||||
|
|
||||||
|
if (callback != null) {
|
||||||
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||||
|
@Override
|
||||||
|
public void update(long bytesRead, long contentLength, boolean done) {
|
||||||
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||||
|
@Override
|
||||||
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||||
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Call call = findOrdersByStatusCall(status, progressListener, progressRequestListener);
|
||||||
|
Type localVarReturnType = new TypeToken<List<Order>>(){}.getType();
|
||||||
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
|
return call;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build call for getInventory */
|
||||||
|
private Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
final String[] localVarAccepts = {
|
||||||
|
"application/json", "application/xml"
|
||||||
|
};
|
||||||
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
|
};
|
||||||
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
|
if(progressListener != null) {
|
||||||
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
|
@Override
|
||||||
|
public Response intercept(Interceptor.Chain chain) throws IOException {
|
||||||
|
Response originalResponse = chain.proceed(chain.request());
|
||||||
|
return originalResponse.newBuilder()
|
||||||
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] localVarAuthNames = new String[] { "api_key" };
|
||||||
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,8 +210,8 @@ public class StoreApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
|
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
|
||||||
Call call = getInventoryCall(null, null);
|
Call call = getInventoryCall(null, null);
|
||||||
Type returnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,36 +243,36 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = getInventoryCall(progressListener, progressRequestListener);
|
Call call = getInventoryCall(progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for placeOrder */
|
/* Build call for placeOrder */
|
||||||
private Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -182,8 +286,8 @@ public class StoreApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,8 +311,8 @@ public class StoreApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<Order> placeOrderWithHttpInfo(Order body) throws ApiException {
|
public ApiResponse<Order> placeOrderWithHttpInfo(Order body) throws ApiException {
|
||||||
Call call = placeOrderCall(body, null, null);
|
Call call = placeOrderCall(body, null, null);
|
||||||
Type returnType = new TypeToken<Order>(){}.getType();
|
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -241,14 +345,14 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = placeOrderCall(body, progressListener, progressRequestListener);
|
Call call = placeOrderCall(body, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<Order>(){}.getType();
|
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for getOrderById */
|
/* Build call for getOrderById */
|
||||||
private Call getOrderByIdCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call getOrderByIdCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -257,26 +361,26 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -290,8 +394,8 @@ public class StoreApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -315,8 +419,8 @@ public class StoreApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<Order> getOrderByIdWithHttpInfo(String orderId) throws ApiException {
|
public ApiResponse<Order> getOrderByIdWithHttpInfo(String orderId) throws ApiException {
|
||||||
Call call = getOrderByIdCall(orderId, null, null);
|
Call call = getOrderByIdCall(orderId, null, null);
|
||||||
Type returnType = new TypeToken<Order>(){}.getType();
|
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -349,14 +453,14 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
|
Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<Order>(){}.getType();
|
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for deleteOrder */
|
/* Build call for deleteOrder */
|
||||||
private Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
@ -365,26 +469,26 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -398,8 +502,8 @@ public class StoreApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "DELETE", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,29 +47,29 @@ public class UserApi {
|
|||||||
|
|
||||||
/* Build call for createUser */
|
/* Build call for createUser */
|
||||||
private Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -83,8 +83,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,29 +145,29 @@ public class UserApi {
|
|||||||
|
|
||||||
/* Build call for createUsersWithArrayInput */
|
/* Build call for createUsersWithArrayInput */
|
||||||
private Call createUsersWithArrayInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call createUsersWithArrayInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -181,8 +181,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -243,29 +243,29 @@ public class UserApi {
|
|||||||
|
|
||||||
/* Build call for createUsersWithListInput */
|
/* Build call for createUsersWithListInput */
|
||||||
private Call createUsersWithListInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call createUsersWithListInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -279,8 +279,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -341,33 +341,33 @@ public class UserApi {
|
|||||||
|
|
||||||
/* Build call for loginUser */
|
/* Build call for loginUser */
|
||||||
private Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
if (username != null)
|
if (username != null)
|
||||||
queryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||||
if (password != null)
|
if (password != null)
|
||||||
queryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -381,8 +381,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -408,8 +408,8 @@ public class UserApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
|
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
|
||||||
Call call = loginUserCall(username, password, null, null);
|
Call call = loginUserCall(username, password, null, null);
|
||||||
Type returnType = new TypeToken<String>(){}.getType();
|
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -443,36 +443,36 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = loginUserCall(username, password, progressListener, progressRequestListener);
|
Call call = loginUserCall(username, password, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<String>(){}.getType();
|
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for logoutUser */
|
/* Build call for logoutUser */
|
||||||
private Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -486,8 +486,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -545,7 +545,7 @@ public class UserApi {
|
|||||||
|
|
||||||
/* Build call for getUserByName */
|
/* Build call for getUserByName */
|
||||||
private Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -554,26 +554,26 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -587,8 +587,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -612,8 +612,8 @@ public class UserApi {
|
|||||||
*/
|
*/
|
||||||
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
|
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
|
||||||
Call call = getUserByNameCall(username, null, null);
|
Call call = getUserByNameCall(username, null, null);
|
||||||
Type returnType = new TypeToken<User>(){}.getType();
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
||||||
return apiClient.execute(call, returnType);
|
return apiClient.execute(call, localVarReturnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -646,14 +646,14 @@ public class UserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call call = getUserByNameCall(username, progressListener, progressRequestListener);
|
Call call = getUserByNameCall(username, progressListener, progressRequestListener);
|
||||||
Type returnType = new TypeToken<User>(){}.getType();
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
||||||
apiClient.executeAsync(call, returnType, callback);
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build call for updateUser */
|
/* Build call for updateUser */
|
||||||
private Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = body;
|
Object localVarPostBody = body;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -662,26 +662,26 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -695,8 +695,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "PUT", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -760,7 +760,7 @@ public class UserApi {
|
|||||||
|
|
||||||
/* Build call for deleteUser */
|
/* Build call for deleteUser */
|
||||||
private Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object postBody = null;
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
@ -769,26 +769,26 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String path = "/user/{username}".replaceAll("\\{format\\}","json")
|
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
|
||||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||||
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String[] accepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "application/xml"
|
"application/json", "application/xml"
|
||||||
};
|
};
|
||||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (accept != null) headerParams.put("Accept", accept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] contentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
headerParams.put("Content-Type", contentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||||
@ -802,8 +802,8 @@ public class UserApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(path, "DELETE", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,9 +90,8 @@ if(hasProperty('target') && target == 'android') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
okhttp_version = "3.0.1"
|
|
||||||
oltu_version = "1.0.0"
|
oltu_version = "1.0.0"
|
||||||
retrofit_version = "2.0.0-beta3"
|
retrofit_version = "2.0.0-beta4"
|
||||||
gson_version = "2.4"
|
gson_version = "2.4"
|
||||||
swagger_annotations_version = "1.5.0"
|
swagger_annotations_version = "1.5.0"
|
||||||
junit_version = "4.12"
|
junit_version = "4.12"
|
||||||
@ -100,13 +99,10 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
|
|
||||||
|
|
||||||
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||||
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||||
|
|
||||||
|
|
||||||
compile "com.google.code.gson:gson:$gson_version"
|
|
||||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
||||||
|
|
||||||
|
@ -123,21 +123,11 @@
|
|||||||
<artifactId>converter-gson</artifactId>
|
<artifactId>converter-gson</artifactId>
|
||||||
<version>${retrofit-version}</version>
|
<version>${retrofit-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
<version>${gson-version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.oltu.oauth2</groupId>
|
<groupId>org.apache.oltu.oauth2</groupId>
|
||||||
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
||||||
<version>${oltu-version}</version>
|
<version>${oltu-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
|
||||||
<artifactId>okhttp</artifactId>
|
|
||||||
<version>${okhttp-version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
@ -150,10 +140,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
||||||
<retrofit-version>2.0.0-beta3</retrofit-version>
|
<retrofit-version>2.0.0-beta4</retrofit-version>
|
||||||
|
|
||||||
<okhttp-version>3.0.1</okhttp-version>
|
|
||||||
<gson-version>2.4</gson-version>
|
|
||||||
<oltu-version>1.0.0</oltu-version>
|
<oltu-version>1.0.0</oltu-version>
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.12</junit-version>
|
<junit-version>4.12</junit-version>
|
||||||
|
@ -12,7 +12,7 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil
|
|||||||
|
|
||||||
import retrofit2.Converter;
|
import retrofit2.Converter;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.GsonConverterFactory;
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@ -46,10 +46,10 @@ public class ApiClient {
|
|||||||
this();
|
this();
|
||||||
for(String authName : authNames) {
|
for(String authName : authNames) {
|
||||||
Interceptor auth;
|
Interceptor auth;
|
||||||
if (authName == "petstore_auth") {
|
if (authName == "api_key") {
|
||||||
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
|
||||||
} else if (authName == "api_key") {
|
|
||||||
auth = new ApiKeyAuth("header", "api_key");
|
auth = new ApiKeyAuth("header", "api_key");
|
||||||
|
} else if (authName == "petstore_auth") {
|
||||||
|
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||||
}
|
}
|
||||||
@ -338,8 +338,8 @@ class GsonCustomConverterFactory extends Converter.Factory
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||||
return gsonConverterFactory.requestBodyConverter(type, annotations, retrofit);
|
return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-02T15:33:05.826+01:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-26T13:30:07.836+01:00")
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
/**
|
/**
|
||||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
@ -90,9 +90,8 @@ if(hasProperty('target') && target == 'android') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
okhttp_version = "3.0.1"
|
|
||||||
oltu_version = "1.0.0"
|
oltu_version = "1.0.0"
|
||||||
retrofit_version = "2.0.0-beta3"
|
retrofit_version = "2.0.0-beta4"
|
||||||
gson_version = "2.4"
|
gson_version = "2.4"
|
||||||
swagger_annotations_version = "1.5.0"
|
swagger_annotations_version = "1.5.0"
|
||||||
junit_version = "4.12"
|
junit_version = "4.12"
|
||||||
@ -101,15 +100,12 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
|
|
||||||
|
|
||||||
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||||
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||||
compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
|
compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
|
||||||
compile "io.reactivex:rxjava:$rx_java_version"
|
compile "io.reactivex:rxjava:$rx_java_version"
|
||||||
|
|
||||||
|
|
||||||
compile "com.google.code.gson:gson:$gson_version"
|
|
||||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
||||||
|
|
||||||
|
@ -123,21 +123,11 @@
|
|||||||
<artifactId>converter-gson</artifactId>
|
<artifactId>converter-gson</artifactId>
|
||||||
<version>${retrofit-version}</version>
|
<version>${retrofit-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
<version>${gson-version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.oltu.oauth2</groupId>
|
<groupId>org.apache.oltu.oauth2</groupId>
|
||||||
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
||||||
<version>${oltu-version}</version>
|
<version>${oltu-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
|
||||||
<artifactId>okhttp</artifactId>
|
|
||||||
<version>${okhttp-version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.reactivex</groupId>
|
<groupId>io.reactivex</groupId>
|
||||||
@ -161,10 +151,8 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
||||||
<retrofit-version>2.0.0-beta3</retrofit-version>
|
<retrofit-version>2.0.0-beta4</retrofit-version>
|
||||||
<rxjava-version>1.0.16</rxjava-version>
|
<rxjava-version>1.0.16</rxjava-version>
|
||||||
<okhttp-version>3.0.1</okhttp-version>
|
|
||||||
<gson-version>2.4</gson-version>
|
|
||||||
<oltu-version>1.0.0</oltu-version>
|
<oltu-version>1.0.0</oltu-version>
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.12</junit-version>
|
<junit-version>4.12</junit-version>
|
||||||
|
@ -12,8 +12,8 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil
|
|||||||
|
|
||||||
import retrofit2.Converter;
|
import retrofit2.Converter;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.GsonConverterFactory;
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
import retrofit2.RxJavaCallAdapterFactory;
|
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@ -46,10 +46,10 @@ public class ApiClient {
|
|||||||
this();
|
this();
|
||||||
for(String authName : authNames) {
|
for(String authName : authNames) {
|
||||||
Interceptor auth;
|
Interceptor auth;
|
||||||
if (authName == "petstore_auth") {
|
if (authName == "api_key") {
|
||||||
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
|
||||||
} else if (authName == "api_key") {
|
|
||||||
auth = new ApiKeyAuth("header", "api_key");
|
auth = new ApiKeyAuth("header", "api_key");
|
||||||
|
} else if (authName == "petstore_auth") {
|
||||||
|
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||||
}
|
}
|
||||||
@ -338,8 +338,8 @@ class GsonCustomConverterFactory extends Converter.Factory
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||||
return gsonConverterFactory.requestBodyConverter(type, annotations, retrofit);
|
return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-02T15:33:07.490+01:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-26T13:30:13.630+01:00")
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
/**
|
/**
|
||||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user