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)
|
||||
- [ThoughtWorks](https://www.thoughtworks.com)
|
||||
- [uShip](https://www.uship.com/)
|
||||
- [Zalando](https://tech.zalando.com)
|
||||
- [ZEEF.com](https://zeef.com/)
|
||||
|
||||
License
|
||||
|
@ -5,18 +5,11 @@ import io.airlift.airline.Option;
|
||||
import io.swagger.codegen.ClientOptInput;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.DefaultGenerator;
|
||||
import io.swagger.codegen.utils.OptionUtils;
|
||||
import io.swagger.codegen.config.CodegenConfigurator;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static io.swagger.codegen.config.CodegenConfiguratorUtils.*;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
/**
|
||||
@ -190,74 +183,15 @@ public class Generate implements Runnable {
|
||||
configurator.setLibrary(library);
|
||||
}
|
||||
|
||||
setSystemProperties(configurator);
|
||||
setInstantiationTypes(configurator);
|
||||
setImportMappings(configurator);
|
||||
setTypeMappings(configurator);
|
||||
setAdditionalProperties(configurator);
|
||||
setLanguageSpecificPrimitives(configurator);
|
||||
applySystemPropertiesKvp(systemProperties, configurator);
|
||||
applyInstantiationTypesKvp(instantiationTypes, configurator);
|
||||
applyImportMappingsKvp(importMappings, configurator);
|
||||
applyTypeMappingsKvp(typeMappings, configurator);
|
||||
applyAdditionalPropertiesKvp(additionalProperties, configurator);
|
||||
applyLanguageSpecificPrimitivesCsv(languageSpecificPrimitives, configurator);
|
||||
|
||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
import config.Config;
|
||||
import config.ConfigParser;
|
||||
import io.swagger.codegen.*;
|
||||
import io.swagger.codegen.utils.OptionUtils;
|
||||
import io.swagger.codegen.CliOption;
|
||||
import io.swagger.codegen.ClientOptInput;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.DefaultGenerator;
|
||||
import io.swagger.codegen.config.CodegenConfigurator;
|
||||
import io.swagger.models.Swagger;
|
||||
import io.swagger.parser.SwaggerParser;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
@ -33,17 +33,27 @@ import org.apache.maven.project.MavenProject;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.
|
||||
*/
|
||||
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
||||
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.
|
||||
*/
|
||||
@ -65,10 +75,23 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
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")
|
||||
private String modelPackage;
|
||||
@Parameter(name="auth")
|
||||
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
|
||||
@ -76,6 +99,12 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
@Parameter(name = "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
|
||||
*/
|
||||
@ -83,16 +112,22 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
private String invokerPackage;
|
||||
|
||||
/**
|
||||
* Client language to generate.
|
||||
* groupId in generated pom.xml
|
||||
*/
|
||||
@Parameter(name = "language", required = true)
|
||||
private String language;
|
||||
@Parameter(name = "groupId")
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* Path to separate json configuration file.
|
||||
* artifactId in generated pom.xml
|
||||
*/
|
||||
@Parameter(name = "configurationFile", required = false)
|
||||
private String configurationFile;
|
||||
@Parameter(name = "artifactId")
|
||||
private String artifactId;
|
||||
|
||||
/**
|
||||
* artifact version in generated pom.xml
|
||||
*/
|
||||
@Parameter(name = "artifactVersion")
|
||||
private String artifactVersion;
|
||||
|
||||
/**
|
||||
* Sets the library
|
||||
@ -127,12 +162,92 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException {
|
||||
|
||||
Swagger swagger = new SwaggerParser().read(inputSpec);
|
||||
|
||||
CodegenConfig config = CodegenConfigLoader.forName(language);
|
||||
config.setOutputDir(output.getAbsolutePath());
|
||||
//attempt to read from config file
|
||||
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) {
|
||||
|
||||
for(String key : environmentVariables.keySet()) {
|
||||
String value = environmentVariables.get(key);
|
||||
if(value == null) {
|
||||
@ -140,58 +255,21 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
value = "";
|
||||
}
|
||||
System.setProperty(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>();
|
||||
for (CliOption langCliOption : config.cliOptions()) {
|
||||
definedOptions.add(langCliOption.getOpt());
|
||||
}
|
||||
|
||||
if (configOptions != null) {
|
||||
if(configOptions.containsKey("import-mappings")) {
|
||||
Map<String, String> mappings = createMapFromKeyValuePairs(configOptions.remove("import-mappings").toString());
|
||||
config.importMapping().putAll(mappings);
|
||||
}
|
||||
|
||||
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");
|
||||
configurator.addSystemProperty(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
ClientOptInput input = new ClientOptInput().opts(new ClientOpts()).swagger(swagger);
|
||||
input.setConfig(config);
|
||||
final ClientOptInput input = configurator.toClientOptInput();
|
||||
final CodegenConfig config = input.getConfig();
|
||||
|
||||
if(configOptions != null) {
|
||||
for (CliOption langCliOption : config.cliOptions()) {
|
||||
if (configOptions.containsKey(langCliOption.getOpt())) {
|
||||
input.getConfig().additionalProperties().put(langCliOption.getOpt(),
|
||||
configOptions.get(langCliOption.getOpt()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(configHelp) {
|
||||
for (CliOption langCliOption : config.cliOptions()) {
|
||||
@ -215,25 +293,4 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
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(
|
||||
Arrays.asList(
|
||||
// local variable names used in API methods (endpoints)
|
||||
"postBody", "path", "queryParams", "headerParams", "formParams",
|
||||
"contentTypes", "contentType", "response", "builder", "httpEntity",
|
||||
"authNames", "basePath", "apiInvoker",
|
||||
"localVarPostBody", "localVarPath", "localVarQueryParams", "localVarHeaderParams",
|
||||
"localVarFormParams", "localVarContentTypes", "localVarContentType",
|
||||
"localVarResponse", "localVarBuilder", "authNames", "basePath", "apiInvoker",
|
||||
|
||||
// android reserved words
|
||||
"abstract", "continue", "for", "new", "switch", "assert",
|
||||
@ -68,10 +68,13 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
"Integer",
|
||||
"Long",
|
||||
"Float",
|
||||
"byte[]",
|
||||
"Object")
|
||||
);
|
||||
instantiationTypes.put("array", "ArrayList");
|
||||
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.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||
@ -141,8 +144,10 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
String type = null;
|
||||
if (typeMapping.containsKey(swaggerType)) {
|
||||
type = typeMapping.get(swaggerType);
|
||||
if (languageSpecificPrimitives.contains(type)) {
|
||||
return toModelName(type);
|
||||
if (languageSpecificPrimitives.contains(type) || type.indexOf(".") >= 0 ||
|
||||
type.equals("Map") || type.equals("List") ||
|
||||
type.equals("File") || type.equals("Date")) {
|
||||
return type;
|
||||
}
|
||||
} else {
|
||||
type = swaggerType;
|
||||
@ -182,7 +187,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
public String toModelName(String name) {
|
||||
// camelize the model name
|
||||
// phone_number => PhoneNumber
|
||||
name = camelize(sanitizeName(name));
|
||||
name = camelize(sanitizeName(modelNamePrefix + name + modelNameSuffix));
|
||||
|
||||
// model name cannot use reserved keyword, e.g. return
|
||||
if (isReservedWord(name)) {
|
||||
|
@ -55,8 +55,9 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
// used as internal variables, can collide with parameter names
|
||||
"path", "queryParams", "headerParams", "formParams", "postBody", "accepts", "accept", "contentTypes",
|
||||
"contentType", "authNames",
|
||||
"localVarPath", "localVarQueryParams", "localVarHeaderParams", "localVarFormParams",
|
||||
"localVarPostBody", "localVarAccepts", "localVarAccept", "localVarContentTypes",
|
||||
"localVarContentType", "localVarAuthNames", "localReturnType",
|
||||
|
||||
// language reserved words
|
||||
"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("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_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");
|
||||
library.setDefault(DEFAULT_LIBRARY);
|
||||
|
@ -55,9 +55,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
modelTestTemplateFiles.put("model_test.mustache", ".rb");
|
||||
apiTestTemplateFiles.put("api_test.mustache", ".rb");
|
||||
|
||||
typeMapping.clear();
|
||||
languageSpecificPrimitives.clear();
|
||||
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
// local variable names used in API methods (endpoints)
|
||||
@ -71,11 +68,24 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
"if", "not", "return", "undef", "yield")
|
||||
);
|
||||
|
||||
typeMapping.clear();
|
||||
languageSpecificPrimitives.clear();
|
||||
|
||||
// primitives in ruby lang
|
||||
languageSpecificPrimitives.add("int");
|
||||
languageSpecificPrimitives.add("array");
|
||||
languageSpecificPrimitives.add("map");
|
||||
languageSpecificPrimitives.add("string");
|
||||
// primitives in the typeMapping
|
||||
languageSpecificPrimitives.add("String");
|
||||
languageSpecificPrimitives.add("Integer");
|
||||
languageSpecificPrimitives.add("Float");
|
||||
languageSpecificPrimitives.add("Date");
|
||||
languageSpecificPrimitives.add("DateTime");
|
||||
languageSpecificPrimitives.add("BOOLEAN");
|
||||
languageSpecificPrimitives.add("Array");
|
||||
languageSpecificPrimitives.add("Hash");
|
||||
languageSpecificPrimitives.add("File");
|
||||
|
||||
typeMapping.put("string", "String");
|
||||
typeMapping.put("char", "String");
|
||||
@ -317,7 +327,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
String type = null;
|
||||
if (typeMapping.containsKey(swaggerType)) {
|
||||
type = typeMapping.get(swaggerType);
|
||||
if (languageSpecificPrimitives.contains(type)) {
|
||||
if (languageSpecificPrimitives.contains(type)) {
|
||||
return type;
|
||||
}
|
||||
} else {
|
||||
@ -333,7 +343,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public String toVarName(String name) {
|
||||
// sanitize name
|
||||
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||
|
||||
// if it's all uppper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
name = name.toLowerCase();
|
||||
@ -361,6 +370,14 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public String toModelName(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
|
||||
if (isReservedWord(name)) {
|
||||
String modelName = camelize("object_" + name);
|
||||
@ -375,6 +392,15 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
@Override
|
||||
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
|
||||
if (isReservedWord(name)) {
|
||||
String filename = underscore("object_" + name);
|
||||
@ -398,12 +424,12 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
@Override
|
||||
public String toApiTestFilename(String name) {
|
||||
return toApiName(name) + "_spec";
|
||||
return toApiFilename(name) + "_spec";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toModelTestFilename(String name) {
|
||||
return toModelName(name) + "_spec";
|
||||
return toModelFilename(name) + "_spec";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,7 +47,7 @@ public class {{classname}} {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
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}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
@ -55,43 +55,43 @@ public class {{classname}} {
|
||||
}
|
||||
{{/required}}{{/allParams}}
|
||||
// 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}};
|
||||
|
||||
// query params
|
||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}queryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}headerParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}formParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
||||
|
||||
{{#queryParams}}
|
||||
{{localVariablePrefix}}queryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||
{{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||
{{/queryParams}}
|
||||
|
||||
{{#headerParams}}if ({{paramName}} != null)
|
||||
{{localVariablePrefix}}headerParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
||||
{{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
||||
{{/headerParams}}
|
||||
|
||||
{{#formParams}}if ({{paramName}} != null)
|
||||
{{localVariablePrefix}}formParams.put("{{baseName}}", {{paramName}});
|
||||
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});
|
||||
{{/formParams}}
|
||||
|
||||
final String[] {{localVariablePrefix}}accepts = {
|
||||
final String[] {{localVariablePrefix}}localVarAccepts = {
|
||||
{{#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}}
|
||||
};
|
||||
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}}
|
||||
GenericType<{{{returnType}}}> {{localVariablePrefix}}returnType = 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);
|
||||
GenericType<{{{returnType}}}> {{localVariablePrefix}}localVarReturnType = new GenericType<{{{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}}
|
||||
{{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}}
|
||||
}
|
||||
{{/operation}}
|
||||
|
@ -47,7 +47,7 @@ public class {{classname}} {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
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}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
@ -55,43 +55,43 @@ public class {{classname}} {
|
||||
}
|
||||
{{/required}}{{/allParams}}
|
||||
// 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}};
|
||||
|
||||
// query params
|
||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}queryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}headerParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}formParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();
|
||||
|
||||
{{#queryParams}}
|
||||
{{localVariablePrefix}}queryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||
{{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||
{{/queryParams}}
|
||||
|
||||
{{#headerParams}}if ({{paramName}} != null)
|
||||
{{localVariablePrefix}}headerParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
||||
{{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));
|
||||
{{/headerParams}}
|
||||
|
||||
{{#formParams}}if ({{paramName}} != null)
|
||||
{{localVariablePrefix}}formParams.put("{{baseName}}", {{paramName}});
|
||||
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});
|
||||
{{/formParams}}
|
||||
|
||||
final String[] {{localVariablePrefix}}accepts = {
|
||||
final String[] {{localVariablePrefix}}localVarAccepts = {
|
||||
{{#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}}
|
||||
};
|
||||
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}}
|
||||
GenericType<{{{returnType}}}> {{localVariablePrefix}}returnType = 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);
|
||||
GenericType<{{{returnType}}}> {{localVariablePrefix}}localVarReturnType = new GenericType<{{{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}}
|
||||
{{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}}
|
||||
}
|
||||
{{/operation}}
|
||||
|
@ -51,7 +51,7 @@ public class {{classname}} {
|
||||
{{#operation}}
|
||||
/* Build call for {{operationId}} */
|
||||
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}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
@ -60,32 +60,32 @@ public class {{classname}} {
|
||||
{{/required}}{{/allParams}}
|
||||
|
||||
// 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}};
|
||||
|
||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}queryParams = new {{javaUtilPrefix}}ArrayList<Pair>();{{#queryParams}}
|
||||
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();{{#queryParams}}
|
||||
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)
|
||||
{{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)
|
||||
{{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}}
|
||||
};
|
||||
final String {{localVariablePrefix}}accept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}accepts);
|
||||
if ({{localVariablePrefix}}accept != null) {{localVariablePrefix}}headerParams.put("Accept", {{localVariablePrefix}}accept);
|
||||
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
|
||||
if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept);
|
||||
|
||||
final String[] {{localVariablePrefix}}contentTypes = {
|
||||
final String[] {{localVariablePrefix}}localVarContentTypes = {
|
||||
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||
};
|
||||
final String {{localVariablePrefix}}contentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}contentTypes);
|
||||
{{localVariablePrefix}}headerParams.put("Content-Type", {{localVariablePrefix}}contentType);
|
||||
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
|
||||
{{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -99,8 +99,8 @@ public class {{classname}} {
|
||||
});
|
||||
}
|
||||
|
||||
String[] {{localVariablePrefix}}authNames = 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);
|
||||
String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
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 {
|
||||
Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}null, null);
|
||||
{{#returnType}}Type {{localVariablePrefix}}returnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||
return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}returnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}}
|
||||
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||
return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -146,7 +146,7 @@ public class {{classname}} {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -158,8 +158,8 @@ public class {{classname}} {
|
||||
}
|
||||
|
||||
Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener);
|
||||
{{#returnType}}Type {{localVariablePrefix}}returnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||
{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}returnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}}
|
||||
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||
{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}}
|
||||
return {{localVariablePrefix}}call;
|
||||
}
|
||||
{{/operation}}
|
||||
|
@ -12,8 +12,8 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil
|
||||
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.GsonConverterFactory;
|
||||
{{#useRxJava}}import retrofit2.RxJavaCallAdapterFactory;{{/useRxJava}}
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
{{#useRxJava}}import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;{{/useRxJava}}
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
@ -103,14 +103,14 @@ public class ApiClient {
|
||||
.setUsername(username)
|
||||
.setPassword(password);
|
||||
}
|
||||
|
||||
|
||||
public void createDefaultAdapter() {
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
|
||||
.create();
|
||||
|
||||
okClient = new OkHttpClient();
|
||||
|
||||
|
||||
String baseUrl = "{{basePath}}";
|
||||
if(!baseUrl.endsWith("/"))
|
||||
baseUrl = baseUrl + "/";
|
||||
@ -125,7 +125,7 @@ public class ApiClient {
|
||||
|
||||
public <S> S createService(Class<S> serviceClass) {
|
||||
return adapterBuilder.build().create(serviceClass);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,7 +203,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper method to configure the oauth accessCode/implicit flow parameters
|
||||
* @param clientId
|
||||
@ -225,7 +225,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configures a listener which is notified when a new access token is received.
|
||||
* @param accessTokenListener
|
||||
@ -272,7 +272,7 @@ public class ApiClient {
|
||||
public OkHttpClient getOkClient() {
|
||||
return okClient;
|
||||
}
|
||||
|
||||
|
||||
public void addAuthsToOkClient(OkHttpClient okClient) {
|
||||
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
|
||||
okClient.interceptors().add(apiAuthorization);
|
||||
@ -308,14 +308,14 @@ class GsonResponseBodyConverterToString<T> implements Converter<ResponseBody, T>
|
||||
String returned = value.string();
|
||||
try {
|
||||
return gson.fromJson(returned, type);
|
||||
}
|
||||
}
|
||||
catch (JsonParseException e) {
|
||||
return (T) returned;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GsonCustomConverterFactory extends Converter.Factory
|
||||
class GsonCustomConverterFactory extends Converter.Factory
|
||||
{
|
||||
public static GsonCustomConverterFactory create(Gson gson) {
|
||||
return new GsonCustomConverterFactory(gson);
|
||||
@ -339,8 +339,8 @@ class GsonCustomConverterFactory extends Converter.Factory
|
||||
}
|
||||
|
||||
@Override
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
||||
return gsonConverterFactory.requestBodyConverter(type, annotations, retrofit);
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||
return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,18 +4,18 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class CollectionFormats {
|
||||
|
||||
|
||||
public static class CSVParams {
|
||||
|
||||
protected List<String> params;
|
||||
|
||||
|
||||
public CSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public CSVParams(List<String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
public CSVParams(String... params) {
|
||||
this.params = Arrays.asList(params);
|
||||
}
|
||||
@ -27,19 +27,19 @@ public class CollectionFormats {
|
||||
public void setParams(List<String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return StringUtil.join(params.toArray(new String[0]), ",");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class SSVParams extends CSVParams {
|
||||
|
||||
|
||||
public SSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public SSVParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
@ -53,16 +53,16 @@ public class CollectionFormats {
|
||||
return StringUtil.join(params.toArray(new String[0]), " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class TSVParams extends CSVParams {
|
||||
|
||||
|
||||
public TSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public TSVParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
|
||||
public TSVParams(String... params) {
|
||||
super(params);
|
||||
}
|
||||
@ -72,16 +72,16 @@ public class CollectionFormats {
|
||||
return StringUtil.join( params.toArray(new String[0]), "\t");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class PIPESParams extends CSVParams {
|
||||
|
||||
|
||||
public PIPESParams() {
|
||||
}
|
||||
|
||||
|
||||
public PIPESParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
|
||||
public PIPESParams(String... params) {
|
||||
super(params);
|
||||
}
|
||||
@ -91,5 +91,5 @@ public class CollectionFormats {
|
||||
return StringUtil.join(params.toArray(new String[0]), "|");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -90,9 +90,8 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
okhttp_version = "3.0.1"
|
||||
oltu_version = "1.0.0"
|
||||
retrofit_version = "2.0.0-beta3"
|
||||
retrofit_version = "2.0.0-beta4"
|
||||
gson_version = "2.4"
|
||||
swagger_annotations_version = "1.5.0"
|
||||
junit_version = "4.12"
|
||||
@ -103,8 +102,6 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
|
||||
|
||||
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||
{{#useRxJava}}
|
||||
@ -113,7 +110,6 @@ dependencies {
|
||||
{{/useRxJava}}
|
||||
{{^useRxJava}}{{/useRxJava}}
|
||||
|
||||
compile "com.google.code.gson:gson:$gson_version"
|
||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
||||
|
||||
|
@ -161,7 +161,7 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<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}}
|
||||
<okhttp-version>3.0.1</okhttp-version>
|
||||
<gson-version>2.4</gson-version>
|
||||
|
@ -11,7 +11,6 @@ import java.util.*;
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
@ -47,7 +46,7 @@ public class {{classname}} {
|
||||
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||
*/
|
||||
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}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
@ -56,53 +55,52 @@ public class {{classname}} {
|
||||
{{/required}}{{/allParams}}
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||
|
||||
{{#queryParams}}
|
||||
queryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));
|
||||
{{/queryParams}}
|
||||
|
||||
{{#headerParams}}
|
||||
headerParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));
|
||||
localVarHeaderParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));
|
||||
{{/headerParams}}
|
||||
|
||||
String[] contentTypes = {
|
||||
String[] localVarContentTypes = {
|
||||
{{#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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
{{#formParams}}{{#notFile}}
|
||||
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}}
|
||||
if ({{paramName}} != null) {
|
||||
builder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||
localVarBuilder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||
}
|
||||
{{/isFile}}{{/formParams}}
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
{{#formParams}}{{#notFile}}formParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));{{/notFile}}
|
||||
{{#formParams}}{{#notFile}}localVarFormParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}}));{{/notFile}}
|
||||
{{/formParams}}
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(response, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(localVarResponse, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
||||
}
|
||||
else {
|
||||
return {{#returnType}}null{{/returnType}};
|
||||
|
@ -87,18 +87,18 @@ public class {{classname}} {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
{{#formParams}}{{#notFile}}
|
||||
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}}
|
||||
if ({{paramName}} != null) {
|
||||
builder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||
localVarBuilder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||
}
|
||||
{{/isFile}}{{/formParams}}
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -109,9 +109,9 @@ public class {{classname}} {
|
||||
String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI (basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(response != null){
|
||||
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(response, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||
if(localVarResponse != null){
|
||||
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(localVarResponse, "{{returnContainer}}", {{returnBaseType}}.class){{/returnType}};
|
||||
} else {
|
||||
return {{#returnType}}null{{/returnType}};
|
||||
}
|
||||
@ -170,18 +170,18 @@ public class {{classname}} {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
{{#formParams}}{{#notFile}}
|
||||
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}}
|
||||
if ({{paramName}} != null) {
|
||||
builder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||
localVarBuilder.addBinaryBody("{{baseName}}", {{paramName}});
|
||||
}
|
||||
{{/isFile}}{{/formParams}}
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -195,13 +195,13 @@ public class {{classname}} {
|
||||
apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
{{#returnType}}
|
||||
try {
|
||||
responseListener.onResponse(({{{returnType}}}) ApiInvoker.deserialize(response, "{{returnContainer}}", {{returnBaseType}}.class));
|
||||
responseListener.onResponse(({{{returnType}}}) ApiInvoker.deserialize(localVarResponse, "{{returnContainer}}", {{returnBaseType}}.class));
|
||||
{{/returnType}}
|
||||
{{^returnType}}
|
||||
responseListener.onResponse(response);
|
||||
responseListener.onResponse(localVarResponse);
|
||||
{{/returnType}}
|
||||
{{#returnType}}
|
||||
} catch (ApiException exception) {
|
||||
|
@ -74,7 +74,7 @@ dependencies {
|
||||
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
||||
testCompile "junit:junit:$junit_version"
|
||||
testCompile "org.robolectric:robolectric:${robolectric_version}"
|
||||
testCompile "net.jodah:concurrentunit:${concurrentunitVersion}"
|
||||
testCompile "net.jodah:concurrentunit:${concurrent_unit_version}"
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
@ -35,6 +35,10 @@ public class JsonUtil {
|
||||
public static Type getListTypeForDeserialization(Class cls) {
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
}
|
||||
@ -43,16 +47,12 @@ public class JsonUtil {
|
||||
return new TypeToken<List<Category>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Tag>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken<List<Object>>(){}.getType();
|
||||
@ -61,6 +61,10 @@ public class JsonUtil {
|
||||
public static Type getTypeForDeserialization(Class cls) {
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<User>(){}.getType();
|
||||
}
|
||||
@ -69,16 +73,12 @@ public class JsonUtil {
|
||||
return new TypeToken<Category>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Pet>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Tag>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Pet>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken<Object>(){}.getType();
|
||||
|
@ -11,7 +11,6 @@ import java.util.*;
|
||||
import io.swagger.client.model.Pet;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
@ -46,43 +45,42 @@ public class PetApi {
|
||||
* @return void
|
||||
*/
|
||||
public void updatePet (Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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"
|
||||
};
|
||||
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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -100,43 +98,42 @@ public class PetApi {
|
||||
* @return void
|
||||
*/
|
||||
public void addPet (Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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"
|
||||
};
|
||||
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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -149,51 +146,50 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @return List<Pet>
|
||||
*/
|
||||
public List<Pet> findPetsByStatus (List<String> status) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "array", Pet.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(localVarResponse, "array", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -210,46 +206,45 @@ public class PetApi {
|
||||
* @return List<Pet>
|
||||
*/
|
||||
public List<Pet> findPetsByTags (List<String> tags) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "array", Pet.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(localVarResponse, "array", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -266,7 +261,7 @@ public class PetApi {
|
||||
* @return Pet
|
||||
*/
|
||||
public Pet getPetById (Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -275,40 +270,39 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (Pet) ApiInvoker.deserialize(response, "", Pet.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -327,7 +321,7 @@ public class PetApi {
|
||||
* @return void
|
||||
*/
|
||||
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -336,49 +330,48 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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"
|
||||
};
|
||||
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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
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) {
|
||||
builder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||
localVarBuilder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8);
|
||||
}
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
formParams.put("name", ApiInvoker.parameterToString(name));
|
||||
formParams.put("status", ApiInvoker.parameterToString(status));
|
||||
localVarFormParams.put("name", ApiInvoker.parameterToString(name));
|
||||
localVarFormParams.put("status", ApiInvoker.parameterToString(status));
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -397,7 +390,7 @@ public class PetApi {
|
||||
* @return void
|
||||
*/
|
||||
public void deletePet (Long petId, String apiKey) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -406,41 +399,40 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -460,7 +452,7 @@ public class PetApi {
|
||||
* @return void
|
||||
*/
|
||||
public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -469,49 +461,159 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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"
|
||||
};
|
||||
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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
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) {
|
||||
builder.addBinaryBody("file", file);
|
||||
localVarBuilder.addBinaryBody("file", file);
|
||||
}
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata));
|
||||
localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata));
|
||||
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
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 ;
|
||||
}
|
||||
else {
|
||||
|
@ -8,10 +8,9 @@ import io.swagger.client.model.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.client.model.Order;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
@ -40,49 +39,103 @@ public class StoreApi {
|
||||
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return Map<String, Integer>
|
||||
* 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 Map<String, Integer> getInventory () throws ApiException {
|
||||
Object postBody = null;
|
||||
public List<Order> findOrdersByStatus (String status) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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[] 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (Map<String, Integer>) ApiInvoker.deserialize(response, "map", Map.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
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 {
|
||||
return null;
|
||||
@ -99,44 +152,43 @@ public class StoreApi {
|
||||
* @return Order
|
||||
*/
|
||||
public Order placeOrder (Order body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (Order) ApiInvoker.deserialize(response, "", Order.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -153,7 +205,7 @@ public class StoreApi {
|
||||
* @return Order
|
||||
*/
|
||||
public Order getOrderById (String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@ -162,40 +214,39 @@ public class StoreApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (Order) ApiInvoker.deserialize(response, "", Order.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -212,7 +263,7 @@ public class StoreApi {
|
||||
* @return void
|
||||
*/
|
||||
public void deleteOrder (String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@ -221,39 +272,38 @@ public class StoreApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
|
@ -11,7 +11,6 @@ import java.util.*;
|
||||
import io.swagger.client.model.User;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
@ -46,43 +45,42 @@ public class UserApi {
|
||||
* @return void
|
||||
*/
|
||||
public void createUser (User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -100,43 +98,42 @@ public class UserApi {
|
||||
* @return void
|
||||
*/
|
||||
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -154,43 +151,42 @@ public class UserApi {
|
||||
* @return void
|
||||
*/
|
||||
public void createUsersWithListInput (List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -209,48 +205,47 @@ public class UserApi {
|
||||
* @return String
|
||||
*/
|
||||
public String loginUser (String username, String password) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (String) ApiInvoker.deserialize(response, "", String.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (String) ApiInvoker.deserialize(localVarResponse, "", String.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -266,43 +261,42 @@ public class UserApi {
|
||||
* @return void
|
||||
*/
|
||||
public void logoutUser () throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -320,7 +314,7 @@ public class UserApi {
|
||||
* @return User
|
||||
*/
|
||||
public User getUserByName (String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -329,40 +323,39 @@ public class UserApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (User) ApiInvoker.deserialize(response, "", User.class);
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return (User) ApiInvoker.deserialize(localVarResponse, "", User.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@ -380,7 +373,7 @@ public class UserApi {
|
||||
* @return void
|
||||
*/
|
||||
public void updateUser (String username, User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -389,39 +382,38 @@ public class UserApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
@ -439,7 +431,7 @@ public class UserApi {
|
||||
* @return void
|
||||
*/
|
||||
public void deleteUser (String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -448,39 +440,38 @@ public class UserApi {
|
||||
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
// header params
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
// 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
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
postBody = httpEntity;
|
||||
localVarPostBody = localVarBuilder.build();
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
||||
if(localVarResponse != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
|
@ -24,11 +24,11 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion '22.0.0'
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion '23.0.2'
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 22
|
||||
targetSdkVersion 23
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
@ -45,6 +45,10 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests.returnDefaultValues = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,6 +58,8 @@ ext {
|
||||
httpclient_version = "4.3.3"
|
||||
volley_version = "1.0.19"
|
||||
junit_version = "4.8.1"
|
||||
robolectric_version = "3.0"
|
||||
concurrent_unit_version = "0.4.2"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -63,6 +69,8 @@ dependencies {
|
||||
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
|
||||
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
||||
testCompile "junit:junit:$junit_version"
|
||||
testCompile "org.robolectric:robolectric:${robolectric_version}"
|
||||
testCompile "net.jodah:concurrentunit:${concurrent_unit_version}"
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
@ -1,10 +1,16 @@
|
||||
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.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 org.apache.http.Consts;
|
||||
@ -22,6 +28,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.ApiKeyAuth;
|
||||
@ -36,11 +45,12 @@ public class ApiInvoker {
|
||||
private static ApiInvoker INSTANCE;
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
|
||||
private Context context;
|
||||
private RequestQueue mRequestQueue;
|
||||
|
||||
private Map<String, Authentication> authentications;
|
||||
|
||||
private int connectionTimeout;
|
||||
|
||||
/** Content type "text/plain" with UTF-8 encoding. */
|
||||
public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8);
|
||||
|
||||
@ -165,8 +175,16 @@ public class ApiInvoker {
|
||||
return params;
|
||||
}
|
||||
|
||||
public static void initializeInstance(Context context) {
|
||||
INSTANCE = new ApiInvoker(context);
|
||||
public static void initializeInstance() {
|
||||
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");
|
||||
|
||||
// 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("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.
|
||||
INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
|
||||
}
|
||||
private ApiInvoker(Context context) {
|
||||
this.context = context;
|
||||
initConnectionManager();
|
||||
}
|
||||
|
||||
public ApiInvoker() {
|
||||
initConnectionManager();
|
||||
private ApiInvoker(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
|
||||
if(cache == null) cache = new NoCache();
|
||||
if(network == null) {
|
||||
HttpStack stack = new HurlStack();
|
||||
network = new BasicNetwork(stack);
|
||||
}
|
||||
|
||||
if(delivery == null) {
|
||||
initConnectionRequest(cache, network);
|
||||
} else {
|
||||
initConnectionRequest(cache, network, threadPoolSize, delivery);
|
||||
}
|
||||
this.connectionTimeout = connectionTimeout;
|
||||
}
|
||||
|
||||
public static ApiInvoker getInstance() {
|
||||
@ -305,6 +358,14 @@ public class ApiInvoker {
|
||||
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.
|
||||
*
|
||||
@ -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 {
|
||||
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();
|
||||
b.append("?");
|
||||
|
||||
@ -375,13 +450,13 @@ public class ApiInvoker {
|
||||
}
|
||||
formParamStr = formParamBuilder.toString();
|
||||
}
|
||||
Request request = null;
|
||||
|
||||
if ("GET".equals(method)) {
|
||||
GetRequest request = new GetRequest(url, headers, null, stringRequest, errorListener);
|
||||
mRequestQueue.add(request);
|
||||
request = new GetRequest(url, headers, null, stringRequest, errorListener);
|
||||
}
|
||||
else if ("POST".equals(method)) {
|
||||
PostRequest request = null;
|
||||
request = null;
|
||||
if (formParamStr != null) {
|
||||
request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||
} else if (body != null) {
|
||||
@ -390,11 +465,12 @@ public class ApiInvoker {
|
||||
} else {
|
||||
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)) {
|
||||
PutRequest request = null;
|
||||
request = null;
|
||||
if (formParamStr != null) {
|
||||
request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||
} else if (body != null) {
|
||||
@ -403,11 +479,12 @@ public class ApiInvoker {
|
||||
} else {
|
||||
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)) {
|
||||
DeleteRequest request = null;
|
||||
request = null;
|
||||
if (formParamStr != null) {
|
||||
request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||
} else if (body != null) {
|
||||
@ -416,11 +493,12 @@ public class ApiInvoker {
|
||||
} else {
|
||||
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)) {
|
||||
PatchRequest request = null;
|
||||
request = null;
|
||||
if (formParamStr != null) {
|
||||
request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener);
|
||||
} else if (body != null) {
|
||||
@ -429,12 +507,24 @@ public class ApiInvoker {
|
||||
} else {
|
||||
request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener);
|
||||
}
|
||||
}
|
||||
if(request != null) mRequestQueue.add(request);
|
||||
} else {
|
||||
request = new PatchRequest(url, headers, null, null, stringRequest, errorListener);
|
||||
}
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
private void initConnectionManager() {
|
||||
mRequestQueue = Volley.newRequestQueue(context);
|
||||
private void initConnectionRequest(Cache cache, Network network) {
|
||||
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) {
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
}
|
||||
@ -43,16 +47,12 @@ public class JsonUtil {
|
||||
return new TypeToken<List<Category>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Tag>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken<List<Object>>(){}.getType();
|
||||
@ -61,6 +61,10 @@ public class JsonUtil {
|
||||
public static Type getTypeForDeserialization(Class cls) {
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
}
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<User>(){}.getType();
|
||||
}
|
||||
@ -69,16 +73,12 @@ public class JsonUtil {
|
||||
return new TypeToken<Category>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Pet>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Tag>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken<Pet>(){}.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;
|
||||
|
||||
import io.swagger.client.Responses;
|
||||
import io.swagger.client.ApiInvoker;
|
||||
import io.swagger.client.ApiException;
|
||||
import io.swagger.client.Pair;
|
||||
@ -12,15 +11,18 @@ import java.util.*;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.client.model.Order;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
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 {
|
||||
String basePath = "http://petstore.swagger.io/v2";
|
||||
@ -44,11 +46,212 @@ 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 a map of status codes to quantities
|
||||
* @return Map<String, Integer>
|
||||
*/
|
||||
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
|
||||
* @return Map<String, Integer>
|
||||
*/
|
||||
public void getInventory (final Responses.MapResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
|
||||
*/
|
||||
public void getInventory (final Response.Listener<Map<String, Integer>> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
@ -74,10 +277,10 @@ public class StoreApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -90,10 +293,10 @@ public class StoreApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((Map<String, Integer>) ApiInvoker.deserialize(response, "map", Map.class));
|
||||
responseListener.onResponse((Map<String, Integer>) ApiInvoker.deserialize(localVarResponse, "map", Map.class));
|
||||
|
||||
|
||||
|
||||
@ -114,12 +317,75 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @return Order
|
||||
*/
|
||||
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
|
||||
* @return Order
|
||||
*/
|
||||
public void placeOrder (Order body, final Responses.OrderResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void placeOrder (Order body, final Response.Listener<Order> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = body;
|
||||
|
||||
|
||||
@ -145,26 +411,26 @@ public class StoreApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((Order) ApiInvoker.deserialize(response, "", Order.class));
|
||||
responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class));
|
||||
|
||||
|
||||
|
||||
@ -185,12 +451,81 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
*/
|
||||
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
|
||||
* @return Order
|
||||
*/
|
||||
public void getOrderById (String orderId, final Responses.OrderResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void getOrderById (String orderId, final Response.Listener<Order> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
@ -222,26 +557,26 @@ public class StoreApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||
|
||||
try {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((Order) ApiInvoker.deserialize(response, "", Order.class));
|
||||
responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class));
|
||||
|
||||
|
||||
|
||||
@ -262,12 +597,81 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
public void deleteOrder (String orderId) throws 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
|
||||
* @return void
|
||||
*/
|
||||
public void deleteOrder (String orderId, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void deleteOrder (String orderId, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
@ -299,10 +703,10 @@ public class StoreApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -315,10 +719,10 @@ public class StoreApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@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;
|
||||
|
||||
import io.swagger.client.Responses;
|
||||
import io.swagger.client.ApiInvoker;
|
||||
import io.swagger.client.ApiException;
|
||||
import io.swagger.client.Pair;
|
||||
@ -18,9 +17,12 @@ import java.util.*;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
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 {
|
||||
String basePath = "http://petstore.swagger.io/v2";
|
||||
@ -44,12 +46,75 @@ public class UserApi {
|
||||
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
* @return void
|
||||
*/
|
||||
public void createUser (User body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void createUser (User body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = body;
|
||||
|
||||
|
||||
@ -75,10 +140,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -91,10 +156,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(response);
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
@ -110,12 +175,75 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
* @return void
|
||||
*/
|
||||
public void createUsersWithArrayInput (List<User> body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void createUsersWithArrayInput (List<User> body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = body;
|
||||
|
||||
|
||||
@ -141,10 +269,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -157,10 +285,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(response);
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
@ -176,12 +304,75 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
* @return void
|
||||
*/
|
||||
public void createUsersWithListInput (List<User> body, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void createUsersWithListInput (List<User> body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = body;
|
||||
|
||||
|
||||
@ -207,10 +398,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -223,10 +414,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(response);
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
@ -242,13 +433,80 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @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;
|
||||
|
||||
|
||||
@ -278,10 +536,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -294,10 +552,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((String) ApiInvoker.deserialize(response, "", String.class));
|
||||
responseListener.onResponse((String) ApiInvoker.deserialize(localVarResponse, "", String.class));
|
||||
|
||||
|
||||
|
||||
@ -318,11 +576,74 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public void logoutUser (final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
|
||||
*/
|
||||
public void logoutUser (final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
@ -348,10 +669,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -364,10 +685,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(response);
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
@ -383,12 +704,81 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
*/
|
||||
public User getUserByName (String username) throws 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.
|
||||
* @return User
|
||||
*/
|
||||
public void getUserByName (String username, final Responses.UserResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void getUserByName (String username, final Response.Listener<User> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
@ -420,10 +810,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -436,10 +826,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
try {
|
||||
responseListener.onResponse((User) ApiInvoker.deserialize(response, "", User.class));
|
||||
responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class));
|
||||
|
||||
|
||||
|
||||
@ -460,13 +850,82 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* 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
|
||||
* @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;
|
||||
|
||||
|
||||
@ -498,10 +957,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -514,10 +973,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
public void onResponse(String localVarResponse) {
|
||||
|
||||
|
||||
responseListener.onResponse(response);
|
||||
responseListener.onResponse(localVarResponse);
|
||||
|
||||
|
||||
}
|
||||
@ -533,12 +992,81 @@ public class UserApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
public void deleteUser (String username) throws 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
|
||||
* @return void
|
||||
*/
|
||||
public void deleteUser (String username, final Responses.StringResponse responseListener, final Response.ErrorListener errorListener) {
|
||||
*/
|
||||
public void deleteUser (String username, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
||||
Object postBody = null;
|
||||
|
||||
|
||||
@ -570,10 +1098,10 @@ public class UserApi {
|
||||
|
||||
if (contentType.startsWith("multipart/form-data")) {
|
||||
// file uploading
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
||||
|
||||
|
||||
HttpEntity httpEntity = builder.build();
|
||||
HttpEntity httpEntity = localVarBuilder.build();
|
||||
postBody = httpEntity;
|
||||
} else {
|
||||
// normal form params
|
||||
@ -586,10 +1114,10 @@ public class UserApi {
|
||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||
new Response.Listener<String>() {
|
||||
@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
|
||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||
String value;
|
||||
if (apiKey == null) {
|
||||
return;
|
||||
}
|
||||
if (apiKeyPrefix != null) {
|
||||
value = apiKeyPrefix + " " + apiKey;
|
||||
} else {
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
(defn find-pets-by-status-with-http-info
|
||||
"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))
|
||||
([{:keys [status ]}]
|
||||
(call-api "/pet/findByStatus" :get
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
(defn find-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))
|
||||
([optional-params]
|
||||
(:data (find-pets-by-status-with-http-info optional-params))))
|
||||
@ -99,7 +99,7 @@
|
||||
:form-params {}
|
||||
:content-types []
|
||||
:accepts ["application/json" "application/xml"]
|
||||
:auth-names ["api_key"]}))
|
||||
:auth-names ["petstore_auth" "api_key"]}))
|
||||
|
||||
(defn get-pet-by-id
|
||||
"Find pet by ID
|
||||
@ -169,3 +169,44 @@
|
||||
([pet-id ] (upload-file pet-id nil))
|
||||
([pet-id optional-params]
|
||||
(:data (upload-file-with-http-info pet-id optional-params))))
|
||||
|
||||
(defn pet-pet-idtesting-byte-arraytrue-get-with-http-info
|
||||
"Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||
[pet-id ]
|
||||
(call-api "/pet/{petId}?testing_byte_array=true" :get
|
||||
{:path-params {"petId" pet-id }
|
||||
:header-params {}
|
||||
:query-params {}
|
||||
:form-params {}
|
||||
:content-types []
|
||||
:accepts ["application/json" "application/xml"]
|
||||
:auth-names ["petstore_auth" "api_key"]}))
|
||||
|
||||
(defn pet-pet-idtesting-byte-arraytrue-get
|
||||
"Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
|
||||
[pet-id ]
|
||||
(:data (pet-pet-idtesting-byte-arraytrue-get-with-http-info pet-id)))
|
||||
|
||||
(defn add-pet-using-byte-array-with-http-info
|
||||
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
"
|
||||
([] (add-pet-using-byte-array-with-http-info nil))
|
||||
([{:keys [body ]}]
|
||||
(call-api "/pet?testing_byte_array=true" :post
|
||||
{:path-params {}
|
||||
:header-params {}
|
||||
:query-params {}
|
||||
:form-params {}
|
||||
:body-param body
|
||||
:content-types ["application/json" "application/xml"]
|
||||
:accepts ["application/json" "application/xml"]
|
||||
:auth-names ["petstore_auth"]})))
|
||||
|
||||
(defn add-pet-using-byte-array
|
||||
"Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
"
|
||||
([] (add-pet-using-byte-array nil))
|
||||
([optional-params]
|
||||
(:data (add-pet-using-byte-array-with-http-info optional-params))))
|
||||
|
@ -2,6 +2,27 @@
|
||||
(:require [swagger-petstore.core :refer [call-api check-required-params with-collection-format]])
|
||||
(: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
|
||||
"Returns pet inventories by status
|
||||
Returns a map of status codes to quantities"
|
||||
@ -34,7 +55,7 @@
|
||||
:body-param body
|
||||
:content-types []
|
||||
:accepts ["application/json" "application/xml"]
|
||||
:auth-names []})))
|
||||
:auth-names ["test_api_client_id" "test_api_client_secret"]})))
|
||||
|
||||
(defn place-order
|
||||
"Place an order for a pet
|
||||
@ -54,7 +75,7 @@
|
||||
:form-params {}
|
||||
:content-types []
|
||||
:accepts ["application/json" "application/xml"]
|
||||
:auth-names []}))
|
||||
:auth-names ["test_api_key_query" "test_api_key_header"]}))
|
||||
|
||||
(defn get-order-by-id
|
||||
"Find purchase order by ID
|
||||
|
@ -9,7 +9,11 @@
|
||||
|
||||
(def auth-definitions
|
||||
{"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
|
||||
"Default API context."
|
||||
@ -18,7 +22,11 @@
|
||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||
:debug false
|
||||
: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*
|
||||
"Dynamic API context to be applied in API calls."
|
||||
|
@ -11,7 +11,11 @@
|
||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||
:debug false
|
||||
: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
|
||||
*api-context*
|
||||
(with-api-context {}
|
||||
@ -25,8 +29,9 @@
|
||||
:date-format "yyyy-MM-dd"
|
||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||
:debug true
|
||||
:auths {"api_key" "key1"
|
||||
"petstore_auth" "token1"}}
|
||||
:auths (merge (:auths default-api-context)
|
||||
{"api_key" "key1"
|
||||
"petstore_auth" "token1"})}
|
||||
*api-context*))
|
||||
;; nested with-api-context inherits values from the outer api context
|
||||
(with-api-context {:datetime-format "yyyy-MM-dd HH:mm:ss"
|
||||
@ -35,8 +40,9 @@
|
||||
:date-format "yyyy-MM-dd"
|
||||
:datetime-format "yyyy-MM-dd HH:mm:ss"
|
||||
:debug true
|
||||
:auths {"api_key" "key2"
|
||||
"petstore_auth" "token1"}}
|
||||
:auths (merge (:auths default-api-context)
|
||||
{"api_key" "key2"
|
||||
"petstore_auth" "token1"})}
|
||||
*api-context*))))
|
||||
;; back to default api context
|
||||
(is (= {:base-url "http://petstore.swagger.io/v2"
|
||||
@ -44,7 +50,11 @@
|
||||
:datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
|
||||
:debug false
|
||||
: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
|
||||
*api-context*))))
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -43,15 +43,15 @@ public class PetApi {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet(Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"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
|
||||
*/
|
||||
public void addPet(Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"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
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
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
|
||||
*/
|
||||
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
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
|
||||
*/
|
||||
public Pet getPetById(Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -220,13 +220,13 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||
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
|
||||
*/
|
||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -269,38 +269,38 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (name != null)
|
||||
formParams.put("name", name);
|
||||
localVarFormParams.put("name", name);
|
||||
if (status != null)
|
||||
formParams.put("status", status);
|
||||
localVarFormParams.put("status", status);
|
||||
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -320,36 +320,36 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
if (apiKey != null)
|
||||
headerParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"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
|
||||
*/
|
||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -370,38 +370,38 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata != null)
|
||||
formParams.put("additionalMetadata", additionalMetadata);
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
formParams.put("file", file);
|
||||
localVarFormParams.put("file", file);
|
||||
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -421,13 +421,13 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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[]>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||
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
|
||||
*/
|
||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"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.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 {
|
||||
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 a map of status codes to quantities
|
||||
@ -42,15 +86,15 @@ public class StoreApi {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Map<String, Integer> getInventory() throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
|
||||
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
|
||||
*/
|
||||
public Order placeOrder(Order body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
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
|
||||
*/
|
||||
public Order getOrderById(String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@ -134,13 +178,13 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
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
|
||||
*/
|
||||
public void deleteOrder(String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@ -181,13 +225,13 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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.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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -42,15 +42,15 @@ public class UserApi {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUser(User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public String loginUser(String username, String password) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
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
|
||||
*/
|
||||
public void logoutUser() throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public User getUserByName(String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -257,13 +257,13 @@ public class UserApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<User> localVarReturnType = new GenericType<User>() {};
|
||||
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
|
||||
*/
|
||||
public void updateUser(String username, User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -305,13 +305,13 @@ public class UserApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void deleteUser(String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -351,13 +351,13 @@ public class UserApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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.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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -43,15 +43,15 @@ public class PetApi {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet(Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"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
|
||||
*/
|
||||
public void addPet(Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"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
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
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
|
||||
*/
|
||||
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
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
|
||||
*/
|
||||
public Pet getPetById(Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -220,13 +220,13 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
|
||||
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
|
||||
*/
|
||||
public void updatePetWithForm(String petId, String name, String status) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -269,38 +269,38 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (name != null)
|
||||
formParams.put("name", name);
|
||||
localVarFormParams.put("name", name);
|
||||
if (status != null)
|
||||
formParams.put("status", status);
|
||||
localVarFormParams.put("status", status);
|
||||
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -320,36 +320,36 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
if (apiKey != null)
|
||||
headerParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"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
|
||||
*/
|
||||
public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -370,38 +370,38 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata != null)
|
||||
formParams.put("additionalMetadata", additionalMetadata);
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
formParams.put("file", file);
|
||||
localVarFormParams.put("file", file);
|
||||
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -421,13 +421,13 @@ public class PetApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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[]>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
|
||||
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
|
||||
*/
|
||||
public void addPetUsingByteArray(byte[] body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// 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
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"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.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 {
|
||||
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 a map of status codes to quantities
|
||||
@ -42,15 +86,15 @@ public class StoreApi {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Map<String, Integer> getInventory() throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
|
||||
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
|
||||
*/
|
||||
public Order placeOrder(Order body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
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
|
||||
*/
|
||||
public Order getOrderById(String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@ -134,13 +178,13 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<Order> localVarReturnType = new GenericType<Order>() {};
|
||||
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
|
||||
*/
|
||||
public void deleteOrder(String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
@ -181,13 +225,13 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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.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 {
|
||||
private ApiClient apiClient;
|
||||
|
||||
@ -42,15 +42,15 @@ public class UserApi {
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUser(User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public String loginUser(String username, String password) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
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
|
||||
*/
|
||||
public void logoutUser() throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public User getUserByName(String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -257,13 +257,13 @@ public class UserApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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>() {};
|
||||
return apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
GenericType<User> localVarReturnType = new GenericType<User>() {};
|
||||
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
|
||||
*/
|
||||
public void updateUser(String username, User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -305,13 +305,13 @@ public class UserApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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
|
||||
*/
|
||||
public void deleteUser(String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
@ -351,13 +351,13 @@ public class UserApi {
|
||||
}
|
||||
|
||||
// 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()));
|
||||
|
||||
// query params
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, Object> formParams = new HashMap<String, Object>();
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
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"
|
||||
};
|
||||
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 */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -84,8 +84,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "PUT", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,7 +128,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -146,29 +146,29 @@ public class PetApi {
|
||||
|
||||
/* Build call for addPet */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -182,8 +182,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -226,7 +226,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -244,31 +244,31 @@ public class PetApi {
|
||||
|
||||
/* Build call for findPetsByStatus */
|
||||
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
|
||||
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)
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -282,14 +282,14 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @return List<Pet>
|
||||
* @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
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for query
|
||||
* @return ApiResponse<List<Pet>>
|
||||
* @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 {
|
||||
Call call = findPetsByStatusCall(status, null, null);
|
||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status (asynchronously)
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need 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
|
||||
@ -329,7 +329,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -341,38 +341,38 @@ public class PetApi {
|
||||
}
|
||||
|
||||
Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for findPetsByTags */
|
||||
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
|
||||
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)
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -386,8 +386,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
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 {
|
||||
Call call = findPetsByTagsCall(tags, null, null);
|
||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -433,7 +433,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -445,14 +445,14 @@ public class PetApi {
|
||||
}
|
||||
|
||||
Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for getPetById */
|
||||
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
|
||||
if (petId == null) {
|
||||
@ -461,26 +461,26 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -494,8 +494,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
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 {
|
||||
Call call = getPetByIdCall(petId, null, null);
|
||||
Type returnType = new TypeToken<Pet>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<Pet>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -541,7 +541,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -553,14 +553,14 @@ public class PetApi {
|
||||
}
|
||||
|
||||
Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<Pet>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<Pet>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for updatePetWithForm */
|
||||
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
|
||||
if (petId == null) {
|
||||
@ -569,30 +569,30 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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)
|
||||
formParams.put("name", name);
|
||||
localVarFormParams.put("name", name);
|
||||
if (status != null)
|
||||
formParams.put("status", status);
|
||||
localVarFormParams.put("status", status);
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -606,8 +606,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -656,7 +656,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -674,7 +674,7 @@ public class PetApi {
|
||||
|
||||
/* Build call for deletePet */
|
||||
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
|
||||
if (petId == null) {
|
||||
@ -683,28 +683,28 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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)
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -718,8 +718,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "DELETE", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -765,7 +765,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -783,7 +783,7 @@ public class PetApi {
|
||||
|
||||
/* Build call for uploadFile */
|
||||
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
|
||||
if (petId == null) {
|
||||
@ -792,30 +792,30 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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)
|
||||
formParams.put("additionalMetadata", additionalMetadata);
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
formParams.put("file", file);
|
||||
localVarFormParams.put("file", file);
|
||||
|
||||
final String[] accepts = {
|
||||
final String[] localVarAccepts = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"multipart/form-data"
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -829,8 +829,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -879,7 +879,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -897,7 +897,7 @@ public class PetApi {
|
||||
|
||||
/* Build call for petPetIdtestingByteArraytrueGet */
|
||||
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
|
||||
if (petId == null) {
|
||||
@ -906,26 +906,26 @@ public class PetApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -939,8 +939,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "api_key" };
|
||||
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 {
|
||||
Call call = petPetIdtestingByteArraytrueGetCall(petId, null, null);
|
||||
Type returnType = new TypeToken<byte[]>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -986,7 +986,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -998,36 +998,36 @@ public class PetApi {
|
||||
}
|
||||
|
||||
Call call = petPetIdtestingByteArraytrueGetCall(petId, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<byte[]>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for addPetUsingByteArray */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -1041,8 +1041,8 @@ public class PetApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1085,7 +1085,7 @@ public class PetApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
|
@ -45,31 +45,33 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
|
||||
/* Build call for getInventory */
|
||||
private Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object postBody = null;
|
||||
/* Build call for findOrdersByStatus */
|
||||
private Call findOrdersByStatusCall(String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// 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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -83,8 +85,110 @@ public class StoreApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||
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 {
|
||||
Call call = getInventoryCall(null, null);
|
||||
Type returnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,7 +231,7 @@ public class StoreApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -139,36 +243,36 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
Call call = getInventoryCall(progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for placeOrder */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
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" };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
||||
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 {
|
||||
Call call = placeOrderCall(body, null, null);
|
||||
Type returnType = new TypeToken<Order>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -229,7 +333,7 @@ public class StoreApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -241,14 +345,14 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
Call call = placeOrderCall(body, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<Order>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for getOrderById */
|
||||
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
|
||||
if (orderId == null) {
|
||||
@ -257,26 +361,26 @@ public class StoreApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
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" };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
||||
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 {
|
||||
Call call = getOrderByIdCall(orderId, null, null);
|
||||
Type returnType = new TypeToken<Order>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -337,7 +441,7 @@ public class StoreApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -349,14 +453,14 @@ public class StoreApi {
|
||||
}
|
||||
|
||||
Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<Order>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<Order>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for deleteOrder */
|
||||
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
|
||||
if (orderId == null) {
|
||||
@ -365,26 +469,26 @@ public class StoreApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -398,8 +502,8 @@ public class StoreApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "DELETE", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -442,7 +546,7 @@ public class StoreApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
|
@ -47,29 +47,29 @@ public class UserApi {
|
||||
|
||||
/* Build call for createUser */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -83,8 +83,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,7 +127,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -145,29 +145,29 @@ public class UserApi {
|
||||
|
||||
/* Build call for createUsersWithArrayInput */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -181,8 +181,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -225,7 +225,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -243,29 +243,29 @@ public class UserApi {
|
||||
|
||||
/* Build call for createUsersWithListInput */
|
||||
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
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -279,8 +279,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "POST", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -323,7 +323,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -341,33 +341,33 @@ public class UserApi {
|
||||
|
||||
/* Build call for loginUser */
|
||||
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
|
||||
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)
|
||||
queryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -381,8 +381,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
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 {
|
||||
Call call = loginUserCall(username, password, null, null);
|
||||
Type returnType = new TypeToken<String>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -431,7 +431,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -443,36 +443,36 @@ public class UserApi {
|
||||
}
|
||||
|
||||
Call call = loginUserCall(username, password, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<String>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for logoutUser */
|
||||
private Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object postBody = null;
|
||||
Object localVarPostBody = null;
|
||||
|
||||
|
||||
// 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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -486,8 +486,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -527,7 +527,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -545,7 +545,7 @@ public class UserApi {
|
||||
|
||||
/* Build call for getUserByName */
|
||||
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
|
||||
if (username == null) {
|
||||
@ -554,26 +554,26 @@ public class UserApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -587,8 +587,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
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 {
|
||||
Call call = getUserByNameCall(username, null, null);
|
||||
Type returnType = new TypeToken<User>(){}.getType();
|
||||
return apiClient.execute(call, returnType);
|
||||
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -634,7 +634,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -646,14 +646,14 @@ public class UserApi {
|
||||
}
|
||||
|
||||
Call call = getUserByNameCall(username, progressListener, progressRequestListener);
|
||||
Type returnType = new TypeToken<User>(){}.getType();
|
||||
apiClient.executeAsync(call, returnType, callback);
|
||||
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
|
||||
/* Build call for updateUser */
|
||||
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
|
||||
if (username == null) {
|
||||
@ -662,26 +662,26 @@ public class UserApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -695,8 +695,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "PUT", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -742,7 +742,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@ -760,7 +760,7 @@ public class UserApi {
|
||||
|
||||
/* Build call for deleteUser */
|
||||
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
|
||||
if (username == null) {
|
||||
@ -769,26 +769,26 @@ public class UserApi {
|
||||
|
||||
|
||||
// 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()));
|
||||
|
||||
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"
|
||||
};
|
||||
final String accept = apiClient.selectHeaderAccept(accepts);
|
||||
if (accept != null) headerParams.put("Accept", accept);
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] contentTypes = {
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
headerParams.put("Content-Type", contentType);
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
|
||||
@ -802,8 +802,8 @@ public class UserApi {
|
||||
});
|
||||
}
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
return apiClient.buildCall(path, "DELETE", queryParams, postBody, headerParams, formParams, authNames, progressRequestListener);
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -846,7 +846,7 @@ public class UserApi {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
|
@ -90,9 +90,8 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
okhttp_version = "3.0.1"
|
||||
oltu_version = "1.0.0"
|
||||
retrofit_version = "2.0.0-beta3"
|
||||
retrofit_version = "2.0.0-beta4"
|
||||
gson_version = "2.4"
|
||||
swagger_annotations_version = "1.5.0"
|
||||
junit_version = "4.12"
|
||||
@ -100,13 +99,10 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
|
||||
|
||||
compile "com.squareup.retrofit2:retrofit:$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 "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
||||
|
||||
|
@ -123,21 +123,11 @@
|
||||
<artifactId>converter-gson</artifactId>
|
||||
<version>${retrofit-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>${gson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.oltu.oauth2</groupId>
|
||||
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
||||
<version>${oltu-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp-version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- test dependencies -->
|
||||
@ -150,10 +140,7 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger-annotations-version>1.5.0</swagger-annotations-version>
|
||||
<retrofit-version>2.0.0-beta3</retrofit-version>
|
||||
|
||||
<okhttp-version>3.0.1</okhttp-version>
|
||||
<gson-version>2.4</gson-version>
|
||||
<retrofit-version>2.0.0-beta4</retrofit-version>
|
||||
<oltu-version>1.0.0</oltu-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-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.Retrofit;
|
||||
import retrofit2.GsonConverterFactory;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@ -46,10 +46,10 @@ public class ApiClient {
|
||||
this();
|
||||
for(String authName : authNames) {
|
||||
Interceptor auth;
|
||||
if (authName == "petstore_auth") {
|
||||
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
||||
} else if (authName == "api_key") {
|
||||
if (authName == "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 {
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
}
|
||||
@ -102,14 +102,14 @@ public class ApiClient {
|
||||
.setUsername(username)
|
||||
.setPassword(password);
|
||||
}
|
||||
|
||||
|
||||
public void createDefaultAdapter() {
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
|
||||
.create();
|
||||
|
||||
okClient = new OkHttpClient();
|
||||
|
||||
|
||||
String baseUrl = "http://petstore.swagger.io/v2";
|
||||
if(!baseUrl.endsWith("/"))
|
||||
baseUrl = baseUrl + "/";
|
||||
@ -124,7 +124,7 @@ public class ApiClient {
|
||||
|
||||
public <S> S createService(Class<S> serviceClass) {
|
||||
return adapterBuilder.build().create(serviceClass);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -202,7 +202,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper method to configure the oauth accessCode/implicit flow parameters
|
||||
* @param clientId
|
||||
@ -224,7 +224,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configures a listener which is notified when a new access token is received.
|
||||
* @param accessTokenListener
|
||||
@ -271,7 +271,7 @@ public class ApiClient {
|
||||
public OkHttpClient getOkClient() {
|
||||
return okClient;
|
||||
}
|
||||
|
||||
|
||||
public void addAuthsToOkClient(OkHttpClient okClient) {
|
||||
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
|
||||
okClient.interceptors().add(apiAuthorization);
|
||||
@ -307,14 +307,14 @@ class GsonResponseBodyConverterToString<T> implements Converter<ResponseBody, T>
|
||||
String returned = value.string();
|
||||
try {
|
||||
return gson.fromJson(returned, type);
|
||||
}
|
||||
}
|
||||
catch (JsonParseException e) {
|
||||
return (T) returned;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GsonCustomConverterFactory extends Converter.Factory
|
||||
class GsonCustomConverterFactory extends Converter.Factory
|
||||
{
|
||||
public static GsonCustomConverterFactory create(Gson gson) {
|
||||
return new GsonCustomConverterFactory(gson);
|
||||
@ -338,8 +338,8 @@ class GsonCustomConverterFactory extends Converter.Factory
|
||||
}
|
||||
|
||||
@Override
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
||||
return gsonConverterFactory.requestBodyConverter(type, annotations, retrofit);
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||
return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,18 +4,18 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class CollectionFormats {
|
||||
|
||||
|
||||
public static class CSVParams {
|
||||
|
||||
protected List<String> params;
|
||||
|
||||
|
||||
public CSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public CSVParams(List<String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
public CSVParams(String... params) {
|
||||
this.params = Arrays.asList(params);
|
||||
}
|
||||
@ -27,19 +27,19 @@ public class CollectionFormats {
|
||||
public void setParams(List<String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return StringUtil.join(params.toArray(new String[0]), ",");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class SSVParams extends CSVParams {
|
||||
|
||||
|
||||
public SSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public SSVParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
@ -53,16 +53,16 @@ public class CollectionFormats {
|
||||
return StringUtil.join(params.toArray(new String[0]), " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class TSVParams extends CSVParams {
|
||||
|
||||
|
||||
public TSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public TSVParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
|
||||
public TSVParams(String... params) {
|
||||
super(params);
|
||||
}
|
||||
@ -72,16 +72,16 @@ public class CollectionFormats {
|
||||
return StringUtil.join( params.toArray(new String[0]), "\t");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class PIPESParams extends CSVParams {
|
||||
|
||||
|
||||
public PIPESParams() {
|
||||
}
|
||||
|
||||
|
||||
public PIPESParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
|
||||
public PIPESParams(String... params) {
|
||||
super(params);
|
||||
}
|
||||
@ -91,5 +91,5 @@ public class CollectionFormats {
|
||||
return StringUtil.join(params.toArray(new String[0]), "|");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -90,9 +90,8 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
okhttp_version = "3.0.1"
|
||||
oltu_version = "1.0.0"
|
||||
retrofit_version = "2.0.0-beta3"
|
||||
retrofit_version = "2.0.0-beta4"
|
||||
gson_version = "2.4"
|
||||
swagger_annotations_version = "1.5.0"
|
||||
junit_version = "4.12"
|
||||
@ -101,15 +100,12 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
|
||||
|
||||
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||
compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_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 "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
|
||||
|
||||
|
@ -123,21 +123,11 @@
|
||||
<artifactId>converter-gson</artifactId>
|
||||
<version>${retrofit-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>${gson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.oltu.oauth2</groupId>
|
||||
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
||||
<version>${oltu-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp-version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.reactivex</groupId>
|
||||
@ -161,10 +151,8 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<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>
|
||||
<okhttp-version>3.0.1</okhttp-version>
|
||||
<gson-version>2.4</gson-version>
|
||||
<oltu-version>1.0.0</oltu-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-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.Retrofit;
|
||||
import retrofit2.GsonConverterFactory;
|
||||
import retrofit2.RxJavaCallAdapterFactory;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
@ -46,10 +46,10 @@ public class ApiClient {
|
||||
this();
|
||||
for(String authName : authNames) {
|
||||
Interceptor auth;
|
||||
if (authName == "petstore_auth") {
|
||||
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
||||
} else if (authName == "api_key") {
|
||||
if (authName == "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 {
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
}
|
||||
@ -102,14 +102,14 @@ public class ApiClient {
|
||||
.setUsername(username)
|
||||
.setPassword(password);
|
||||
}
|
||||
|
||||
|
||||
public void createDefaultAdapter() {
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
|
||||
.create();
|
||||
|
||||
okClient = new OkHttpClient();
|
||||
|
||||
|
||||
String baseUrl = "http://petstore.swagger.io/v2";
|
||||
if(!baseUrl.endsWith("/"))
|
||||
baseUrl = baseUrl + "/";
|
||||
@ -124,7 +124,7 @@ public class ApiClient {
|
||||
|
||||
public <S> S createService(Class<S> serviceClass) {
|
||||
return adapterBuilder.build().create(serviceClass);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -202,7 +202,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper method to configure the oauth accessCode/implicit flow parameters
|
||||
* @param clientId
|
||||
@ -224,7 +224,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configures a listener which is notified when a new access token is received.
|
||||
* @param accessTokenListener
|
||||
@ -271,7 +271,7 @@ public class ApiClient {
|
||||
public OkHttpClient getOkClient() {
|
||||
return okClient;
|
||||
}
|
||||
|
||||
|
||||
public void addAuthsToOkClient(OkHttpClient okClient) {
|
||||
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
|
||||
okClient.interceptors().add(apiAuthorization);
|
||||
@ -307,14 +307,14 @@ class GsonResponseBodyConverterToString<T> implements Converter<ResponseBody, T>
|
||||
String returned = value.string();
|
||||
try {
|
||||
return gson.fromJson(returned, type);
|
||||
}
|
||||
}
|
||||
catch (JsonParseException e) {
|
||||
return (T) returned;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GsonCustomConverterFactory extends Converter.Factory
|
||||
class GsonCustomConverterFactory extends Converter.Factory
|
||||
{
|
||||
public static GsonCustomConverterFactory create(Gson gson) {
|
||||
return new GsonCustomConverterFactory(gson);
|
||||
@ -338,8 +338,8 @@ class GsonCustomConverterFactory extends Converter.Factory
|
||||
}
|
||||
|
||||
@Override
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
||||
return gsonConverterFactory.requestBodyConverter(type, annotations, retrofit);
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||
return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,18 +4,18 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class CollectionFormats {
|
||||
|
||||
|
||||
public static class CSVParams {
|
||||
|
||||
protected List<String> params;
|
||||
|
||||
|
||||
public CSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public CSVParams(List<String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
public CSVParams(String... params) {
|
||||
this.params = Arrays.asList(params);
|
||||
}
|
||||
@ -27,19 +27,19 @@ public class CollectionFormats {
|
||||
public void setParams(List<String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return StringUtil.join(params.toArray(new String[0]), ",");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class SSVParams extends CSVParams {
|
||||
|
||||
|
||||
public SSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public SSVParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
@ -53,16 +53,16 @@ public class CollectionFormats {
|
||||
return StringUtil.join(params.toArray(new String[0]), " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class TSVParams extends CSVParams {
|
||||
|
||||
|
||||
public TSVParams() {
|
||||
}
|
||||
|
||||
|
||||
public TSVParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
|
||||
public TSVParams(String... params) {
|
||||
super(params);
|
||||
}
|
||||
@ -72,16 +72,16 @@ public class CollectionFormats {
|
||||
return StringUtil.join( params.toArray(new String[0]), "\t");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class PIPESParams extends CSVParams {
|
||||
|
||||
|
||||
public PIPESParams() {
|
||||
}
|
||||
|
||||
|
||||
public PIPESParams(List<String> params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
|
||||
public PIPESParams(String... params) {
|
||||
super(params);
|
||||
}
|
||||
@ -91,5 +91,5 @@ public class CollectionFormats {
|
||||
return StringUtil.join(params.toArray(new String[0]), "|");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
Loading…
x
Reference in New Issue
Block a user