Merge remote-tracking branch 'origin/3.2.x' into 4.0.x

This commit is contained in:
William Cheng 2018-07-23 23:05:25 +08:00
commit 024dde11d7
102 changed files with 1830 additions and 1900 deletions

View File

@ -30,12 +30,18 @@ cache:
- $HOME/perl5
- $HOME/.cargo
- $HOME/.stack
- $HOME/samples/server/petstore/cpp-pistache/pistache
services:
- docker
# comment out the host table change to use the public petstore server
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
chrome: stable
hosts:
- petstore.swagger.io
@ -86,10 +92,13 @@ before_install:
install:
# Add Godeps dependencies to GOPATH and PATH
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace"
#- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
#- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace"
- export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$HOME/.cargo/bin:$PATH"
- go version
#- go version
- gcc -v
- echo $CC
- echo $CXX
script:
# fail fast
@ -130,4 +139,4 @@ after_success:
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME && echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi
env:
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5

19
CI/circle_parallel.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
NODE_INDEX=${CIRCLE_NODE_INDEX:-0}
if [ "$NODE_INDEX" = "1" ]; then
echo "Running node $NODE_INDEX to test CI/pom.xml.circleci ..."
cp CI/pom.xml.circleci pom.xml
java -version
mvn --quiet verify -Psamples
else
echo "Running node $NODE_INDEX to test CI/pom.xml.circleci.java7 ..."
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
java -version
cp CI/pom.xml.circleci.java7 pom.xml
mvn --quiet verify -Psamples
fi

View File

@ -844,10 +844,12 @@
<module>samples/client/petstore/java/feign</module>
<module>samples/client/petstore/java/jersey1</module>
<module>samples/client/petstore/java/jersey2</module>
<module>samples/client/petstore/java/jersey2-java8</module>
<module>samples/client/petstore/java/okhttp-gson</module>
<module>samples/client/petstore/java/retrofit</module>
<module>samples/client/petstore/java/retrofit2</module>
<module>samples/client/petstore/java/retrofit2rx</module>
<module>samples/client/petstore/java/retrofit2-play25</module>
<module>samples/client/petstore/jaxrs-cxf-client</module>
<module>samples/client/petstore/java/resttemplate</module>
<module>samples/client/petstore/java/resttemplate-withXml</module>

View File

@ -852,9 +852,6 @@
<module>samples/client/petstore/java/resteasy</module>
<module>samples/client/petstore/java/google-api-client</module>
<module>samples/client/petstore/kotlin/</module>
<!-- test non-java projects -->
<!--<module>samples/client/petstore/go</module>-->
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
<!-- servers -->
<module>samples/server/petstore/java-vertx/rx</module>
<module>samples/server/petstore/java-vertx/async</module>

View File

@ -21,6 +21,8 @@
<div align="center">
[![Join the chat at https://gitter.im/OpenAPITools/openapi-generator](https://badges.gitter.im/OpenAPITools/openapi-generator.svg)](https://gitter.im/OpenAPITools/openapi-generator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Stable releaases in the Maven store](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
[![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator)
</div>
@ -430,6 +432,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2018/06/08 - [Swagger Codegen is now OpenAPI Generator](https://angular.schule/blog/2018-06-swagger-codegen-is-now-openapi-generator) by [JohannesHoppe](https://github.com/JohannesHoppe)
- 2018/06/21 - [Connect your JHipster apps to the world of APIs with OpenAPI and gRPC](https://fr.slideshare.net/chbornet/jhipster-conf-2018-connect-your-jhipster-apps-to-the-world-of-apis-with-openapi-and-grpc) by [Christophe Bornet](https://github.com/cbornet) at [JHipster Conf 2018](https://jhipster-conf.github.io/)
- 2018/06/27 - [Lessons Learned from Leading an Open-Source Project Supporting 30+ Programming Languages](https://speakerdeck.com/wing328/lessons-learned-from-leading-an-open-source-project-supporting-30-plus-programming-languages) - [William Cheng](https://github.com/wing328) at [LinuxCon + ContainerCon + CloudOpen China 2018](https://www.lfasiallc.com/events/lc3-2018/)
- 2018/07/19 - [OpenAPI Generator Contribution Quickstart - RingCentral Go SDK](https://medium.com/ringcentral-developers/openapi-generator-for-go-contribution-quickstart-8cc72bf37b53) by [John Wang](https://github.com/grokify)
## [6 - About Us](#table-of-contents)

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -g cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@"
ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties addExternalLibs=true -o samples/server/petstore/cpp-pistache $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -g cpp-pistache-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@"
ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -1,10 +1,16 @@
version: 2
jobs:
build:
# docker:
# #- image: openapitools/openapi-generator
# - image: swaggerapi/petstore
# environment:
# SWAGGER_HOST=http://petstore.swagger.io
# SWAGGER_BASE_PATH=/v2
machine:
docker_layer_caching: true
working_directory: ~/OpenAPITools/openapi-generator
parallelism: 1
parallelism: 2
shell: /bin/bash --login
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
@ -37,12 +43,6 @@ jobs:
printf '127.0.0.1 petstore.swagger.io
' | sudo tee -a /etc/hosts
# Dependencies
# This would typically go in either a build or a build-and-test job when using workflows
# This is based on your 1.0 configuration file or project settings
- run: sudo add-apt-repository ppa:duggan/bats --yes
- run: sudo apt-get update -qq
- run: sudo apt-get install -qq bats
- run: sudo apt-get install -qq curl
# Install latest stable node for angular 6
- run:
name: Install node@stable (for angular 6)
@ -65,21 +65,9 @@ jobs:
- run: docker ps -a
- run: sleep 30
- run: cat /etc/hosts
# This is based on your 1.0 configuration file or project settings
- run: cp CI/pom.xml.circleci pom.xml
# Test
# This would typically be a build job when using workflows, possibly combined with build
# This is based on your 1.0 configuration file or project settings
#- run: java -version
- run: mvn --quiet clean install
- run: mvn --quiet verify -Psamples
- run: if [ $? -ne 0 ]; then exit 1; fi
- run: sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
- run: java -version
- run: cp CI/pom.xml.circleci.java7 pom.xml
- run: mvn --quiet clean install
- run: mvn --quiet verify -Psamples
- run: if [ $? -ne 0 ]; then exit 1; fi
- run: ./CI/circle_parallel.sh
# Save dependency cache
- save_cache:
key: source-v1-{{ .Branch }}-{{ .Revision }}

View File

@ -230,6 +230,10 @@ public interface CodegenConfig {
String getHttpUserAgent();
void setDocExtension(String docExtension);
String getDocExtension();
String getCommonTemplateDir();
void setIgnoreFilePathOverride(String ignoreFileOverride);

View File

@ -254,4 +254,7 @@ public class CodegenConstants {
public static final String STRIP_PACKAGE_NAME = "stripPackageName";
public static final String STRIP_PACKAGE_NAME_DESC = "Whether to strip leading dot-separated packages from generated model classes";
public static final String DOCEXTENSION = "docExtension";
public static final String DOCEXTENSION_DESC = "The extension of the generated documentation files, defaults to markdown, .md";
}

View File

@ -121,6 +121,8 @@ public class DefaultCodegen implements CodegenConfig {
// When a model is an alias for a simple type
protected Map<String, String> typeAliases = null;
protected Boolean prependFormOrBodyParameters = false;
// The extension of the generated documentation files (defaults to markdown .md)
protected String docExtension;
protected String ignoreFilePathOverride;
@ -179,6 +181,11 @@ public class DefaultCodegen implements CodegenConfig {
this.setRemoveOperationIdPrefix(Boolean.valueOf(additionalProperties
.get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString()));
}
if (additionalProperties.containsKey(CodegenConstants.DOCEXTENSION)){
this.setDocExtension(String.valueOf(additionalProperties
.get(CodegenConstants.DOCEXTENSION).toString()));
}
}
// override with any special post-processing for all models
@ -3454,7 +3461,8 @@ public class DefaultCodegen implements CodegenConfig {
* @return the API documentation file name with full path
*/
public String apiDocFilename(String templateName, String tag) {
String suffix = apiDocTemplateFiles().get(templateName);
String docExtension = getDocExtension();
String suffix = docExtension != null ? docExtension: apiDocTemplateFiles().get(templateName);
return apiDocFileFolder() + File.separator + toApiDocFilename(tag) + suffix;
}
@ -3591,6 +3599,25 @@ public class DefaultCodegen implements CodegenConfig {
return releaseNote;
}
/**
* Documentation files extension
*
* @return Documentation files extension
*/
public String getDocExtension() {
return docExtension;
}
/**
* Set Documentation files extension
*
* @param userDocExtension documentation files extension
*/
public void setDocExtension(String userDocExtension) {
this.docExtension = userDocExtension;
}
/**
* Set HTTP user agent.
*

View File

@ -278,7 +278,8 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
private void generateModelDocumentation(List<File> files, Map<String, Object> models, String modelName) throws IOException {
for (String templateName : config.modelDocTemplateFiles().keySet()) {
String suffix = config.modelDocTemplateFiles().get(templateName);
String docExtension = config.getDocExtension();
String suffix = docExtension!=null ? docExtension : config.modelDocTemplateFiles().get(templateName);
String filename = config.modelDocFileFolder() + File.separator + config.toModelDocFilename(modelName) + suffix;
if (!config.shouldOverwrite(filename)) {
LOGGER.info("Skipped overwriting " + filename);

View File

@ -191,7 +191,13 @@ public class ExampleGenerator {
Schema innerType = ((ArraySchema) property).getItems();
if (innerType != null) {
int arrayLength = null == ((ArraySchema) property).getMaxItems() ? 2 : ((ArraySchema) property).getMaxItems();
if (arrayLength > 1024) {
if (arrayLength == Integer.MAX_VALUE) {
// swagger-jersey2-jaxrs generated spec may contain maxItem = 2147483647
// semantically this means there is no upper limit
// treating this as if the property was not present at all
LOGGER.warn("The max items allowed in property {} of {} equals Integer.MAX_VALUE. Treating this as if no max items has been specified.", property, arrayLength);
arrayLength = 2;
} else if (arrayLength > 1024) {
LOGGER.warn("The max items allowed in property {} is too large ({} items), restricting it to 1024 items", property, arrayLength);
arrayLength = 1024;
}

View File

@ -228,10 +228,10 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
additionalProperties.put("escapedInvokerPackage", invokerPackage.replace("\\", "\\\\"));
// make api and model src path available in mustache template
additionalProperties.put("apiSrcPath", "." + File.separator + toSrcPath(apiPackage, srcBasePath));
additionalProperties.put("modelSrcPath", "." + File.separator + toSrcPath(modelPackage, srcBasePath));
additionalProperties.put("apiTestPath", "." + File.separator + testBasePath + File.separator + apiDirName);
additionalProperties.put("modelTestPath", "." + File.separator + testBasePath + File.separator + modelDirName);
additionalProperties.put("apiSrcPath", "./" + toSrcPath(apiPackage, srcBasePath));
additionalProperties.put("modelSrcPath", "./" + toSrcPath(modelPackage, srcBasePath));
additionalProperties.put("apiTestPath", "./" + testBasePath + "/" + apiDirName);
additionalProperties.put("modelTestPath", "./" + testBasePath + "/" + modelDirName);
// make api and model doc path available in mustache template
additionalProperties.put("apiDocPath", apiDocPath);
@ -255,7 +255,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
public String toSrcPath(String packageName, String basePath) {
packageName = packageName.replace(invokerPackage, ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
if (basePath != null && basePath.length() > 0) {
basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar; // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
basePath = basePath.replaceAll("[\\\\/]?$", "") + '/'; // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
}
String regFirstPathSeparator;
@ -274,7 +274,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
return (basePath
// Replace period, backslash, forward slash with file separator in package name
+ packageName.replaceAll("[\\.\\\\/]", Matcher.quoteReplacement(File.separator))
+ packageName.replaceAll("[\\.\\\\/]", Matcher.quoteReplacement("/"))
// Trim prefix file separators from package path
.replaceAll(regFirstPathSeparator, ""))
// Trim trailing file separators from the overall path

View File

@ -43,7 +43,9 @@ import java.util.Set;
public class CppPistacheServerCodegen extends AbstractCppCodegen {
protected String implFolder = "impl";
protected boolean isAddExternalLibs = false;
public static final String OPTIONAL_EXTERNAL_LIB = "addExternalLibs";
public static final String OPTIONAL_EXTERNAL_LIB_DESC = "Add the Possibility to fetch and compile external Libraries needed by this Framework.";
@Override
public CodegenType getTag() {
return CodegenType.SERVER;
@ -77,6 +79,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
embeddedTemplateDir = templateDir = "cpp-pistache-server";
cliOptions.clear();
addSwitch(OPTIONAL_EXTERNAL_LIB, OPTIONAL_EXTERNAL_LIB_DESC, this.isAddExternalLibs);
reservedWords = new HashSet<>();
@ -102,6 +105,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
typeMapping.put("binary", "std::string");
typeMapping.put("number", "double");
typeMapping.put("UUID", "std::string");
typeMapping.put("ByteArray", "std::string");
super.importMapping = new HashMap<String, String>();
importMapping.put("std::vector", "#include <vector>");
@ -117,7 +121,12 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
additionalProperties.put("modelNamespaceDeclarations", modelPackage.split("\\."));
additionalProperties.put("modelNamespace", modelPackage.replaceAll("\\.", "::"));
additionalProperties.put("apiNamespaceDeclarations", apiPackage.split("\\."));
additionalProperties.put("apiNamespace", apiPackage.replaceAll("\\.", "::"));
additionalProperties.put("apiNamespace", apiPackage.replaceAll("\\.", "::"));
if (additionalProperties.containsKey(OPTIONAL_EXTERNAL_LIB)) {
setAddExternalLibs(convertPropertyToBooleanAndWriteBack(OPTIONAL_EXTERNAL_LIB));
} else {
additionalProperties.put(OPTIONAL_EXTERNAL_LIB, isAddExternalLibs);
}
}
/**
@ -292,6 +301,9 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<std::string, " + getTypeDeclaration(inner) + ">";
}
else if (ModelUtils.isByteArraySchema(p)) {
return "std::string";
}
if (ModelUtils.isStringSchema(p)
|| ModelUtils.isDateSchema(p)
|| ModelUtils.isDateTimeSchema(p) || ModelUtils.isFileSchema(p)
@ -320,6 +332,9 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
return "0L";
}
return "0";
}
else if (ModelUtils.isByteArraySchema(p)) {
return "";
} else if (ModelUtils.isMapSchema(p)) {
String inner = getSchemaType((Schema) p.getAdditionalProperties());
return "std::map<std::string, " + inner + ">()";
@ -403,4 +418,17 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "*_/").replace("/*", "/_*");
}
@Override
public String getTypeDeclaration(String str) {
return toModelName(str);
}
/**
* Specify whether external libraries will be added during the generation
* @param value the value to be set
*/
public void setAddExternalLibs(boolean value){
isAddExternalLibs = value;
}
}

View File

@ -153,6 +153,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
typeMapping.put("binary", "std::string");
typeMapping.put("number", "double");
typeMapping.put("UUID", "utility::string_t");
typeMapping.put("ByteArray", "utility::string_t");
super.importMapping = new HashMap<String, String>();
importMapping.put("std::vector", "#include <vector>");

View File

@ -164,8 +164,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
typeMapping.put("date", "chrono::DateTime<chrono::Utc>");
typeMapping.put("DateTime", "chrono::DateTime<chrono::Utc>");
typeMapping.put("password", "String");
typeMapping.put("File", "Box<Stream<Item=Vec<u8>, Error=Error> + Send>");
typeMapping.put("file", "Box<Stream<Item=Vec<u8>, Error=Error> + Send>");
typeMapping.put("File", "swagger::ByteArray");
typeMapping.put("file", "swagger::ByteArray");
typeMapping.put("array", "Vec");
typeMapping.put("map", "HashMap");
@ -710,8 +710,6 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
}
header.nameInCamelCase = toModelName(header.baseName);
}
additionalProperties.put("apiHasFile", true);
}
return objs;
@ -1069,22 +1067,11 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
private void processParam(CodegenParameter param, CodegenOperation op) {
String example = null;
if (param.isFile) {
param.vendorExtensions.put("formatString", "{:?}");
op.vendorExtensions.put("hasFile", true);
additionalProperties.put("apiHasFile", true);
example = "Box::new(stream::once(Ok(b\"hello\".to_vec()))) as Box<Stream<Item=_, Error=_> + Send>";
} else if (param.isString) {
if (param.dataFormat != null && param.dataFormat.equals("byte")) {
param.vendorExtensions.put("formatString", "\\\"{:?}\\\"");
example = "swagger::ByteArray(\"" + ((param.example != null) ? param.example : "") + "\".to_string().into_bytes())";
} else {
param.vendorExtensions.put("formatString", "\\\"{}\\\"");
example = "\"" + ((param.example != null) ? param.example : "") + "\".to_string()";
}
if (param.isString) {
param.vendorExtensions.put("formatString", "\\\"{}\\\"");
example = "\"" + ((param.example != null) ? param.example : "") + "\".to_string()";
} else if (param.isPrimitiveType) {
if ((param.isByteArray) ||
(param.isBinary)) {
if ((param.isByteArray) || (param.isBinary)) {
// Binary primitive types don't implement `Display`.
param.vendorExtensions.put("formatString", "{:?}");
example = "swagger::ByteArray(Vec::from(\"" + ((param.example != null) ? param.example : "") + "\"))";
@ -1119,12 +1106,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
} else {
// Not required, so override the format string and example
param.vendorExtensions.put("formatString", "{:?}");
if (param.isFile) {
// Optional file types are wrapped in a future
param.vendorExtensions.put("example", (example != null) ? "Box::new(future::ok(Some(" + example + "))) as Box<Future<Item=_, Error=_> + Send>" : "None");
} else {
param.vendorExtensions.put("example", (example != null) ? "Some(" + example + ")" : "None");
}
param.vendorExtensions.put("example", (example != null) ? "Some(" + example + ")" : "None");
}
}
}

View File

@ -19,6 +19,8 @@ package org.openapitools.codegen.utils;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import io.swagger.v3.oas.models.servers.ServerVariables;
import org.openapitools.codegen.CodegenConfig;
import org.slf4j.Logger;
@ -26,12 +28,17 @@ import org.slf4j.LoggerFactory;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class URLPathUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(URLPathUtils.class);
public static final String LOCAL_HOST = "http://localhost";
public static final Pattern VARIABLE_PATTERN = Pattern.compile("\\{([^\\}]+)\\}");
public static URL getServerURL(OpenAPI openAPI) {
final List<Server> servers = openAPI.getServers();
@ -40,8 +47,40 @@ public class URLPathUtils {
return getDefaultUrl();
}
// TODO need a way to obtain all server URLs
final Server server = servers.get(0);
String url = sanitizeUrl(server.getUrl());
return getServerURL(servers.get(0));
}
static URL getServerURL(final Server server) {
String url = server.getUrl();
ServerVariables variables = server.getVariables();
if(variables == null) {
variables = new ServerVariables();
}
Set<String> replacedVariables = new HashSet<>();
Matcher matcher = VARIABLE_PATTERN.matcher(url);
while(matcher.find()) {
if(!replacedVariables.contains(matcher.group())) {
ServerVariable variable = variables.get(matcher.group(1));
String replacement;
if(variable != null) {
if(variable.getDefault() != null) {
replacement = variable.getDefault();
} else if(variable.getEnum() != null && !variable.getEnum().isEmpty()) {
replacement = variable.getEnum().get(0);
} else {
LOGGER.warn("No value found for variable '{}' in server definition '{}', default to empty string.", matcher.group(1), server.getUrl());
replacement = "";
}
} else {
LOGGER.warn("No variable '{}' found in server definition '{}', default to empty string.", matcher.group(1), server.getUrl());
replacement = "";
}
url = url.replace(matcher.group(), replacement);
replacedVariables.add(matcher.group());
matcher = VARIABLE_PATTERN.matcher(url);
}
}
url = sanitizeUrl(url);
try {
return new URL(url);

View File

@ -61,7 +61,7 @@ public class {{classname}} {
{{/externalDocs}}
*/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException {
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {

View File

@ -52,8 +52,8 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque
{{/hasPathParams}}{{#hasBodyParam}}
// Getting the body param
{{#bodyParam}}
{{^isPrimitiveType}}
{{baseType}} {{paramName}};{{/isPrimitiveType}}
{{^isPrimitiveType}}{{^isContainer}}
{{baseType}} {{paramName}};{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}> {{paramName}};{{/isListContainer}}{{#isMapContainer}}std::map<std::string, {{items.baseType}}> {{paramName}};{{/isMapContainer}}{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{dataType}} {{paramName}};
{{/isPrimitiveType}}
@ -74,9 +74,9 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque
{{#hasBodyParam}}
{{#bodyParam}}
nlohmann::json request_body = nlohmann::json::parse(request.body());
{{^isPrimitiveType}}
{{^isPrimitiveType}}{{^isContainer}}
{{paramName}}.fromJson(request_body);
{{/isPrimitiveType}}
{{/isContainer}}{{/isPrimitiveType}}{{#isContainer}} {{paramName}} = {{#isListContainer}} ModelArrayHelper{{/isListContainer}}{{#isMapContainer}} ModelMapHelper{{/isMapContainer}}::fromJson<{{items.baseType}}>(request_body);{{/isContainer}}
{{#isPrimitiveType}}
// The conversion is done automatically by the json library
{{paramName}} = request_body;

View File

@ -2,7 +2,27 @@ cmake_minimum_required (VERSION 3.2)
project(server)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pg -g3" )
{{#addExternalLibs}}
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
ExternalProject_Add(PISTACHE
GIT_REPOSITORY https://github.com/oktal/pistache.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
ExternalProject_Add(NLOHMANN
GIT_REPOSITORY https://github.com/nlohmann/json.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include/nlohmann)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
{{/addExternalLibs}}
link_directories(/usr/local/lib/)

View File

@ -79,11 +79,11 @@ void {{classname}}::fromJson(nlohmann::json& val)
{{/items.isDateTime}}{{^items.isDateTime}}
if(item.is_null())
{
m_{{name}}.push_back( {{{items.datatype}}}(nullptr) );
m_{{name}}.push_back( {{{items.datatype}}}() );
}
else
{
{{{items.datatype}}} newItem({{{items.defaultValue}}});
{{{items.datatype}}} newItem;
newItem.fromJson(item);
m_{{name}}.push_back( newItem );
}
@ -95,15 +95,15 @@ void {{classname}}::fromJson(nlohmann::json& val)
}
{{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(val.find("{{baseName}}") != val.end())
{
{{#isString}}{{setter}}(val.at("{{baseName}}"));
{{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(val.at("{{baseName}}"));
{{/isDateTime}}{{^isDateTime}}if(!val["{{baseName}}"].is_null())
{{#isString}}{{setter}}(val.at("{{baseName}}"));{{/isString}}{{#isByteArray}}{{setter}}(val.at("{{baseName}}"));
{{/isByteArray}}{{^isString}}{{#isDateTime}}{{setter}}(val.at("{{baseName}}"));
{{/isDateTime}}{{^isDateTime}}{{^isByteArray}}if(!val["{{baseName}}"].is_null())
{
{{{dataType}}} newItem({{{defaultValue}}});
{{{dataType}}} newItem;
newItem.fromJson(val["{{baseName}}"]);
{{setter}}( newItem );
}
{{/isDateTime}}{{/isString}}
{{/isByteArray}}{{/isDateTime}}{{/isString}}
}
{{/required}}{{#required}}{{#isString}}{{setter}}(val.at("{{baseName}}"));
{{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(val.at("{{baseName}}"));

View File

@ -12,6 +12,8 @@
#include "json.hpp"
#include <ctime>
#include <string>
#include <vector>
#include <map>
{{#modelNamespaceDeclarations}}
namespace {{this}} {
@ -34,8 +36,103 @@ public:
static int64_t toJson( int64_t const value );
static double toJson( double const value );
static bool toJson( bool const value );
static nlohmann::json toJson(ModelBase const& content );
static nlohmann::json toJson(ModelBase const& content );
};
class ModelArrayHelper {
public:
template<typename T>
static std::vector<T> fromJson(nlohmann::json& json) {
T *ptrTest;
std::vector<T> val;
if (dynamic_cast<ModelBase*>(ptrTest) != nullptr) {
if (!json.empty()) {
for (auto &item : json.items()) {
T entry;
entry.fromJson(item.value());
val.push_back(entry);
}
}
}
return val;
}
template<typename T>
static nlohmann::json toJson(std::vector<T> val) {
nlohmann::json json;
for(auto item : val){
json.push_back(item.toJson());
}
return json;
}
};
class ArrayHelper {
public:
template<typename T>
static std::vector<T> fromJson(nlohmann::json& json) {
std::vector<T> val;
nlohmann::from_json(json, val);
return val;
}
template<typename T>
static nlohmann::json toJson(std::vector<T> val) {
nlohmann::json json;
nlohmann::to_json(json, val);
return json;
}
};
class ModelMapHelper {
public:
template<typename T>
static std::map<std::string, T> & fromJson(nlohmann::json& json) {
T *ptrTest;
std::map<std::string, T> val;
if (dynamic_cast<ModelBase*>(ptrTest) != nullptr) {
if (!json.empty()) {
for (auto &item : json.items()) {
T entry;
entry.fromJson(item.value());
val.insert(val.end(),
std::pair<std::string, T>(item.key(), entry));
}
}
}
return val;
}
template<typename T>
static nlohmann::json toJson(std::map<std::string, T> val) {
nlohmann::json json;
for (auto const& item : val) {
json[item.first] = item.second.toJson();
}
return json;
}
};
class MapHelper {
public:
template<typename T>
static std::map<std::string, T> & fromJson(nlohmann::json& json) {
std::map<std::string, T> val;
if (!json.empty()) {
for (auto &item : json.items()) {
T entry = item.value();
val.insert(val.end(),
std::pair<std::string, T>(item.key(), entry));
}
}
return val;
}
template<typename T>
static nlohmann::json toJson(std::map<std::string, T> val) {
nlohmann::json json;
for (auto const& item : val) {
nlohmann::json jitem = item.second;
json[item.first] = jitem;
}
return json;
}
};
{{#modelNamespaceDeclarations}}

View File

@ -44,7 +44,7 @@ bool ModelBase::toJson( bool const value )
return value;
}
nlohmann::json ModelBase::toJson(ModelBase content )
nlohmann::json ModelBase::toJson(ModelBase const& content )
{
return content.toJson();
}

View File

@ -245,26 +245,29 @@ void {{classname}}::fromJson(web::json::value& val)
{{#isString}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isString}}
{{#isByteArray}}{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));{{/isByteArray}}
{{^isString}}
{{#isDateTime}}
{{setter}}(ModelBase::dateFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isDateTime}}
{{^isDateTime}}
{{^isDateTime}}{{^isByteArray}}
if(!val[utility::conversions::to_string_t("{{baseName}}")].is_null())
{
{{{dataType}}} newItem({{{defaultValue}}});
newItem->fromJson(val[utility::conversions::to_string_t("{{baseName}}")]);
{{setter}}( newItem );
}
{{/isDateTime}}
{{/isByteArray}}{{/isDateTime}}
{{/isString}}
}
{{/required}}
{{#required}}
{{#isString}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isString}}
{{^isString}}
{{/isString}}{{#isByteArray}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isByteArray}}
{{^isString}}{{^isByteArray}}
{{#isDateTime}}
{{setter}}
(ModelBase::dateFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
@ -279,7 +282,7 @@ void {{classname}}::fromJson(web::json::value& val)
{{setter}}( new{{name}} );
{{/vendorExtensions.x-codegen-file}}
{{/isDateTime}}
{{/isString}}
{{/isByteArray}}{{/isString}}
{{/required}}
{{/isPrimitiveType}}
{{/isMapContainer}}
@ -353,31 +356,33 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
{{^required}}
if(m_{{name}}IsSet)
{
{{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isString}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isDateTime}}{{^isDateTime}}if (m_{{name}}.get())
{{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));{{/isString}}{{#isByteArray}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isByteArray}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isDateTime}}{{^isDateTime}}{{^isByteArray}}if (m_{{name}}.get())
{
m_{{name}}->toMultipart(multipart, utility::conversions::to_string_t("{{baseName}}."));
}
{{/isDateTime}}{{/isString}}
{{/isByteArray}}{{/isDateTime}}{{/isString}}
}
{{/required}}
{{#required}}
{{#isString}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isString}}
{{/isString}}{{#isByteArray}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isByteArray}}
{{^isString}}
{{#isDateTime}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isDateTime}}
{{^isDateTime}}
{{^isDateTime}}{{^isByteArray}}
{{#vendorExtensions.x-codegen-file}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/vendorExtensions.x-codegen-file}}
{{^vendorExtensions.x-codegen-file}}
m_{{name}}->toMultipart(multipart, utility::conversions::to_string_t("{{baseName}}."));
{{/vendorExtensions.x-codegen-file}}
{{/isDateTime}}
{{/isByteArray}}{{/isDateTime}}
{{/isString}}
{{/required}}
{{/isPrimitiveType}}
@ -508,7 +513,8 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{{#isString}}
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isString}}
{{^isString}}
{{#isByteArray}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));{{/isByteArray}}
{{^isString}}{{^isByteArray}}
{{#isDateTime}}
{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isDateTime}}
@ -520,14 +526,14 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{{setter}}( newItem );
}
{{/isDateTime}}
{{/isString}}
{{/isByteArray}}{{/isString}}
}
{{/required}}
{{#required}}
{{#isString}}
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isString}}
{{^isString}}
{{/isString}}{{#isByteArray}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));{{/isByteArray}}
{{^isString}}{{^isByteArray}}
{{#isDateTime}}
{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isDateTime}}
@ -541,7 +547,7 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{{setter}}( new{{name}} );
{{/vendorExtensions.x-codegen-file}}
{{/isDateTime}}
{{/isString}}
{{/isByteArray}}{{/isString}}
{{/required}}
{{/isPrimitiveType}}
{{/isMapContainer}}

View File

@ -33,16 +33,16 @@ class {{classname}}(object):
{{{notes}}} # noqa: E501
{{/notes}}
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
asynchronous HTTP request, please pass async_req=True
{{#sortParamsByRequiredFlag}}
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async=True)
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True)
{{/sortParamsByRequiredFlag}}
{{^sortParamsByRequiredFlag}}
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async=True)
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True)
{{/sortParamsByRequiredFlag}}
>>> result = thread.get()
:param async bool
:param async_req bool
{{#allParams}}
:param {{dataType}} {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
{{/allParams}}
@ -51,7 +51,7 @@ class {{classname}}(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501
else:
(data) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501
@ -64,16 +64,16 @@ class {{classname}}(object):
{{{notes}}} # noqa: E501
{{/notes}}
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
asynchronous HTTP request, please pass async_req=True
{{#sortParamsByRequiredFlag}}
>>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async=True)
>>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True)
{{/sortParamsByRequiredFlag}}
{{^sortParamsByRequiredFlag}}
>>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async=True)
>>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True)
{{/sortParamsByRequiredFlag}}
>>> result = thread.get()
:param async bool
:param async_req bool
{{#allParams}}
:param {{dataType}} {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/optional}}
{{/allParams}}
@ -85,7 +85,7 @@ class {{classname}}(object):
local_var_params = locals()
all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -206,7 +206,7 @@ class {{classname}}(object):
files=local_var_files,
response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -280,12 +280,12 @@ class ApiClient(object):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async parameter.
To make an async_req request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
@ -300,7 +300,7 @@ class ApiClient(object):
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async bool: execute request asynchronously
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query,
@ -313,13 +313,13 @@ class ApiClient(object):
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return:
If async parameter is True,
If async_req parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter async is False or missing,
If parameter async_req is False or missing,
then the method will return the response directly.
"""
if not async:
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,

View File

@ -9,8 +9,8 @@ license = "Unlicense"
[features]
default = ["client", "server"]
client = ["serde_json", {{#usesUrlEncodedForm}}"serde_urlencoded", {{/usesUrlEncodedForm}} {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"{{#apiHasFile}}, "multipart"{{/apiHasFile}}]
server = ["serde_json", {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"{{#apiHasFile}}, "multipart"{{/apiHasFile}}]
client = ["serde_json", {{#usesUrlEncodedForm}}"serde_urlencoded", {{/usesUrlEncodedForm}} {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"]
server = ["serde_json", {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"]
[dependencies]
# Required by example server.

View File

@ -6,11 +6,9 @@ extern crate openssl;
extern crate mime;
extern crate chrono;
extern crate url;
{{#apiHasFile}}extern crate multipart;{{/apiHasFile}}
{{#usesUrlEncodedForm}}extern crate serde_urlencoded;{{/usesUrlEncodedForm}}
{{#apiUsesUuid}}use uuid;{{/apiUsesUuid}}
{{#apiHasFile}}use self::multipart::client::lazy::Multipart;{{/apiHasFile}}
use hyper;
use hyper::header::{Headers, ContentType};
use hyper::Uri;
@ -239,7 +237,7 @@ impl<F, C> Api<C> for Client<F> where
F: Future<Item=hyper::Response, Error=hyper::Error> + 'static,
C: Has<XSpanIdString> {{#hasAuthMethods}}+ Has<Option<AuthData>>{{/hasAuthMethods}}{
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, param_{{paramName}}: {{^required}}{{#isFile}}Box<Future<Item={{/isFile}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}, context: &C) -> Box<Future<Item={{operationId}}Response, Error=ApiError>> {
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, param_{{paramName}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box<Future<Item={{operationId}}Response, Error=ApiError>> {
{{#queryParams}}{{#-first}}
// Query parameters
{{/-first}}{{#required}} let query_{{paramName}} = format!("{{baseName}}={{=<% %>=}}{<% paramName %>}<%={{ }}=%>&", {{paramName}}=param_{{paramName}}{{#isListContainer}}.join(","){{/isListContainer}}{{^isListContainer}}.to_string(){{/isListContainer}});
@ -259,47 +257,13 @@ impl<F, C> Api<C> for Client<F> where
let mut request = hyper::Request::new(hyper::Method::{{#vendorExtensions}}{{HttpMethod}}{{/vendorExtensions}}, uri);
{{#vendorExtensions}}{{#hasFile}} // Form data body
let mut multipart = Multipart::new();
// Helper function to convert a Stream into a String. The String can then be used to build the HTTP body.
fn convert_stream_to_string(stream: Box<Stream<Item=Vec<u8>, Error=Error> + Send>) -> Result<String, ApiError> {
stream.concat2()
.wait()
.map_err(|e| ApiError(format!("Unable to collect stream: {}", e)))
.and_then(|body| String::from_utf8(body)
.map_err(|e| ApiError(format!("Failed to convert utf8 stream to String: {}", e))))
}{{/hasFile}}{{/vendorExtensions}}{{#formParams}}{{#isFile}}
{{^required}} if let Ok(Some(param_{{paramName}})) = param_{{paramName}}.wait() { {{/required}}
{{^required}} {{/required}} match convert_stream_to_string(param_{{paramName}}) {
{{^required}} {{/required}} Ok(param_{{paramName}}) => {
// Add file to multipart form.
multipart.add_text("{{paramName}}", param_{{paramName}});
},
{{^required}} {{/required}} Err(err) => return Box::new(futures::done(Err(err))),
{{^required}} {{/required}} }
{{^required}}}{{/required}}{{/isFile}}{{/formParams}}{{#vendorExtensions}}{{#hasFile}}
let mut fields = match multipart.prepare() {
Ok(fields) => fields,
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))),
};
let mut body_string = String::new();
let body = fields.to_body().read_to_string(&mut body_string);
let boundary = fields.boundary();
let multipart_header = match mime::Mime::from_str(&format!("multipart/form-data;boundary={}", boundary)) {
Ok(multipart_header) => multipart_header,
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build multipart header: {:?}", err))))),
};{{/hasFile}}{{^hasFile}}{{#formParams}}{{#-first}} let params = &[{{/-first}}
{{#vendorExtensions}}{{#formParams}}{{#-first}} let params = &[{{/-first}}
("{{baseName}}", {{#vendorExtensions}}{{#required}}Some({{#isString}}param_{{paramName}}{{/isString}}{{^isString}}format!("{:?}", param_{{paramName}}){{/isString}}){{/required}}{{^required}}{{#isString}}param_{{paramName}}{{/isString}}{{^isString}}param_{{paramName}}.map(|param| format!("{:?}", param)){{/isString}}{{/required}}),{{/vendorExtensions}}{{#-last}}
];
let body = serde_urlencoded::to_string(params).expect("impossible to fail to serialize");
request.headers_mut().set(ContentType(mimetypes::requests::{{#vendorExtensions}}{{uppercase_operation_id}}{{/vendorExtensions}}.clone()));
request.set_body(body.into_bytes());{{/-last}}{{/formParams}}{{/hasFile}}{{/vendorExtensions}}{{#bodyParam}}{{#-first}}
request.set_body(body.into_bytes());{{/-last}}{{/formParams}}{{/vendorExtensions}}{{#bodyParam}}{{#-first}}
// Body parameter
{{/-first}}{{#vendorExtensions}}{{#required}}{{#consumesPlainText}} let body = param_{{paramName}};{{/consumesPlainText}}{{#consumesXml}}
{{^has_namespace}} let body = serde_xml_rs::to_string(&param_{{paramName}}).expect("impossible to fail to serialize");{{/has_namespace}}{{#has_namespace}}
@ -340,11 +304,6 @@ impl<F, C> Api<C> for Client<F> where
{{/required}}{{/isMapContainer}}{{#isMapContainer}} let param_{{paramName}}: Option<{{{dataType}}}> = None;
{{/isMapContainer}}{{/headerParams}}
{{#vendorExtensions}}{{#hasFile}}
request.headers_mut().set(ContentType(multipart_header));
request.set_body(body_string.into_bytes());
{{/hasFile}}{{/vendorExtensions}}
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -357,13 +316,9 @@ impl<F, C> Api<C> for Client<F> where
None => return Box::new(future::err(ApiError(String::from("Required response header {{baseName}} for response {{code}} was not found.")))) as Box<Future<Item=_, Error=_>>,
};
{{/headers}}
{{^isFile}}let body = response.body();{{/isFile}}{{#isFile}}let body = Box::new(response.body()
.map(|chunk| chunk.to_vec())
.map_err(|_|
Error::new(ErrorKind::Other, "Received error reading response.")
));{{/isFile}}
let body = response.body();
Box::new(
{{#dataType}}{{^isFile}}
{{#dataType}}
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -383,9 +338,6 @@ impl<F, C> Api<C> for Client<F> where
{{/producesPlainText}}{{/vendorExtensions}}
))
.map(move |body|
{{/isFile}}{{#isFile}}
future::ok(
{{/isFile}}
{{operationId}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}}{{^headers}}(body){{/headers}}{{#headers}}{{#-first}}{ body: body, {{/-first}}{{name}}: response_{{name}}{{^-last}}, {{/-last}}{{#-last}} }{{/-last}}{{/headers}}
)
{{/dataType}}{{^dataType}}

View File

@ -4,9 +4,7 @@
use futures::{self, Future};
use chrono;
{{#apiHasFile}}use futures::Stream;{{/apiHasFile}}
use std::collections::HashMap;
{{#apiHasFile}}use std::io::Error;{{/apiHasFile}}
use std::marker::PhantomData;
{{#apiUsesUuid}}use uuid;{{/apiUsesUuid}}
use swagger;
@ -31,10 +29,9 @@ impl<C> Server<C> {
impl<C> Api<C> for Server<C> where C: Has<XSpanIdString>{
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
{{#summary}} /// {{{summary}}}{{/summary}}
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box<Future<Item={{/isFile}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}, context: &C) -> Box<Future<Item={{operationId}}Response, Error=ApiError>> {
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box<Future<Item={{operationId}}Response, Error=ApiError>> {
let context = context.clone();
println!("{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}{{^isFile}}{{#vendorExtensions}}{{{formatString}}}{{/vendorExtensions}}{{#hasMore}}, {{/hasMore}}{{/isFile}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}{{^isFile}}, {{paramName}}{{/isFile}}{{/allParams}}, context.get().0.clone());{{#allParams}}{{#isFile}}
let _ = {{paramName}}; //Suppresses unused param warning{{/isFile}}{{/allParams}}
println!("{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}{{#vendorExtensions}}{{{formatString}}}{{/vendorExtensions}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}, {{paramName}}{{/allParams}}, context.get().0.clone());{{#allParams}}{{/allParams}}
Box::new(futures::failed("Generic failure".into()))
}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}

View File

@ -51,7 +51,7 @@ pub enum {{operationId}}Response {
pub trait Api<C> {
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
{{#summary}} /// {{{summary}}}{{/summary}}
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box<Future<Item={{/isFile}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}, context: &C) -> Box<Future<Item={{operationId}}Response, Error=ApiError>>;
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box<Future<Item={{operationId}}Response, Error=ApiError>>;
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
}
@ -59,7 +59,7 @@ pub trait Api<C> {
pub trait ApiNoContext {
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
{{#summary}} /// {{{summary}}}{{/summary}}
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box<Future<Item={{/isFile}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}) -> Box<Future<Item={{operationId}}Response, Error=ApiError>>;
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}) -> Box<Future<Item={{operationId}}Response, Error=ApiError>>;
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
}
@ -78,7 +78,7 @@ impl<'a, T: Api<C> + Sized, C> ContextWrapperExt<'a, C> for T {
impl<'a, T: Api<C>, C> ApiNoContext for ContextWrapper<'a, T, C> {
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
{{#summary}} /// {{{summary}}}{{/summary}}
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box<Future<Item={{/isFile}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}) -> Box<Future<Item={{operationId}}Response, Error=ApiError>> {
fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}) -> Box<Future<Item={{operationId}}Response, Error=ApiError>> {
self.api().{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}{{paramName}}, {{/allParams}}&self.context())
}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}

View File

@ -17,9 +17,9 @@ pub mod requests {
lazy_static! {
pub static ref {{#vendorExtensions}}{{uppercase_operation_id}}{{/vendorExtensions}}: Mime = "{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{^consumes}}application/json{{/consumes}}".parse().unwrap();
}
{{/bodyParam}}{{^bodyParam}}{{#vendorExtensions}}{{#formParams}}{{#-first}}{{^hasFile}} /// Create Mime objects for the request content types for {{operationId}}
{{/bodyParam}}{{^bodyParam}}{{#vendorExtensions}}{{#formParams}}{{#-first}} /// Create Mime objects for the request content types for {{operationId}}
lazy_static! {
pub static ref {{#vendorExtensions}}{{uppercase_operation_id}}{{/vendorExtensions}}: Mime = "{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{^consumes}}application/x-www-form-urlencoded{{/consumes}}".parse().unwrap();
}
{{/hasFile}}{{/-first}}{{/formParams}}{{/vendorExtensions}}{{/bodyParam}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
{{/-first}}{{/formParams}}{{/vendorExtensions}}{{/bodyParam}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
}

View File

@ -7,7 +7,6 @@ extern crate openssl;
extern crate mime;
{{^apiUsesUuid}}extern crate uuid;{{/apiUsesUuid}}
extern crate chrono;
{{#apiHasFile}}extern crate multipart;{{/apiHasFile}}
extern crate percent_encoding;
extern crate url;
@ -20,8 +19,6 @@ use hyper::{Request, Response, Error, StatusCode};
use hyper::header::{Headers, ContentType};
use self::url::form_urlencoded;
use mimetypes;
{{#apiHasFile}}use self::multipart::server::Multipart;
use self::multipart::server::save::SaveResult;{{/apiHasFile}}
use serde_json;
{{#usesXml}}use serde_xml_rs;{{/usesXml}}
@ -277,51 +274,7 @@ where
};
{{/required}}
{{/-first}}{{/bodyParams}}
{{^bodyParams}}{{#vendorExtensions}}{{#hasFile}}
let boundary = match multipart_boundary(&headers) {
Some(boundary) => boundary.to_string(),
None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Couldn't find valid multipart body"))),
};
Box::new(body.concat2()
.then(move |result| -> Box<Future<Item=Response, Error=Error>> {
match result {
Ok(body) => {
let mut entries = match Multipart::with_body(&body.to_vec()[..], boundary).save().temp() {
SaveResult::Full(entries) => {
entries
},
_ => {
return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Unable to process all message parts"))))
},
};
{{#formParams}}{{#-first}}
// Form parameters
{{/-first}}
let param_{{paramName}} = entries.fields.remove("{{paramName}}");
let param_{{paramName}} = match param_{{paramName}} {
Some(entry) =>
{{#isFile}}
{{^required}}Some({{/required}}Box::new(stream::once(Ok(entry.as_bytes().to_vec()))) as Box<Stream<Item=Vec<u8>, Error=io::Error> + Send>{{^required}}){{/required}},
{{/isFile}}{{^isFile}}
match entry.parse::<{{{dataType}}}>() {
Ok(entry) => {{^required}}Some({{/required}}entry{{^required}}){{/required}},
{{#required}}
Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse form parameter {{baseName}} - doesn't match schema: {}", e)))),
{{/required}}{{^required}}
Err(_) => None,
{{/required}}
},
{{/isFile}}
{{#required}}
None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Missing required form parameter {{paramName}}")))),
{{/required}}{{^required}}
None => None,
{{/required}}
};
{{^required}}{{#isFile}} let param_{{paramName}} = Box::new(future::ok(param_{{paramName}}));{{/isFile}}{{/required}}
{{/formParams}}
{{/hasFile}}{{^hasFile}}
{{^bodyParams}}{{#vendorExtensions}}
Box::new({
{{
{{#formParams}}{{#-first}}
@ -329,7 +282,7 @@ where
{{/-first}}
let param_{{paramName}} = {{^isContainer}}{{#vendorExtensions}}{{{example}}};{{/vendorExtensions}}{{/isContainer}}{{#isListContainer}}{{#required}}Vec::new();{{/required}}{{^required}}None;{{/required}}{{/isListContainer}}{{#isMapContainer}}None;{{/isMapContainer}}
{{/formParams}}
{{/hasFile}}{{/vendorExtensions}}{{/bodyParams}}
{{/vendorExtensions}}{{/bodyParams}}
Box::new(api_impl.{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}param_{{paramName}}{{#isListContainer}}.as_ref(){{/isListContainer}}, {{/allParams}}&context)
.then(move |result| {
let mut response = Response::new();
@ -364,7 +317,7 @@ where
{{/-last}}
{{/headers}}{{/dataType}}
=> {
{{^isFile}} response.set_status(StatusCode::try_from({{code}}).unwrap());
response.set_status(StatusCode::try_from({{code}}).unwrap());
{{#headers}}
header! { (Response{{nameInCamelCase}}, "{{baseName}}") => [{{{dataType}}}] }
response.headers_mut().set(Response{{nameInCamelCase}}({{name}}));
@ -384,34 +337,7 @@ where
let body = serde_json::to_string(&body).expect("impossible to fail to serialize");
{{/producesJson}}{{/vendorExtensions}}
response.set_body(body);
{{/dataType}}{{/isFile}}{{#isFile}}
let body = body.fold(Vec::new(), | mut body, chunk| {
body.extend(chunk.iter());
future::ok::<Vec<u8>, io::Error>(body)
})
// Block whilst waiting for the stream to complete
.wait();
match body {
// If no error occurred then create successful hyper response
Ok(vec) => {
response.set_status(StatusCode::try_from({{code}}).unwrap());
{{#headers}}
header! { (Response{{nameInCamelCase}}, "{{baseName}}") => [{{{dataType}}}] }
response.headers_mut().set(Response{{nameInCamelCase}}({{name}}));
{{/headers}}{{#produces}}{{#-first}}{{#dataType}}
response.headers_mut().set(ContentType(mimetypes::responses::{{#vendorExtensions}}{{uppercase_operation_id}}_{{x-uppercaseResponseId}}{{/vendorExtensions}}.clone()));
{{/dataType}}{{/-first}}{{/produces}}
response.set_body(vec);
},
// It's possible that errors were received in the stream, if this is the case then we can't return a success response to the client and instead must return an internal error.
Err(e) => {
response.set_status(StatusCode::InternalServerError);
response.set_body("An internal error occurred");
}
}
{{/isFile}}
{{/dataType}}
},
{{/responses}}
},
@ -426,17 +352,10 @@ where
future::ok(response)
}
))
{{^bodyParams}}{{#vendorExtensions}}{{^hasFile}}
{{^bodyParams}}{{#vendorExtensions}}
}}
}) as Box<Future<Item=Response, Error=Error>>
{{/hasFile}}{{#hasFile}}
as Box<Future<Item=Response, Error=Error>>
},
Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))),
}
})
)
{{/hasFile}}{{/vendorExtensions}}{{/bodyParams}}
{{/vendorExtensions}}{{/bodyParams}}
{{#bodyParams}}{{#-first}}
},
Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter {{baseName}}: {}", e)))),
@ -451,32 +370,3 @@ where
}
}
}
{{#apiHasFile}}
/// Utility function to get the multipart boundary marker (if any) from the Headers.
fn multipart_boundary<'a>(headers: &'a Headers) -> Option<&'a str> {
headers.get::<ContentType>().and_then(|content_type| {
let ContentType(ref mime) = *content_type;
if mime.type_() == mime::MULTIPART && mime.subtype() == mime::FORM_DATA {
mime.get_param(mime::BOUNDARY).map(|x| x.as_str())
} else {
None
}
})
}
{{/apiHasFile}}
/// Request parser for `Api`.
pub struct ApiRequestParser;
impl RequestParser for ApiRequestParser {
fn parse_operation_id(request: &Request) -> Result<&'static str, ()> {
let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path());
match request.method() {
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
// {{operationId}} - {{httpMethod}} {{path}}
&hyper::Method::{{vendorExtensions.HttpMethod}} if path.matched(paths::ID_{{vendorExtensions.PATH_ID}}) => Ok("{{operationId}}"),
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} _ => Err(()),
}
}
}

View File

@ -19,11 +19,14 @@ package org.openapitools.codegen.utils;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import io.swagger.v3.oas.models.servers.ServerVariables;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.net.URL;
import java.util.Arrays;
public class URLPathUtilsTest {
@ -75,4 +78,40 @@ public class URLPathUtilsTest {
Assert.assertEquals(URLPathUtils.getServerURL(openAPI).toString(), t[1]);
}
}
@Test
public void testGetServerURLWithVariables() throws Exception {
Server s1 = new Server().url("http://localhost:{port}/").variables(new ServerVariables().addServerVariable("port", new ServerVariable()._default("8080").description("the server port")));
Assert.assertEquals(URLPathUtils.getServerURL(s1).toString(), "http://localhost:8080/");
Server s2 = new Server().url("http://{version}.test.me/{version}").variables(new ServerVariables().addServerVariable("version", new ServerVariable()._default("v1")));
Assert.assertEquals(URLPathUtils.getServerURL(s2).toString(), "http://v1.test.me/v1");
Server s3 = new Server().url("http://localhost:{port}/{version}").variables(
new ServerVariables().addServerVariable("version", new ServerVariable()._default("v4"))
.addServerVariable("port", new ServerVariable()._default("8080"))
.addServerVariable("other", new ServerVariable()._default("something"))
);
Assert.assertEquals(URLPathUtils.getServerURL(s3).toString(), "http://localhost:8080/v4");
Server s4 = new Server().url("http://91.161.147.64/{targetEnv}").variables(new ServerVariables().addServerVariable("targetEnv", new ServerVariable().description("target environment")._enum(Arrays.asList("dev", "int", "prd"))._default("prd")));
Assert.assertEquals(URLPathUtils.getServerURL(s4).toString(), "http://91.161.147.64/prd");
Server s5 = new Server().url("https://api.stats.com/{country1}").variables(new ServerVariables().addServerVariable("country1", new ServerVariable()._enum(Arrays.asList("france", "germany", "italy"))));
Assert.assertEquals(URLPathUtils.getServerURL(s5).toString(), "https://api.stats.com/france");
Server s6 = new Server().url("https://api.example.com/{wrong}");
Assert.assertEquals(URLPathUtils.getServerURL(s6).toString(), "https://api.example.com/");
Server s7 = new Server().url("https://api.example.com/{wrong}").variables(new ServerVariables());
Assert.assertEquals(URLPathUtils.getServerURL(s7).toString(), "https://api.example.com/");
Server s8 = new Server().url("https://api.example.com/{wrong}").variables(new ServerVariables().addServerVariable("other", new ServerVariable()._default("something")));
Assert.assertEquals(URLPathUtils.getServerURL(s8).toString(), "https://api.example.com/");
Server s9 = new Server().url("https://{user}.example.com/{version}").variables(
new ServerVariables().addServerVariable("version", new ServerVariable()._default("v1"))
.addServerVariable("user", new ServerVariable()._default("{user}")));
Assert.assertEquals(URLPathUtils.getServerURL(s9).toString(), "https://{user}.example.com/v1");
}
}

View File

@ -608,6 +608,7 @@ paths:
consumes:
- "application/x-www-form-urlencoded"
parameters:
# See https://github.com/OpenAPITools/openapi-generator/issues/545
# - name: enum_form_string_array
# type: array
# items:
@ -618,15 +619,15 @@ paths:
# - '$'
# in: formData
# description: Form parameter enum test (string array)
# - name: enum_form_string
# type: string
# default: '-efg'
# enum:
# - _abc
# - '-efg'
# - (xyz)
# in: formData
# description: Form parameter enum test (string)
- name: enum_form_string
type: string
default: '-efg'
enum:
- _abc
- '-efg'
- (xyz)
in: formData
description: Form parameter enum test (string)
- name: enum_header_string_array
type: array
items:
@ -753,12 +754,12 @@ paths:
in: formData
description: None
required: true
# - name: byte
# type: string
# format: byte
# in: formData
# description: None
# required: true
- name: byte
type: string
format: byte
in: formData
description: None
required: true
- name: binary
type: string
format: binary
@ -1204,9 +1205,9 @@ definitions:
byte:
type: string
format: byte
# binary:
# type: string
# format: binary
binary:
type: string
format: binary
date:
type: string
format: date
@ -1338,16 +1339,15 @@ definitions:
type: object
additionalProperties:
type: string
# comment out the following (map of map of enum) as many language not yet support this
#map_map_of_enum:
# type: object
# additionalProperties:
# type: object
# additionalProperties:
# type: string
# enum:
# - UPPER
# - lower
map_map_of_enum:
type: object
additionalProperties:
type: object
additionalProperties:
type: string
enum:
- UPPER
- lower
map_of_enum_string:
type: object
additionalProperties:
@ -1375,15 +1375,13 @@ definitions:
type: array
items:
$ref: '#/definitions/ReadOnlyFirst'
# commented out the below test case for array of enum for the time being
# as not all language can handle it
#array_of_enum:
# type: array
# items:
# type: string
# enum:
# - UPPER
# - lower
array_of_enum:
type: array
items:
type: string
enum:
- UPPER
- lower
NumberOnly:
type: object
properties:
@ -1420,16 +1418,15 @@ definitions:
enum:
- fish
- crab
# comment out the following as 2d array of enum is not supported at the moment
#array_array_enum:
# type: array
# items:
# type: array
# items:
# type: string
# enum:
# - Cat
# - Dog
array_array_enum:
type: array
items:
type: array
items:
type: string
enum:
- Cat
- Dog
OuterEnum:
type: "string"
enum:

View File

@ -930,7 +930,6 @@
<modules>
<!-- clients -->
<module>samples/client/petstore/haskell-http-client</module>
<module>samples/client/petstore/elm</module>
<module>samples/client/petstore/groovy</module>
<module>samples/client/petstore/rust</module>

View File

@ -300,7 +300,7 @@ public class FakeApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'number' is set
if (number == null) {
@ -385,7 +385,7 @@ public class FakeApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
@ -462,7 +462,7 @@ public class FakeApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testJsonFormData(String param, String param2) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {

View File

@ -89,7 +89,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deletePet(Long petId, String apiKey) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -128,7 +128,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List<Pet> findPetsByStatus(List<String> status) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'status' is set
if (status == null) {
@ -165,7 +165,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List<Pet> findPetsByTags(List<String> tags) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'tags' is set
if (tags == null) {
@ -203,7 +203,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Pet getPetById(Long petId) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -276,7 +276,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void updatePetWithForm(Long petId, String name, String status) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -320,7 +320,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -366,7 +366,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {

View File

@ -54,7 +54,7 @@ public class StoreApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deleteOrder(String orderId) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
@ -88,7 +88,7 @@ public class StoreApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Map<String, Integer> getInventory() throws RestClientException {
Object postBody = new Object();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString();
@ -119,7 +119,7 @@ public class StoreApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Order getOrderById(Long orderId) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {

View File

@ -147,7 +147,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deleteUser(String username) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -184,7 +184,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public User getUserByName(String username) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -223,7 +223,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public String loginUser(String username, String password) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -263,7 +263,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void logoutUser() throws RestClientException {
Object postBody = new Object();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString();

View File

@ -300,7 +300,7 @@ public class FakeApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'number' is set
if (number == null) {
@ -385,7 +385,7 @@ public class FakeApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
@ -462,7 +462,7 @@ public class FakeApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testJsonFormData(String param, String param2) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {

View File

@ -89,7 +89,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deletePet(Long petId, String apiKey) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -128,7 +128,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List<Pet> findPetsByStatus(List<String> status) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'status' is set
if (status == null) {
@ -165,7 +165,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List<Pet> findPetsByTags(List<String> tags) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'tags' is set
if (tags == null) {
@ -203,7 +203,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Pet getPetById(Long petId) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -276,7 +276,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void updatePetWithForm(Long petId, String name, String status) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -320,7 +320,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -366,7 +366,7 @@ public class PetApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {

View File

@ -54,7 +54,7 @@ public class StoreApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deleteOrder(String orderId) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
@ -88,7 +88,7 @@ public class StoreApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Map<String, Integer> getInventory() throws RestClientException {
Object postBody = new Object();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString();
@ -119,7 +119,7 @@ public class StoreApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Order getOrderById(Long orderId) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {

View File

@ -147,7 +147,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deleteUser(String username) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -184,7 +184,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public User getUserByName(String username) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -223,7 +223,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public String loginUser(String username, String password) throws RestClientException {
Object postBody = new Object();
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -263,7 +263,7 @@ public class UserApi {
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void logoutUser() throws RestClientException {
Object postBody = new Object();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString();

View File

@ -37,18 +37,18 @@ class AnotherFakeApi(object):
To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_special_tags(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_special_tags_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_special_tags_with_http_info(client, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class AnotherFakeApi(object):
To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_special_tags_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -73,7 +73,7 @@ class AnotherFakeApi(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -126,7 +126,7 @@ class AnotherFakeApi(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class FakeApi(object):
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_boolean_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param bool body: Input boolean as post body
:return: bool
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
@ -59,11 +59,11 @@ class FakeApi(object):
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param bool body: Input boolean as post body
:return: bool
If the method is called asynchronously,
@ -73,7 +73,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class FakeApi(object):
files=local_var_files,
response_type='bool', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -129,18 +129,18 @@ class FakeApi(object):
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_composite_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param OuterComposite outer_composite: Input composite as post body
:return: OuterComposite
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
@ -151,11 +151,11 @@ class FakeApi(object):
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_composite_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param OuterComposite outer_composite: Input composite as post body
:return: OuterComposite
If the method is called asynchronously,
@ -165,7 +165,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['outer_composite'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -210,7 +210,7 @@ class FakeApi(object):
files=local_var_files,
response_type='OuterComposite', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -221,18 +221,18 @@ class FakeApi(object):
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_number_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float body: Input number as post body
:return: float
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
@ -243,11 +243,11 @@ class FakeApi(object):
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_number_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float body: Input number as post body
:return: float
If the method is called asynchronously,
@ -257,7 +257,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -302,7 +302,7 @@ class FakeApi(object):
files=local_var_files,
response_type='float', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -313,18 +313,18 @@ class FakeApi(object):
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_string_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str body: Input string as post body
:return: str
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
@ -335,11 +335,11 @@ class FakeApi(object):
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_string_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str body: Input string as post body
:return: str
If the method is called asynchronously,
@ -349,7 +349,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -394,7 +394,7 @@ class FakeApi(object):
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -405,18 +405,18 @@ class FakeApi(object):
For this test, the body for this request much reference a schema named `File`. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_file_schema(file_schema_test_class, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param FileSchemaTestClass file_schema_test_class: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
else:
(data) = self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
@ -427,11 +427,11 @@ class FakeApi(object):
For this test, the body for this request much reference a schema named `File`. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param FileSchemaTestClass file_schema_test_class: (required)
:return: None
If the method is called asynchronously,
@ -441,7 +441,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['file_schema_test_class'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -490,7 +490,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -500,11 +500,11 @@ class FakeApi(object):
"""test_body_with_query_params # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_query_params(query, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_query_params(query, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str query: (required)
:param User user: (required)
:return: None
@ -512,7 +512,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
else:
(data) = self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
@ -522,11 +522,11 @@ class FakeApi(object):
"""test_body_with_query_params # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_query_params_with_http_info(query, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str query: (required)
:param User user: (required)
:return: None
@ -537,7 +537,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['query', 'user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -592,7 +592,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -603,18 +603,18 @@ class FakeApi(object):
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_client_model(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_client_model(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
@ -625,11 +625,11 @@ class FakeApi(object):
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_client_model_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_client_model_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -639,7 +639,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -692,7 +692,7 @@ class FakeApi(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -703,11 +703,11 @@ class FakeApi(object):
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float number: None (required)
:param float double: None (required)
:param str pattern_without_delimiter: None (required)
@ -727,7 +727,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
else:
(data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
@ -738,11 +738,11 @@ class FakeApi(object):
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float number: None (required)
:param float double: None (required)
:param str pattern_without_delimiter: None (required)
@ -765,7 +765,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -880,7 +880,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -891,11 +891,11 @@ class FakeApi(object):
To test enum parameters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_enum_parameters(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_enum_parameters(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] enum_header_string_array: Header parameter enum test (string array)
:param str enum_header_string: Header parameter enum test (string)
:param list[str] enum_query_string_array: Query parameter enum test (string array)
@ -909,7 +909,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
@ -920,11 +920,11 @@ class FakeApi(object):
To test enum parameters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_enum_parameters_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_enum_parameters_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] enum_header_string_array: Header parameter enum test (string array)
:param str enum_header_string: Header parameter enum test (string)
:param list[str] enum_query_string_array: Query parameter enum test (string array)
@ -941,7 +941,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double', 'enum_form_string_array', 'enum_form_string'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1003,7 +1003,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -1013,18 +1013,18 @@ class FakeApi(object):
"""test inline additionalProperties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_inline_additional_properties(request_body, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_inline_additional_properties(request_body, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param dict(str, str) request_body: request body (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
else:
(data) = self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
@ -1034,11 +1034,11 @@ class FakeApi(object):
"""test inline additionalProperties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_inline_additional_properties_with_http_info(request_body, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_inline_additional_properties_with_http_info(request_body, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param dict(str, str) request_body: request body (required)
:return: None
If the method is called asynchronously,
@ -1048,7 +1048,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['request_body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1097,7 +1097,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -1107,11 +1107,11 @@ class FakeApi(object):
"""test json serialization of form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_json_form_data(param, param2, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_json_form_data(param, param2, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str param: field1 (required)
:param str param2: field2 (required)
:return: None
@ -1119,7 +1119,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
else:
(data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
@ -1129,11 +1129,11 @@ class FakeApi(object):
"""test json serialization of form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_json_form_data_with_http_info(param, param2, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str param: field1 (required)
:param str param2: field2 (required)
:return: None
@ -1144,7 +1144,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['param', 'param2'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1199,7 +1199,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class FakeClassnameTags123Api(object):
To test class name in snake case # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_classname(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_classname_with_http_info(client, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class FakeClassnameTags123Api(object):
To test class name in snake case # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_classname_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -73,7 +73,7 @@ class FakeClassnameTags123Api(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -126,7 +126,7 @@ class FakeClassnameTags123Api(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -36,18 +36,18 @@ class PetApi(object):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_pet(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
else:
(data) = self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
@ -57,11 +57,11 @@ class PetApi(object):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet_with_http_info(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_pet_with_http_info(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
@ -71,7 +71,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -120,7 +120,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -130,11 +130,11 @@ class PetApi(object):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pet(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
@ -142,7 +142,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
@ -152,11 +152,11 @@ class PetApi(object):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
@ -167,7 +167,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -214,7 +214,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -225,18 +225,18 @@ class PetApi(object):
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status(status, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status(status, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
else:
(data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
@ -247,11 +247,11 @@ class PetApi(object):
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status_with_http_info(status, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
@ -261,7 +261,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['status'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -311,7 +311,7 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -322,18 +322,18 @@ class PetApi(object):
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags(tags, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_tags(tags, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
else:
(data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
@ -344,11 +344,11 @@ class PetApi(object):
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
@ -358,7 +358,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['tags'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -408,7 +408,7 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -419,18 +419,18 @@ class PetApi(object):
Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_pet_by_id(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
@ -441,11 +441,11 @@ class PetApi(object):
Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
@ -455,7 +455,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -504,7 +504,7 @@ class PetApi(object):
files=local_var_files,
response_type='Pet', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -514,18 +514,18 @@ class PetApi(object):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
else:
(data) = self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
@ -535,11 +535,11 @@ class PetApi(object):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_http_info(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_http_info(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
@ -549,7 +549,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -598,7 +598,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -608,11 +608,11 @@ class PetApi(object):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_form(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
@ -621,7 +621,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
@ -631,11 +631,11 @@ class PetApi(object):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
@ -647,7 +647,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'name', 'status'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -700,7 +700,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -710,11 +710,11 @@ class PetApi(object):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
@ -723,7 +723,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
@ -733,11 +733,11 @@ class PetApi(object):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
@ -749,7 +749,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -806,7 +806,7 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -816,11 +816,11 @@ class PetApi(object):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
@ -829,7 +829,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
else:
(data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
@ -839,11 +839,11 @@ class PetApi(object):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
@ -855,7 +855,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -916,7 +916,7 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class StoreApi(object):
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_order(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
else:
(data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class StoreApi(object):
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order_with_http_info(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_order_with_http_info(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
@ -73,7 +73,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class StoreApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -129,17 +129,17 @@ class StoreApi(object):
Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_inventory(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501
@ -150,11 +150,11 @@ class StoreApi(object):
Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_inventory_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
@ -163,7 +163,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -206,7 +206,7 @@ class StoreApi(object):
files=local_var_files,
response_type='dict(str, int)', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -217,18 +217,18 @@ class StoreApi(object):
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_order_by_id(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
else:
(data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
@ -239,11 +239,11 @@ class StoreApi(object):
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
@ -253,7 +253,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -306,7 +306,7 @@ class StoreApi(object):
files=local_var_files,
response_type='Order', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -316,18 +316,18 @@ class StoreApi(object):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.place_order(order, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.place_order(order, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Order order: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.place_order_with_http_info(order, **kwargs) # noqa: E501
else:
(data) = self.place_order_with_http_info(order, **kwargs) # noqa: E501
@ -337,11 +337,11 @@ class StoreApi(object):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.place_order_with_http_info(order, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.place_order_with_http_info(order, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Order order: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
@ -351,7 +351,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -400,7 +400,7 @@ class StoreApi(object):
files=local_var_files,
response_type='Order', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_user(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param User user: Created user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_user_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_user_with_http_info(user, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_user_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param User user: Created user object (required)
:return: None
If the method is called asynchronously,
@ -73,7 +73,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -128,18 +128,18 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_array_input(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
@ -149,11 +149,11 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
@ -163,7 +163,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -208,7 +208,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -218,18 +218,18 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_list_input(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
@ -239,11 +239,11 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
@ -253,7 +253,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -298,7 +298,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -309,18 +309,18 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_user(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
else:
(data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501
@ -331,11 +331,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user_with_http_info(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_user_with_http_info(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
@ -345,7 +345,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -390,7 +390,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -400,18 +400,18 @@ class UserApi(object):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_user_by_name(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
else:
(data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
@ -421,11 +421,11 @@ class UserApi(object):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name_with_http_info(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
@ -435,7 +435,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -484,7 +484,7 @@ class UserApi(object):
files=local_var_files,
response_type='User', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -494,11 +494,11 @@ class UserApi(object):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_user(username, password, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_user(username, password, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
@ -506,7 +506,7 @@ class UserApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
else:
(data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
@ -516,11 +516,11 @@ class UserApi(object):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_user_with_http_info(username, password, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_user_with_http_info(username, password, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
@ -531,7 +531,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username', 'password'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -586,7 +586,7 @@ class UserApi(object):
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -596,17 +596,17 @@ class UserApi(object):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.logout_user(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.logout_user_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.logout_user_with_http_info(**kwargs) # noqa: E501
@ -616,11 +616,11 @@ class UserApi(object):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.logout_user_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: None
If the method is called asynchronously,
returns the request thread.
@ -629,7 +629,7 @@ class UserApi(object):
local_var_params = locals()
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -668,7 +668,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -679,11 +679,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user(username, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_user(username, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: name that need to be deleted (required)
:param User user: Updated user object (required)
:return: None
@ -691,7 +691,7 @@ class UserApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
else:
(data) = self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
@ -702,11 +702,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user_with_http_info(username, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_user_with_http_info(username, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: name that need to be deleted (required)
:param User user: Updated user object (required)
:return: None
@ -717,7 +717,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username', 'user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -768,7 +768,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -273,12 +273,12 @@ class ApiClient(object):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async parameter.
To make an async_req request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
@ -293,7 +293,7 @@ class ApiClient(object):
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async bool: execute request asynchronously
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query,
@ -306,13 +306,13 @@ class ApiClient(object):
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return:
If async parameter is True,
If async_req parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter async is False or missing,
If parameter async_req is False or missing,
then the method will return the response directly.
"""
if not async:
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,

View File

@ -37,18 +37,18 @@ class AnotherFakeApi(object):
To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_special_tags(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_special_tags_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_special_tags_with_http_info(client, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class AnotherFakeApi(object):
To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_special_tags_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -73,7 +73,7 @@ class AnotherFakeApi(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -126,7 +126,7 @@ class AnotherFakeApi(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class FakeApi(object):
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_boolean_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param bool body: Input boolean as post body
:return: bool
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
@ -59,11 +59,11 @@ class FakeApi(object):
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param bool body: Input boolean as post body
:return: bool
If the method is called asynchronously,
@ -73,7 +73,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class FakeApi(object):
files=local_var_files,
response_type='bool', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -129,18 +129,18 @@ class FakeApi(object):
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_composite_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param OuterComposite outer_composite: Input composite as post body
:return: OuterComposite
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
@ -151,11 +151,11 @@ class FakeApi(object):
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_composite_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param OuterComposite outer_composite: Input composite as post body
:return: OuterComposite
If the method is called asynchronously,
@ -165,7 +165,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['outer_composite'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -210,7 +210,7 @@ class FakeApi(object):
files=local_var_files,
response_type='OuterComposite', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -221,18 +221,18 @@ class FakeApi(object):
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_number_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float body: Input number as post body
:return: float
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
@ -243,11 +243,11 @@ class FakeApi(object):
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_number_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float body: Input number as post body
:return: float
If the method is called asynchronously,
@ -257,7 +257,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -302,7 +302,7 @@ class FakeApi(object):
files=local_var_files,
response_type='float', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -313,18 +313,18 @@ class FakeApi(object):
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_string_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str body: Input string as post body
:return: str
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
@ -335,11 +335,11 @@ class FakeApi(object):
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_string_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str body: Input string as post body
:return: str
If the method is called asynchronously,
@ -349,7 +349,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -394,7 +394,7 @@ class FakeApi(object):
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -405,18 +405,18 @@ class FakeApi(object):
For this test, the body for this request much reference a schema named `File`. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_file_schema(file_schema_test_class, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param FileSchemaTestClass file_schema_test_class: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
else:
(data) = self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
@ -427,11 +427,11 @@ class FakeApi(object):
For this test, the body for this request much reference a schema named `File`. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param FileSchemaTestClass file_schema_test_class: (required)
:return: None
If the method is called asynchronously,
@ -441,7 +441,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['file_schema_test_class'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -490,7 +490,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -500,11 +500,11 @@ class FakeApi(object):
"""test_body_with_query_params # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_query_params(query, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_query_params(query, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str query: (required)
:param User user: (required)
:return: None
@ -512,7 +512,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
else:
(data) = self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
@ -522,11 +522,11 @@ class FakeApi(object):
"""test_body_with_query_params # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_query_params_with_http_info(query, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str query: (required)
:param User user: (required)
:return: None
@ -537,7 +537,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['query', 'user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -592,7 +592,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -603,18 +603,18 @@ class FakeApi(object):
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_client_model(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_client_model(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
@ -625,11 +625,11 @@ class FakeApi(object):
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_client_model_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_client_model_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -639,7 +639,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -692,7 +692,7 @@ class FakeApi(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -703,11 +703,11 @@ class FakeApi(object):
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float number: None (required)
:param float double: None (required)
:param str pattern_without_delimiter: None (required)
@ -727,7 +727,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
else:
(data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
@ -738,11 +738,11 @@ class FakeApi(object):
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float number: None (required)
:param float double: None (required)
:param str pattern_without_delimiter: None (required)
@ -765,7 +765,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -880,7 +880,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -891,11 +891,11 @@ class FakeApi(object):
To test enum parameters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_enum_parameters(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_enum_parameters(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] enum_header_string_array: Header parameter enum test (string array)
:param str enum_header_string: Header parameter enum test (string)
:param list[str] enum_query_string_array: Query parameter enum test (string array)
@ -909,7 +909,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
@ -920,11 +920,11 @@ class FakeApi(object):
To test enum parameters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_enum_parameters_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_enum_parameters_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] enum_header_string_array: Header parameter enum test (string array)
:param str enum_header_string: Header parameter enum test (string)
:param list[str] enum_query_string_array: Query parameter enum test (string array)
@ -941,7 +941,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double', 'enum_form_string_array', 'enum_form_string'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1003,7 +1003,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -1013,18 +1013,18 @@ class FakeApi(object):
"""test inline additionalProperties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_inline_additional_properties(request_body, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_inline_additional_properties(request_body, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param dict(str, str) request_body: request body (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
else:
(data) = self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
@ -1034,11 +1034,11 @@ class FakeApi(object):
"""test inline additionalProperties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_inline_additional_properties_with_http_info(request_body, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_inline_additional_properties_with_http_info(request_body, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param dict(str, str) request_body: request body (required)
:return: None
If the method is called asynchronously,
@ -1048,7 +1048,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['request_body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1097,7 +1097,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -1107,11 +1107,11 @@ class FakeApi(object):
"""test json serialization of form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_json_form_data(param, param2, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_json_form_data(param, param2, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str param: field1 (required)
:param str param2: field2 (required)
:return: None
@ -1119,7 +1119,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
else:
(data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
@ -1129,11 +1129,11 @@ class FakeApi(object):
"""test json serialization of form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_json_form_data_with_http_info(param, param2, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str param: field1 (required)
:param str param2: field2 (required)
:return: None
@ -1144,7 +1144,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['param', 'param2'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1199,7 +1199,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class FakeClassnameTags123Api(object):
To test class name in snake case # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_classname(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_classname_with_http_info(client, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class FakeClassnameTags123Api(object):
To test class name in snake case # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_classname_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -73,7 +73,7 @@ class FakeClassnameTags123Api(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -126,7 +126,7 @@ class FakeClassnameTags123Api(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -36,18 +36,18 @@ class PetApi(object):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_pet(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
else:
(data) = self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
@ -57,11 +57,11 @@ class PetApi(object):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet_with_http_info(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_pet_with_http_info(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
@ -71,7 +71,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -120,7 +120,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -130,11 +130,11 @@ class PetApi(object):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pet(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
@ -142,7 +142,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
@ -152,11 +152,11 @@ class PetApi(object):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
@ -167,7 +167,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -214,7 +214,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -225,18 +225,18 @@ class PetApi(object):
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status(status, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status(status, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
else:
(data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
@ -247,11 +247,11 @@ class PetApi(object):
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status_with_http_info(status, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
@ -261,7 +261,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['status'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -311,7 +311,7 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -322,18 +322,18 @@ class PetApi(object):
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags(tags, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_tags(tags, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
else:
(data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
@ -344,11 +344,11 @@ class PetApi(object):
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
@ -358,7 +358,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['tags'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -408,7 +408,7 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -419,18 +419,18 @@ class PetApi(object):
Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_pet_by_id(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
@ -441,11 +441,11 @@ class PetApi(object):
Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
@ -455,7 +455,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -504,7 +504,7 @@ class PetApi(object):
files=local_var_files,
response_type='Pet', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -514,18 +514,18 @@ class PetApi(object):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
else:
(data) = self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
@ -535,11 +535,11 @@ class PetApi(object):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_http_info(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_http_info(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
@ -549,7 +549,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -598,7 +598,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -608,11 +608,11 @@ class PetApi(object):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_form(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
@ -621,7 +621,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
@ -631,11 +631,11 @@ class PetApi(object):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
@ -647,7 +647,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'name', 'status'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -700,7 +700,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -710,11 +710,11 @@ class PetApi(object):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
@ -723,7 +723,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
@ -733,11 +733,11 @@ class PetApi(object):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
@ -749,7 +749,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -806,7 +806,7 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -816,11 +816,11 @@ class PetApi(object):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
@ -829,7 +829,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
else:
(data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
@ -839,11 +839,11 @@ class PetApi(object):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
@ -855,7 +855,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -916,7 +916,7 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class StoreApi(object):
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_order(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
else:
(data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class StoreApi(object):
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order_with_http_info(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_order_with_http_info(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
@ -73,7 +73,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class StoreApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -129,17 +129,17 @@ class StoreApi(object):
Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_inventory(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501
@ -150,11 +150,11 @@ class StoreApi(object):
Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_inventory_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
@ -163,7 +163,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -206,7 +206,7 @@ class StoreApi(object):
files=local_var_files,
response_type='dict(str, int)', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -217,18 +217,18 @@ class StoreApi(object):
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_order_by_id(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
else:
(data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
@ -239,11 +239,11 @@ class StoreApi(object):
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
@ -253,7 +253,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -306,7 +306,7 @@ class StoreApi(object):
files=local_var_files,
response_type='Order', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -316,18 +316,18 @@ class StoreApi(object):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.place_order(order, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.place_order(order, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Order order: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.place_order_with_http_info(order, **kwargs) # noqa: E501
else:
(data) = self.place_order_with_http_info(order, **kwargs) # noqa: E501
@ -337,11 +337,11 @@ class StoreApi(object):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.place_order_with_http_info(order, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.place_order_with_http_info(order, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Order order: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
@ -351,7 +351,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -400,7 +400,7 @@ class StoreApi(object):
files=local_var_files,
response_type='Order', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_user(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param User user: Created user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_user_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_user_with_http_info(user, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_user_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param User user: Created user object (required)
:return: None
If the method is called asynchronously,
@ -73,7 +73,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -128,18 +128,18 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_array_input(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
@ -149,11 +149,11 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
@ -163,7 +163,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -208,7 +208,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -218,18 +218,18 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_list_input(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
@ -239,11 +239,11 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
@ -253,7 +253,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -298,7 +298,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -309,18 +309,18 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_user(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
else:
(data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501
@ -331,11 +331,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user_with_http_info(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_user_with_http_info(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
@ -345,7 +345,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -390,7 +390,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -400,18 +400,18 @@ class UserApi(object):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_user_by_name(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
else:
(data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
@ -421,11 +421,11 @@ class UserApi(object):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name_with_http_info(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
@ -435,7 +435,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -484,7 +484,7 @@ class UserApi(object):
files=local_var_files,
response_type='User', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -494,11 +494,11 @@ class UserApi(object):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_user(username, password, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_user(username, password, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
@ -506,7 +506,7 @@ class UserApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
else:
(data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
@ -516,11 +516,11 @@ class UserApi(object):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_user_with_http_info(username, password, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_user_with_http_info(username, password, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
@ -531,7 +531,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username', 'password'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -586,7 +586,7 @@ class UserApi(object):
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -596,17 +596,17 @@ class UserApi(object):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.logout_user(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.logout_user_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.logout_user_with_http_info(**kwargs) # noqa: E501
@ -616,11 +616,11 @@ class UserApi(object):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.logout_user_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: None
If the method is called asynchronously,
returns the request thread.
@ -629,7 +629,7 @@ class UserApi(object):
local_var_params = locals()
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -668,7 +668,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -679,11 +679,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user(username, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_user(username, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: name that need to be deleted (required)
:param User user: Updated user object (required)
:return: None
@ -691,7 +691,7 @@ class UserApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
else:
(data) = self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
@ -702,11 +702,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user_with_http_info(username, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_user_with_http_info(username, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: name that need to be deleted (required)
:param User user: Updated user object (required)
:return: None
@ -717,7 +717,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username', 'user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -768,7 +768,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -275,12 +275,12 @@ class ApiClient(object):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async parameter.
To make an async_req request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
@ -295,7 +295,7 @@ class ApiClient(object):
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async bool: execute request asynchronously
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query,
@ -308,13 +308,13 @@ class ApiClient(object):
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return:
If async parameter is True,
If async_req parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter async is False or missing,
If parameter async_req is False or missing,
then the method will return the response directly.
"""
if not async:
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,

View File

@ -86,11 +86,11 @@ class PetApiTests(AsyncTestCase):
def test_async_request(self):
# It works but tornado is async by default and creating threadpool
# to do it looks crazy ;)
thread = self.pet_api.add_pet(self.pet, async=True)
thread = self.pet_api.add_pet(self.pet, async_req=True)
response = yield thread.get()
self.assertIsNone(response)
thread = self.pet_api.get_pet_by_id(self.pet.id, async=True)
thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
result = yield thread.get()
self.assertIsInstance(result, petstore_api.Pet)
@ -98,8 +98,8 @@ class PetApiTests(AsyncTestCase):
def test_async_with_result(self):
yield self.pet_api.add_pet(self.pet)
thread = self.pet_api.get_pet_by_id(self.pet.id, async=True)
thread2 = self.pet_api.get_pet_by_id(self.pet.id, async=True)
thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
response = yield thread.get()
response2 = yield thread2.get()

View File

@ -37,18 +37,18 @@ class AnotherFakeApi(object):
To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_special_tags(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_special_tags_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_special_tags_with_http_info(client, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class AnotherFakeApi(object):
To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_special_tags_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -73,7 +73,7 @@ class AnotherFakeApi(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -126,7 +126,7 @@ class AnotherFakeApi(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class FakeApi(object):
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_boolean_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param bool body: Input boolean as post body
:return: bool
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
@ -59,11 +59,11 @@ class FakeApi(object):
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param bool body: Input boolean as post body
:return: bool
If the method is called asynchronously,
@ -73,7 +73,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class FakeApi(object):
files=local_var_files,
response_type='bool', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -129,18 +129,18 @@ class FakeApi(object):
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_composite_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param OuterComposite outer_composite: Input composite as post body
:return: OuterComposite
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
@ -151,11 +151,11 @@ class FakeApi(object):
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_composite_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param OuterComposite outer_composite: Input composite as post body
:return: OuterComposite
If the method is called asynchronously,
@ -165,7 +165,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['outer_composite'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -210,7 +210,7 @@ class FakeApi(object):
files=local_var_files,
response_type='OuterComposite', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -221,18 +221,18 @@ class FakeApi(object):
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_number_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float body: Input number as post body
:return: float
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
@ -243,11 +243,11 @@ class FakeApi(object):
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_number_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float body: Input number as post body
:return: float
If the method is called asynchronously,
@ -257,7 +257,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -302,7 +302,7 @@ class FakeApi(object):
files=local_var_files,
response_type='float', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -313,18 +313,18 @@ class FakeApi(object):
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_string_serialize(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str body: Input string as post body
:return: str
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
@ -335,11 +335,11 @@ class FakeApi(object):
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.fake_outer_string_serialize_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str body: Input string as post body
:return: str
If the method is called asynchronously,
@ -349,7 +349,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -394,7 +394,7 @@ class FakeApi(object):
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -405,18 +405,18 @@ class FakeApi(object):
For this test, the body for this request much reference a schema named `File`. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_file_schema(file_schema_test_class, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param FileSchemaTestClass file_schema_test_class: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
else:
(data) = self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
@ -427,11 +427,11 @@ class FakeApi(object):
For this test, the body for this request much reference a schema named `File`. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param FileSchemaTestClass file_schema_test_class: (required)
:return: None
If the method is called asynchronously,
@ -441,7 +441,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['file_schema_test_class'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -490,7 +490,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -500,11 +500,11 @@ class FakeApi(object):
"""test_body_with_query_params # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_query_params(query, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_query_params(query, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str query: (required)
:param User user: (required)
:return: None
@ -512,7 +512,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
else:
(data) = self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
@ -522,11 +522,11 @@ class FakeApi(object):
"""test_body_with_query_params # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_body_with_query_params_with_http_info(query, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str query: (required)
:param User user: (required)
:return: None
@ -537,7 +537,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['query', 'user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -592,7 +592,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -603,18 +603,18 @@ class FakeApi(object):
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_client_model(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_client_model(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
@ -625,11 +625,11 @@ class FakeApi(object):
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_client_model_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_client_model_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -639,7 +639,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -692,7 +692,7 @@ class FakeApi(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -703,11 +703,11 @@ class FakeApi(object):
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float number: None (required)
:param float double: None (required)
:param str pattern_without_delimiter: None (required)
@ -727,7 +727,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
else:
(data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
@ -738,11 +738,11 @@ class FakeApi(object):
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param float number: None (required)
:param float double: None (required)
:param str pattern_without_delimiter: None (required)
@ -765,7 +765,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -880,7 +880,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -891,11 +891,11 @@ class FakeApi(object):
To test enum parameters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_enum_parameters(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_enum_parameters(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] enum_header_string_array: Header parameter enum test (string array)
:param str enum_header_string: Header parameter enum test (string)
:param list[str] enum_query_string_array: Query parameter enum test (string array)
@ -909,7 +909,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
@ -920,11 +920,11 @@ class FakeApi(object):
To test enum parameters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_enum_parameters_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_enum_parameters_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] enum_header_string_array: Header parameter enum test (string array)
:param str enum_header_string: Header parameter enum test (string)
:param list[str] enum_query_string_array: Query parameter enum test (string array)
@ -941,7 +941,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double', 'enum_form_string_array', 'enum_form_string'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1003,7 +1003,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -1013,18 +1013,18 @@ class FakeApi(object):
"""test inline additionalProperties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_inline_additional_properties(request_body, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_inline_additional_properties(request_body, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param dict(str, str) request_body: request body (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
else:
(data) = self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
@ -1034,11 +1034,11 @@ class FakeApi(object):
"""test inline additionalProperties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_inline_additional_properties_with_http_info(request_body, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_inline_additional_properties_with_http_info(request_body, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param dict(str, str) request_body: request body (required)
:return: None
If the method is called asynchronously,
@ -1048,7 +1048,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['request_body'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1097,7 +1097,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -1107,11 +1107,11 @@ class FakeApi(object):
"""test json serialization of form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_json_form_data(param, param2, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_json_form_data(param, param2, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str param: field1 (required)
:param str param2: field2 (required)
:return: None
@ -1119,7 +1119,7 @@ class FakeApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
else:
(data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
@ -1129,11 +1129,11 @@ class FakeApi(object):
"""test json serialization of form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_json_form_data_with_http_info(param, param2, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str param: field1 (required)
:param str param2: field2 (required)
:return: None
@ -1144,7 +1144,7 @@ class FakeApi(object):
local_var_params = locals()
all_params = ['param', 'param2'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -1199,7 +1199,7 @@ class FakeApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class FakeClassnameTags123Api(object):
To test class name in snake case # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_classname(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
else:
(data) = self.test_classname_with_http_info(client, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class FakeClassnameTags123Api(object):
To test class name in snake case # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname_with_http_info(client, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_classname_with_http_info(client, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Client client: client model (required)
:return: Client
If the method is called asynchronously,
@ -73,7 +73,7 @@ class FakeClassnameTags123Api(object):
local_var_params = locals()
all_params = ['client'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -126,7 +126,7 @@ class FakeClassnameTags123Api(object):
files=local_var_files,
response_type='Client', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -36,18 +36,18 @@ class PetApi(object):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_pet(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
else:
(data) = self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
@ -57,11 +57,11 @@ class PetApi(object):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet_with_http_info(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_pet_with_http_info(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
@ -71,7 +71,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -120,7 +120,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -130,11 +130,11 @@ class PetApi(object):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pet(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
@ -142,7 +142,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
@ -152,11 +152,11 @@ class PetApi(object):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
@ -167,7 +167,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -214,7 +214,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -225,18 +225,18 @@ class PetApi(object):
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status(status, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status(status, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
else:
(data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
@ -247,11 +247,11 @@ class PetApi(object):
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status_with_http_info(status, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
@ -261,7 +261,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['status'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -311,7 +311,7 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -322,18 +322,18 @@ class PetApi(object):
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags(tags, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_tags(tags, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
else:
(data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
@ -344,11 +344,11 @@ class PetApi(object):
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
@ -358,7 +358,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['tags'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -408,7 +408,7 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -419,18 +419,18 @@ class PetApi(object):
Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_pet_by_id(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
@ -441,11 +441,11 @@ class PetApi(object):
Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
@ -455,7 +455,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -504,7 +504,7 @@ class PetApi(object):
files=local_var_files,
response_type='Pet', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -514,18 +514,18 @@ class PetApi(object):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
else:
(data) = self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
@ -535,11 +535,11 @@ class PetApi(object):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_http_info(pet, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_http_info(pet, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Pet pet: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
@ -549,7 +549,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -598,7 +598,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -608,11 +608,11 @@ class PetApi(object):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_form(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
@ -621,7 +621,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
@ -631,11 +631,11 @@ class PetApi(object):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
@ -647,7 +647,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'name', 'status'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -700,7 +700,7 @@ class PetApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -710,11 +710,11 @@ class PetApi(object):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
@ -723,7 +723,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
else:
(data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
@ -733,11 +733,11 @@ class PetApi(object):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_http_info(pet_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
@ -749,7 +749,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -806,7 +806,7 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -816,11 +816,11 @@ class PetApi(object):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
@ -829,7 +829,7 @@ class PetApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
else:
(data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
@ -839,11 +839,11 @@ class PetApi(object):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int pet_id: ID of pet to update (required)
:param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
@ -855,7 +855,7 @@ class PetApi(object):
local_var_params = locals()
all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -916,7 +916,7 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class StoreApi(object):
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_order(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
else:
(data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class StoreApi(object):
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order_with_http_info(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_order_with_http_info(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
@ -73,7 +73,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class StoreApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -129,17 +129,17 @@ class StoreApi(object):
Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_inventory(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501
@ -150,11 +150,11 @@ class StoreApi(object):
Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_inventory_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
@ -163,7 +163,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -206,7 +206,7 @@ class StoreApi(object):
files=local_var_files,
response_type='dict(str, int)', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -217,18 +217,18 @@ class StoreApi(object):
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_order_by_id(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
else:
(data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
@ -239,11 +239,11 @@ class StoreApi(object):
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
@ -253,7 +253,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order_id'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -306,7 +306,7 @@ class StoreApi(object):
files=local_var_files,
response_type='Order', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -316,18 +316,18 @@ class StoreApi(object):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.place_order(order, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.place_order(order, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Order order: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.place_order_with_http_info(order, **kwargs) # noqa: E501
else:
(data) = self.place_order_with_http_info(order, **kwargs) # noqa: E501
@ -337,11 +337,11 @@ class StoreApi(object):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.place_order_with_http_info(order, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.place_order_with_http_info(order, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param Order order: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
@ -351,7 +351,7 @@ class StoreApi(object):
local_var_params = locals()
all_params = ['order'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -400,7 +400,7 @@ class StoreApi(object):
files=local_var_files,
response_type='Order', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -37,18 +37,18 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_user(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param User user: Created user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_user_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_user_with_http_info(user, **kwargs) # noqa: E501
@ -59,11 +59,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_user_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param User user: Created user object (required)
:return: None
If the method is called asynchronously,
@ -73,7 +73,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -118,7 +118,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -128,18 +128,18 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_array_input(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
@ -149,11 +149,11 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
@ -163,7 +163,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -208,7 +208,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -218,18 +218,18 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_list_input(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
@ -239,11 +239,11 @@ class UserApi(object):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input_with_http_info(user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param list[User] user: List of user object (required)
:return: None
If the method is called asynchronously,
@ -253,7 +253,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -298,7 +298,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -309,18 +309,18 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_user(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
else:
(data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501
@ -331,11 +331,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user_with_http_info(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_user_with_http_info(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
@ -345,7 +345,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -390,7 +390,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -400,18 +400,18 @@ class UserApi(object):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_user_by_name(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
else:
(data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
@ -421,11 +421,11 @@ class UserApi(object):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name_with_http_info(username, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
@ -435,7 +435,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -484,7 +484,7 @@ class UserApi(object):
files=local_var_files,
response_type='User', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -494,11 +494,11 @@ class UserApi(object):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_user(username, password, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_user(username, password, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
@ -506,7 +506,7 @@ class UserApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
else:
(data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
@ -516,11 +516,11 @@ class UserApi(object):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_user_with_http_info(username, password, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_user_with_http_info(username, password, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
@ -531,7 +531,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username', 'password'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -586,7 +586,7 @@ class UserApi(object):
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -596,17 +596,17 @@ class UserApi(object):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.logout_user(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.logout_user_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.logout_user_with_http_info(**kwargs) # noqa: E501
@ -616,11 +616,11 @@ class UserApi(object):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.logout_user_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: None
If the method is called asynchronously,
returns the request thread.
@ -629,7 +629,7 @@ class UserApi(object):
local_var_params = locals()
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -668,7 +668,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
@ -679,11 +679,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user(username, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_user(username, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: name that need to be deleted (required)
:param User user: Updated user object (required)
:return: None
@ -691,7 +691,7 @@ class UserApi(object):
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
else:
(data) = self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
@ -702,11 +702,11 @@ class UserApi(object):
This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user_with_http_info(username, user, async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_user_with_http_info(username, user, async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:param str username: name that need to be deleted (required)
:param User user: Updated user object (required)
:return: None
@ -717,7 +717,7 @@ class UserApi(object):
local_var_params = locals()
all_params = ['username', 'user'] # noqa: E501
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
@ -768,7 +768,7 @@ class UserApi(object):
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=local_var_params.get('async'),
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),

View File

@ -273,12 +273,12 @@ class ApiClient(object):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async parameter.
To make an async_req request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
@ -293,7 +293,7 @@ class ApiClient(object):
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async bool: execute request asynchronously
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query,
@ -306,13 +306,13 @@ class ApiClient(object):
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return:
If async parameter is True,
If async_req parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter async is False or missing,
If parameter async_req is False or missing,
then the method will return the response directly.
"""
if not async:
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,

View File

@ -140,19 +140,19 @@ class PetApiTests(unittest.TestCase):
self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host)
def test_async_request(self):
thread = self.pet_api.add_pet(self.pet, async=True)
thread = self.pet_api.add_pet(self.pet, async_req=True)
response = thread.get()
self.assertIsNone(response)
thread = self.pet_api.get_pet_by_id(self.pet.id, async=True)
thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
result = thread.get()
self.assertIsInstance(result, petstore_api.Pet)
def test_async_with_result(self):
self.pet_api.add_pet(self.pet, async=False)
self.pet_api.add_pet(self.pet, async_req=False)
thread = self.pet_api.get_pet_by_id(self.pet.id, async=True)
thread2 = self.pet_api.get_pet_by_id(self.pet.id, async=True)
thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
response = thread.get()
response2 = thread2.get()
@ -163,7 +163,7 @@ class PetApiTests(unittest.TestCase):
def test_async_with_http_info(self):
self.pet_api.add_pet(self.pet)
thread = self.pet_api.get_pet_by_id_with_http_info(self.pet.id, async=True)
thread = self.pet_api.get_pet_by_id_with_http_info(self.pet.id, async_req=True)
data, status, headers = thread.get()
self.assertIsInstance(data, petstore_api.Pet)
@ -172,7 +172,7 @@ class PetApiTests(unittest.TestCase):
def test_async_exception(self):
self.pet_api.add_pet(self.pet)
thread = self.pet_api.get_pet_by_id("-9999999999999", async=True)
thread = self.pet_api.get_pet_by_id("-9999999999999", async_req=True)
exception = None
try:

View File

@ -1 +1 @@
3.0.2-SNAPSHOT
3.1.2-SNAPSHOT

View File

@ -2,7 +2,25 @@ cmake_minimum_required (VERSION 3.2)
project(server)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pg -g3" )
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
ExternalProject_Add(PISTACHE
GIT_REPOSITORY https://github.com/oktal/pistache.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
ExternalProject_Add(NLOHMANN
GIT_REPOSITORY https://github.com/nlohmann/json.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include/nlohmann)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
link_directories(/usr/local/lib/)

View File

@ -59,11 +59,14 @@ void PetApi::setupRoutes() {
void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
Pet pet;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
pet.fromJson(request_body);
this->add_pet(pet, response);
} catch (std::runtime_error & e) {
//send a 400 error
@ -132,11 +135,14 @@ void PetApi::get_pet_by_id_handler(const Pistache::Rest::Request &request, Pista
void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
Pet pet;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
pet.fromJson(request_body);
this->update_pet(pet, response);
} catch (std::runtime_error & e) {
//send a 400 error

View File

@ -71,7 +71,7 @@ private:
///
/// </remarks>
/// <param name="pet">Pet object that needs to be added to the store</param>
virtual void add_pet(const std::shared_ptr<Pet> &pet, Pistache::Http::ResponseWriter &response) = 0;
virtual void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Deletes a pet
@ -117,7 +117,7 @@ private:
///
/// </remarks>
/// <param name="pet">Pet object that needs to be added to the store</param>
virtual void update_pet(const std::shared_ptr<Pet> &pet, Pistache::Http::ResponseWriter &response) = 0;
virtual void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Updates a pet in the store with form data

View File

@ -92,11 +92,14 @@ void StoreApi::get_order_by_id_handler(const Pistache::Rest::Request &request, P
void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
Order order;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
order.fromJson(request_body);
this->place_order(order, response);
} catch (std::runtime_error & e) {
//send a 400 error

View File

@ -93,7 +93,7 @@ private:
///
/// </remarks>
/// <param name="order">order placed for purchasing the pet</param>
virtual void place_order(const std::shared_ptr<Order> &order, Pistache::Http::ResponseWriter &response) = 0;
virtual void place_order(const Order &order, Pistache::Http::ResponseWriter &response) = 0;
};

View File

@ -59,11 +59,14 @@ void UserApi::setupRoutes() {
void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
User user;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
user.fromJson(request_body);
this->create_user(user, response);
} catch (std::runtime_error & e) {
//send a 400 error
@ -75,11 +78,11 @@ void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistac
void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
std::vector user;
std::vector<User> user;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
user.fromJson(request_body);
user = ModelArrayHelper::fromJson<User>(request_body);
this->create_users_with_array_input(user, response);
} catch (std::runtime_error & e) {
//send a 400 error
@ -91,11 +94,11 @@ void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Reques
void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
std::vector user;
std::vector<User> user;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
user.fromJson(request_body);
user = ModelArrayHelper::fromJson<User>(request_body);
this->create_users_with_list_input(user, response);
} catch (std::runtime_error & e) {
//send a 400 error
@ -161,11 +164,14 @@ void UserApi::update_user_handler(const Pistache::Rest::Request &request, Pistac
auto username = request.param(":username").as<std::string>();
// Getting the body param
User user;
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
user.fromJson(request_body);
this->update_user(username, user, response);
} catch (std::runtime_error & e) {
//send a 400 error

View File

@ -71,7 +71,7 @@ private:
/// This can only be done by the logged in user.
/// </remarks>
/// <param name="user">Created user object</param>
virtual void create_user(const std::shared_ptr<User> &user, Pistache::Http::ResponseWriter &response) = 0;
virtual void create_user(const User &user, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Creates list of users with given input array
@ -135,7 +135,7 @@ private:
/// </remarks>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
virtual void update_user(const std::string &username, const std::shared_ptr<User> &user, Pistache::Http::ResponseWriter &response) = 0;
virtual void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) = 0;
};

View File

@ -0,0 +1,8 @@
#!/bin/bash
# build C++ pistache petstore
#
mkdir build
cd build
cmake ..
make

View File

@ -23,7 +23,7 @@ PetApiImpl::PetApiImpl(Pistache::Address addr)
: PetApi(addr)
{ }
void PetApiImpl::add_pet(const std::shared_ptr<Pet> &pet, Pistache::Http::ResponseWriter &response) {
void PetApiImpl::add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void PetApiImpl::delete_pet(const int64_t &petId, const Pistache::Optional<Pistache::Http::Header::Raw> &apiKey, Pistache::Http::ResponseWriter &response) {
@ -38,7 +38,7 @@ void PetApiImpl::find_pets_by_tags(const Pistache::Optional<std::string> &tags,
void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void PetApiImpl::update_pet(const std::shared_ptr<Pet> &pet, Pistache::Http::ResponseWriter &response) {
void PetApiImpl::update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void PetApiImpl::update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){

View File

@ -45,12 +45,12 @@ public:
PetApiImpl(Pistache::Address addr);
~PetApiImpl() { };
void add_pet(const std::shared_ptr<Pet> &pet, Pistache::Http::ResponseWriter &response);
void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response);
void delete_pet(const int64_t &petId, const Pistache::Optional<Pistache::Http::Header::Raw> &apiKey, Pistache::Http::ResponseWriter &response);
void find_pets_by_status(const Pistache::Optional<std::string> &status, Pistache::Http::ResponseWriter &response);
void find_pets_by_tags(const Pistache::Optional<std::string> &tags, Pistache::Http::ResponseWriter &response);
void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response);
void update_pet(const std::shared_ptr<Pet> &pet, Pistache::Http::ResponseWriter &response);
void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response);
void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response);
void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response);

View File

@ -32,7 +32,7 @@ void StoreApiImpl::get_inventory(Pistache::Http::ResponseWriter &response) {
void StoreApiImpl::get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void StoreApiImpl::place_order(const std::shared_ptr<Order> &order, Pistache::Http::ResponseWriter &response) {
void StoreApiImpl::place_order(const Order &order, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}

View File

@ -48,7 +48,7 @@ public:
void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response);
void get_inventory(Pistache::Http::ResponseWriter &response);
void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response);
void place_order(const std::shared_ptr<Order> &order, Pistache::Http::ResponseWriter &response);
void place_order(const Order &order, Pistache::Http::ResponseWriter &response);
};

View File

@ -23,7 +23,7 @@ UserApiImpl::UserApiImpl(Pistache::Address addr)
: UserApi(addr)
{ }
void UserApiImpl::create_user(const std::shared_ptr<User> &user, Pistache::Http::ResponseWriter &response) {
void UserApiImpl::create_user(const User &user, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void UserApiImpl::create_users_with_array_input(const std::vector<User> &user, Pistache::Http::ResponseWriter &response) {
@ -44,7 +44,7 @@ void UserApiImpl::login_user(const Pistache::Optional<std::string> &username, co
void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void UserApiImpl::update_user(const std::string &username, const std::shared_ptr<User> &user, Pistache::Http::ResponseWriter &response) {
void UserApiImpl::update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}

View File

@ -45,14 +45,14 @@ public:
UserApiImpl(Pistache::Address addr);
~UserApiImpl() { };
void create_user(const std::shared_ptr<User> &user, Pistache::Http::ResponseWriter &response);
void create_user(const User &user, Pistache::Http::ResponseWriter &response);
void create_users_with_array_input(const std::vector<User> &user, Pistache::Http::ResponseWriter &response);
void create_users_with_list_input(const std::vector<User> &user, Pistache::Http::ResponseWriter &response);
void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response);
void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response);
void login_user(const Pistache::Optional<std::string> &username, const Pistache::Optional<std::string> &password, Pistache::Http::ResponseWriter &response);
void logout_user(Pistache::Http::ResponseWriter &response);
void update_user(const std::string &username, const std::shared_ptr<User> &user, Pistache::Http::ResponseWriter &response);
void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response);
};

View File

@ -0,0 +1,13 @@
#/bin/bash
# ref: http://pistache.io/quickstart#installing-pistache
#
echo "Installing Pistache ..."
git clone https://github.com/oktal/pistache.git || true
cd pistache
git submodule update --init
mkdir -p build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install

View File

@ -68,12 +68,10 @@ void ApiResponse::fromJson(nlohmann::json& val)
if(val.find("type") != val.end())
{
setType(val.at("type"));
}
if(val.find("message") != val.end())
{
setMessage(val.at("message"));
}
}

View File

@ -62,7 +62,6 @@ void Category::fromJson(nlohmann::json& val)
if(val.find("name") != val.end())
{
setName(val.at("name"));
}
}

View File

@ -55,7 +55,7 @@ bool ModelBase::toJson( bool const value )
return value;
}
nlohmann::json ModelBase::toJson(ModelBase content )
nlohmann::json ModelBase::toJson(ModelBase const& content )
{
return content.toJson();
}

View File

@ -22,6 +22,8 @@
#include "json.hpp"
#include <ctime>
#include <string>
#include <vector>
#include <map>
namespace org {
namespace openapitools {
@ -45,8 +47,103 @@ public:
static int64_t toJson( int64_t const value );
static double toJson( double const value );
static bool toJson( bool const value );
static nlohmann::json toJson(ModelBase const& content );
static nlohmann::json toJson(ModelBase const& content );
};
class ModelArrayHelper {
public:
template<typename T>
static std::vector<T> fromJson(nlohmann::json& json) {
T *ptrTest;
std::vector<T> val;
if (dynamic_cast<ModelBase*>(ptrTest) != nullptr) {
if (!json.empty()) {
for (auto &item : json.items()) {
T entry;
entry.fromJson(item.value());
val.push_back(entry);
}
}
}
return val;
}
template<typename T>
static nlohmann::json toJson(std::vector<T> val) {
nlohmann::json json;
for(auto item : val){
json.push_back(item.toJson());
}
return json;
}
};
class ArrayHelper {
public:
template<typename T>
static std::vector<T> fromJson(nlohmann::json& json) {
std::vector<T> val;
nlohmann::from_json(json, val);
return val;
}
template<typename T>
static nlohmann::json toJson(std::vector<T> val) {
nlohmann::json json;
nlohmann::to_json(json, val);
return json;
}
};
class ModelMapHelper {
public:
template<typename T>
static std::map<std::string, T> & fromJson(nlohmann::json& json) {
T *ptrTest;
std::map<std::string, T> val;
if (dynamic_cast<ModelBase*>(ptrTest) != nullptr) {
if (!json.empty()) {
for (auto &item : json.items()) {
T entry;
entry.fromJson(item.value());
val.insert(val.end(),
std::pair<std::string, T>(item.key(), entry));
}
}
}
return val;
}
template<typename T>
static nlohmann::json toJson(std::map<std::string, T> val) {
nlohmann::json json;
for (auto const& item : val) {
json[item.first] = item.second.toJson();
}
return json;
}
};
class MapHelper {
public:
template<typename T>
static std::map<std::string, T> & fromJson(nlohmann::json& json) {
std::map<std::string, T> val;
if (!json.empty()) {
for (auto &item : json.items()) {
T entry = item.value();
val.insert(val.end(),
std::pair<std::string, T>(item.key(), entry));
}
}
return val;
}
template<typename T>
static nlohmann::json toJson(std::map<std::string, T> val) {
nlohmann::json json;
for (auto const& item : val) {
nlohmann::json jitem = item.second;
json[item.first] = jitem;
}
return json;
}
};
}

View File

@ -99,7 +99,6 @@ void Order::fromJson(nlohmann::json& val)
if(val.find("status") != val.end())
{
setStatus(val.at("status"));
}
if(val.find("complete") != val.end())
{

View File

@ -91,7 +91,7 @@ void Pet::fromJson(nlohmann::json& val)
{
if(!val["category"].is_null())
{
Category newItem(Category());
Category newItem;
newItem.fromJson(val["category"]);
setCategory( newItem );
}
@ -117,11 +117,11 @@ void Pet::fromJson(nlohmann::json& val)
if(item.is_null())
{
m_Tags.push_back( Tag(nullptr) );
m_Tags.push_back( Tag() );
}
else
{
Tag newItem(Tag());
Tag newItem;
newItem.fromJson(item);
m_Tags.push_back( newItem );
}
@ -132,7 +132,6 @@ void Pet::fromJson(nlohmann::json& val)
if(val.find("status") != val.end())
{
setStatus(val.at("status"));
}
}

View File

@ -62,7 +62,6 @@ void Tag::fromJson(nlohmann::json& val)
if(val.find("name") != val.end())
{
setName(val.at("name"));
}
}

View File

@ -98,32 +98,26 @@ void User::fromJson(nlohmann::json& val)
if(val.find("username") != val.end())
{
setUsername(val.at("username"));
}
if(val.find("firstName") != val.end())
{
setFirstName(val.at("firstName"));
}
if(val.find("lastName") != val.end())
{
setLastName(val.at("lastName"));
}
if(val.find("email") != val.end())
{
setEmail(val.at("email"));
}
if(val.find("password") != val.end())
{
setPassword(val.at("password"));
}
if(val.find("phone") != val.end())
{
setPhone(val.at("phone"));
}
if(val.find("userStatus") != val.end())
{

View File

@ -0,0 +1,53 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>CppPistacheServerTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>C++ Pistache Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>install-pistache</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./install_pistache.sh</executable>
</configuration>
</execution>
<execution>
<id>build-pistache</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./build_petstore.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1 +1 @@
4.0.0-SNAPSHOT
4.0.0-SNAPSHOT

View File

@ -7,8 +7,8 @@ license = "Unlicense"
[features]
default = ["client", "server"]
client = ["serde_json", "serde_urlencoded", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid", "multipart"]
server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid", "multipart"]
client = ["serde_json", "serde_urlencoded", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"]
server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"]
[dependencies]
# Required by example server.

View File

@ -657,6 +657,19 @@ paths:
- -1.2
format: double
type: number
requestBody:
content:
application/x-www-form-urlencoded:
schema:
properties:
enum_form_string:
default: -efg
description: Form parameter enum test (string)
enum:
- _abc
- -efg
- (xyz)
type: string
responses:
400:
content: {}
@ -738,6 +751,10 @@ paths:
description: None
pattern: ^[A-Z].*
type: string
byte:
description: None
format: byte
type: string
binary:
description: None
format: binary
@ -760,6 +777,7 @@ paths:
description: None
type: string
required:
- byte
- double
- number
- pattern_without_delimiter
@ -1247,6 +1265,13 @@ components:
$ref: '#/components/schemas/ReadOnlyFirst'
type: array
type: array
array_of_enum:
items:
enum:
- UPPER
- lower
type: string
type: array
type: object
OuterComposite:
example:
@ -1297,6 +1322,9 @@ components:
format: byte
pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
type: string
binary:
format: binary
type: string
date:
format: date
type: string
@ -1331,6 +1359,15 @@ components:
- crab
type: string
type: array
array_array_enum:
items:
items:
enum:
- Cat
- Dog
type: string
type: array
type: array
type: object
OuterString:
type: string
@ -1370,6 +1407,15 @@ components:
type: string
type: object
type: object
map_map_of_enum:
additionalProperties:
additionalProperties:
enum:
- UPPER
- lower
type: string
type: object
type: object
map_of_enum_string:
additionalProperties:
enum:

View File

@ -160,12 +160,12 @@ fn main() {
// },
Some("TestEndpointParameters") => {
let result = core.run(client.test_endpoint_parameters(8.14, 1.2, "pattern_without_delimiter_example".to_string(), Some(56), Some(56), Some(789), Some(3.4), Some("string_example".to_string()), Box::new(future::ok(Some(Box::new(stream::once(Ok(b"hello".to_vec()))) as Box<Stream<Item=_, Error=_> + Send>))) as Box<Future<Item=_, Error=_> + Send>, None, None, Some("password_example".to_string()), Some("callback_example".to_string())));
let result = core.run(client.test_endpoint_parameters(8.14, 1.2, "pattern_without_delimiter_example".to_string(), swagger::ByteArray(Vec::from("BYTE_ARRAY_DATA_HERE")), Some(56), Some(56), Some(789), Some(3.4), Some("string_example".to_string()), Some(swagger::ByteArray(Vec::from("BINARY_DATA_HERE"))), None, None, Some("password_example".to_string()), Some("callback_example".to_string())));
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
},
Some("TestEnumParameters") => {
let result = core.run(client.test_enum_parameters(Some(&Vec::new()), Some("enum_header_string_example".to_string()), Some(&Vec::new()), Some("enum_query_string_example".to_string()), Some(56), Some(1.2)));
let result = core.run(client.test_enum_parameters(Some(&Vec::new()), Some("enum_header_string_example".to_string()), Some(&Vec::new()), Some("enum_query_string_example".to_string()), Some(56), Some(1.2), Some("enum_form_string_example".to_string())));
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
},
@ -224,7 +224,7 @@ fn main() {
},
Some("UploadFile") => {
let result = core.run(client.upload_file(789, Some("additional_metadata_example".to_string()), Box::new(future::ok(Some(Box::new(stream::once(Ok(b"hello".to_vec()))) as Box<Stream<Item=_, Error=_> + Send>))) as Box<Future<Item=_, Error=_> + Send>));
let result = core.run(client.upload_file(789, Some("additional_metadata_example".to_string()), Some(swagger::ByteArray(Vec::from("BINARY_DATA_HERE")))));
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
},

View File

@ -4,9 +4,7 @@
use futures::{self, Future};
use chrono;
use futures::Stream;
use std::collections::HashMap;
use std::io::Error;
use std::marker::PhantomData;
use swagger;
@ -111,17 +109,16 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString>{
}
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>, context: &C) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>> {
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Option<swagger::ByteArray>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>, context: &C) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>> {
let context = context.clone();
println!("test_endpoint_parameters({}, {}, \"{}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, integer, int32, int64, float, string, date, date_time, password, callback, context.get().0.clone());
let _ = binary; //Suppresses unused param warning
println!("test_endpoint_parameters({}, {}, \"{}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, context.get().0.clone());
Box::new(futures::failed("Generic failure".into()))
}
/// To test enum parameters
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>, context: &C) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>> {
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>, enum_form_string: Option<String>, context: &C) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>> {
let context = context.clone();
println!("test_enum_parameters({:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, context.get().0.clone());
println!("test_enum_parameters({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, enum_form_string, context.get().0.clone());
Box::new(futures::failed("Generic failure".into()))
}
@ -196,10 +193,9 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString>{
}
/// uploads an image
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, context: &C) -> Box<Future<Item=UploadFileResponse, Error=ApiError>> {
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Option<swagger::ByteArray>, context: &C) -> Box<Future<Item=UploadFileResponse, Error=ApiError>> {
let context = context.clone();
println!("upload_file({}, {:?}, ) - X-Span-ID: {:?}", pet_id, additional_metadata, context.get().0.clone());
let _ = file; //Suppresses unused param warning
println!("upload_file({}, {:?}, {:?}) - X-Span-ID: {:?}", pet_id, additional_metadata, file, context.get().0.clone());
Box::new(futures::failed("Generic failure".into()))
}

View File

@ -6,11 +6,9 @@ extern crate openssl;
extern crate mime;
extern crate chrono;
extern crate url;
extern crate multipart;
extern crate serde_urlencoded;
use self::multipart::client::lazy::Multipart;
use hyper;
use hyper::header::{Headers, ContentType};
use hyper::Uri;
@ -298,8 +296,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -307,7 +303,6 @@ impl<F, C> Api<C> for Client<F> where
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -378,8 +373,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -387,7 +380,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -456,8 +448,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -465,7 +455,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -534,8 +523,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -543,7 +530,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -612,8 +598,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -621,7 +605,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -692,8 +675,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -757,8 +738,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -766,7 +745,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -807,7 +785,7 @@ if let Some(body) = body {
}
fn test_endpoint_parameters(&self, param_number: f64, param_double: f64, param_pattern_without_delimiter: String, param_integer: Option<i32>, param_int32: Option<i32>, param_int64: Option<i64>, param_float: Option<f32>, param_string: Option<String>, param_binary: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, param_date: Option<chrono::DateTime<chrono::Utc>>, param_date_time: Option<chrono::DateTime<chrono::Utc>>, param_password: Option<String>, param_callback: Option<String>, context: &C) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>> {
fn test_endpoint_parameters(&self, param_number: f64, param_double: f64, param_pattern_without_delimiter: String, param_byte: swagger::ByteArray, param_integer: Option<i32>, param_int32: Option<i32>, param_int64: Option<i64>, param_float: Option<f32>, param_string: Option<String>, param_binary: Option<swagger::ByteArray>, param_date: Option<chrono::DateTime<chrono::Utc>>, param_date_time: Option<chrono::DateTime<chrono::Utc>>, param_password: Option<String>, param_callback: Option<String>, context: &C) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>> {
let uri = format!(
@ -822,41 +800,26 @@ if let Some(body) = body {
let mut request = hyper::Request::new(hyper::Method::Post, uri);
// Form data body
let mut multipart = Multipart::new();
let params = &[
("integer", param_integer.map(|param| format!("{:?}", param))),
("int32", param_int32.map(|param| format!("{:?}", param))),
("int64", param_int64.map(|param| format!("{:?}", param))),
("number", Some(format!("{:?}", param_number))),
("float", param_float.map(|param| format!("{:?}", param))),
("double", Some(format!("{:?}", param_double))),
("string", param_string),
("pattern_without_delimiter", Some(param_pattern_without_delimiter)),
("byte", Some(format!("{:?}", param_byte))),
("binary", param_binary.map(|param| format!("{:?}", param))),
("date", param_date.map(|param| format!("{:?}", param))),
("dateTime", param_date_time.map(|param| format!("{:?}", param))),
("password", param_password),
("callback", param_callback),
];
let body = serde_urlencoded::to_string(params).expect("impossible to fail to serialize");
// Helper function to convert a Stream into a String. The String can then be used to build the HTTP body.
fn convert_stream_to_string(stream: Box<Stream<Item=Vec<u8>, Error=Error> + Send>) -> Result<String, ApiError> {
stream.concat2()
.wait()
.map_err(|e| ApiError(format!("Unable to collect stream: {}", e)))
.and_then(|body| String::from_utf8(body)
.map_err(|e| ApiError(format!("Failed to convert utf8 stream to String: {}", e))))
}
if let Ok(Some(param_binary)) = param_binary.wait() {
match convert_stream_to_string(param_binary) {
Ok(param_binary) => {
// Add file to multipart form.
multipart.add_text("binary", param_binary);
},
Err(err) => return Box::new(futures::done(Err(err))),
}
}
let mut fields = match multipart.prepare() {
Ok(fields) => fields,
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))),
};
let mut body_string = String::new();
let body = fields.to_body().read_to_string(&mut body_string);
let boundary = fields.boundary();
let multipart_header = match mime::Mime::from_str(&format!("multipart/form-data;boundary={}", boundary)) {
Ok(multipart_header) => multipart_header,
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build multipart header: {:?}", err))))),
};
request.headers_mut().set(ContentType(mimetypes::requests::TEST_ENDPOINT_PARAMETERS.clone()));
request.set_body(body.into_bytes());
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
(context as &Has<Option<AuthData>>).get().as_ref().map(|auth_data| {
@ -867,11 +830,6 @@ if let Some(body) = body {
}
});
request.headers_mut().set(ContentType(multipart_header));
request.set_body(body_string.into_bytes());
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -918,7 +876,7 @@ if let Some(body) = body {
}
fn test_enum_parameters(&self, param_enum_header_string_array: Option<&Vec<String>>, param_enum_header_string: Option<String>, param_enum_query_string_array: Option<&Vec<String>>, param_enum_query_string: Option<String>, param_enum_query_integer: Option<i32>, param_enum_query_double: Option<f64>, context: &C) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>> {
fn test_enum_parameters(&self, param_enum_header_string_array: Option<&Vec<String>>, param_enum_header_string: Option<String>, param_enum_query_string_array: Option<&Vec<String>>, param_enum_query_string: Option<String>, param_enum_query_integer: Option<i32>, param_enum_query_double: Option<f64>, param_enum_form_string: Option<String>, context: &C) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>> {
// Query parameters
let query_enum_query_string_array = param_enum_query_string_array.map_or_else(String::new, |query| format!("enum_query_string_array={enum_query_string_array}&", enum_query_string_array=query.join(",")));
@ -943,7 +901,13 @@ if let Some(body) = body {
let mut request = hyper::Request::new(hyper::Method::Get, uri);
let params = &[
("enum_form_string", param_enum_form_string),
];
let body = serde_urlencoded::to_string(params).expect("impossible to fail to serialize");
request.headers_mut().set(ContentType(mimetypes::requests::TEST_ENUM_PARAMETERS.clone()));
request.set_body(body.into_bytes());
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
@ -954,8 +918,6 @@ if let Some(body) = body {
param_enum_header_string.map(|header| request.headers_mut().set(RequestEnumHeaderString(header)));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1028,8 +990,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1094,8 +1054,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1161,8 +1119,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1170,7 +1126,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -1239,8 +1194,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1302,8 +1255,6 @@ if let Some(body) = body {
param_api_key.map(|header| request.headers_mut().set(RequestApiKey(header)));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1365,8 +1316,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1374,7 +1323,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -1450,8 +1398,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1459,7 +1405,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -1531,8 +1476,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1540,7 +1483,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -1627,8 +1569,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1711,8 +1651,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1750,7 +1688,7 @@ if let Some(body) = body {
}
fn upload_file(&self, param_pet_id: i64, param_additional_metadata: Option<String>, param_file: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, context: &C) -> Box<Future<Item=UploadFileResponse, Error=ApiError>> {
fn upload_file(&self, param_pet_id: i64, param_additional_metadata: Option<String>, param_file: Option<swagger::ByteArray>, context: &C) -> Box<Future<Item=UploadFileResponse, Error=ApiError>> {
let uri = format!(
@ -1765,50 +1703,18 @@ if let Some(body) = body {
let mut request = hyper::Request::new(hyper::Method::Post, uri);
// Form data body
let mut multipart = Multipart::new();
let params = &[
("additionalMetadata", param_additional_metadata),
("file", param_file.map(|param| format!("{:?}", param))),
];
let body = serde_urlencoded::to_string(params).expect("impossible to fail to serialize");
// Helper function to convert a Stream into a String. The String can then be used to build the HTTP body.
fn convert_stream_to_string(stream: Box<Stream<Item=Vec<u8>, Error=Error> + Send>) -> Result<String, ApiError> {
stream.concat2()
.wait()
.map_err(|e| ApiError(format!("Unable to collect stream: {}", e)))
.and_then(|body| String::from_utf8(body)
.map_err(|e| ApiError(format!("Failed to convert utf8 stream to String: {}", e))))
}
if let Ok(Some(param_file)) = param_file.wait() {
match convert_stream_to_string(param_file) {
Ok(param_file) => {
// Add file to multipart form.
multipart.add_text("file", param_file);
},
Err(err) => return Box::new(futures::done(Err(err))),
}
}
let mut fields = match multipart.prepare() {
Ok(fields) => fields,
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))),
};
let mut body_string = String::new();
let body = fields.to_body().read_to_string(&mut body_string);
let boundary = fields.boundary();
let multipart_header = match mime::Mime::from_str(&format!("multipart/form-data;boundary={}", boundary)) {
Ok(multipart_header) => multipart_header,
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build multipart header: {:?}", err))))),
};
request.headers_mut().set(ContentType(mimetypes::requests::UPLOAD_FILE.clone()));
request.set_body(body.into_bytes());
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
request.headers_mut().set(ContentType(multipart_header));
request.set_body(body_string.into_bytes());
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1816,7 +1722,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -1877,8 +1782,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1945,8 +1848,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -1954,7 +1855,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -2015,8 +1915,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2024,7 +1922,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -2111,8 +2008,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2120,7 +2015,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -2200,8 +2094,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2265,8 +2157,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2330,8 +2220,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2389,8 +2277,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2457,8 +2343,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2466,7 +2350,6 @@ if let Some(body) = body {
200 => {
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -2553,8 +2436,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2572,7 +2453,6 @@ if let Some(body) = body {
};
let body = response.body();
Box::new(
body
.concat2()
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
@ -2644,8 +2524,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@ -2709,8 +2587,6 @@ if let Some(body) = body {
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {

View File

@ -288,10 +288,10 @@ pub trait Api<C> {
fn test_client_model(&self, client: models::Client, context: &C) -> Box<Future<Item=TestClientModelResponse, Error=ApiError>>;
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>, context: &C) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>>;
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Option<swagger::ByteArray>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>, context: &C) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>>;
/// To test enum parameters
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>, context: &C) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>>;
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>, enum_form_string: Option<String>, context: &C) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>>;
/// test inline additionalProperties
fn test_inline_additional_properties(&self, request_body: HashMap<String, String>, context: &C) -> Box<Future<Item=TestInlineAdditionalPropertiesResponse, Error=ApiError>>;
@ -324,7 +324,7 @@ pub trait Api<C> {
fn update_pet_with_form(&self, pet_id: i64, name: Option<String>, status: Option<String>, context: &C) -> Box<Future<Item=UpdatePetWithFormResponse, Error=ApiError>>;
/// uploads an image
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, context: &C) -> Box<Future<Item=UploadFileResponse, Error=ApiError>>;
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Option<swagger::ByteArray>, context: &C) -> Box<Future<Item=UploadFileResponse, Error=ApiError>>;
/// Delete purchase order by ID
fn delete_order(&self, order_id: String, context: &C) -> Box<Future<Item=DeleteOrderResponse, Error=ApiError>>;
@ -389,10 +389,10 @@ pub trait ApiNoContext {
fn test_client_model(&self, client: models::Client) -> Box<Future<Item=TestClientModelResponse, Error=ApiError>>;
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>>;
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Option<swagger::ByteArray>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>>;
/// To test enum parameters
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>>;
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>, enum_form_string: Option<String>) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>>;
/// test inline additionalProperties
fn test_inline_additional_properties(&self, request_body: HashMap<String, String>) -> Box<Future<Item=TestInlineAdditionalPropertiesResponse, Error=ApiError>>;
@ -425,7 +425,7 @@ pub trait ApiNoContext {
fn update_pet_with_form(&self, pet_id: i64, name: Option<String>, status: Option<String>) -> Box<Future<Item=UpdatePetWithFormResponse, Error=ApiError>>;
/// uploads an image
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>) -> Box<Future<Item=UploadFileResponse, Error=ApiError>>;
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Option<swagger::ByteArray>) -> Box<Future<Item=UploadFileResponse, Error=ApiError>>;
/// Delete purchase order by ID
fn delete_order(&self, order_id: String) -> Box<Future<Item=DeleteOrderResponse, Error=ApiError>>;
@ -515,13 +515,13 @@ impl<'a, T: Api<C>, C> ApiNoContext for ContextWrapper<'a, T, C> {
}
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>> {
self.api().test_endpoint_parameters(number, double, pattern_without_delimiter, integer, int32, int64, float, string, binary, date, date_time, password, callback, &self.context())
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Option<swagger::ByteArray>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError>> {
self.api().test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, &self.context())
}
/// To test enum parameters
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>> {
self.api().test_enum_parameters(enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, &self.context())
fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec<String>>, enum_header_string: Option<String>, enum_query_string_array: Option<&Vec<String>>, enum_query_string: Option<String>, enum_query_integer: Option<i32>, enum_query_double: Option<f64>, enum_form_string: Option<String>) -> Box<Future<Item=TestEnumParametersResponse, Error=ApiError>> {
self.api().test_enum_parameters(enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, enum_form_string, &self.context())
}
/// test inline additionalProperties
@ -575,7 +575,7 @@ impl<'a, T: Api<C>, C> ApiNoContext for ContextWrapper<'a, T, C> {
}
/// uploads an image
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Box<Future<Item=Option<Box<Stream<Item=Vec<u8>, Error=Error> + Send>>, Error=Error> + Send>) -> Box<Future<Item=UploadFileResponse, Error=ApiError>> {
fn upload_file(&self, pet_id: i64, additional_metadata: Option<String>, file: Option<swagger::ByteArray>) -> Box<Future<Item=UploadFileResponse, Error=ApiError>> {
self.api().upload_file(pet_id, additional_metadata, file, &self.context())
}

View File

@ -101,6 +101,14 @@ pub mod requests {
lazy_static! {
pub static ref TEST_CLIENT_MODEL: Mime = "application/json".parse().unwrap();
}
/// Create Mime objects for the request content types for TestEndpointParameters
lazy_static! {
pub static ref TEST_ENDPOINT_PARAMETERS: Mime = "application/x-www-form-urlencoded".parse().unwrap();
}
/// Create Mime objects for the request content types for TestEnumParameters
lazy_static! {
pub static ref TEST_ENUM_PARAMETERS: Mime = "application/x-www-form-urlencoded".parse().unwrap();
}
/// Create Mime objects for the request content types for TestInlineAdditionalProperties
lazy_static! {
pub static ref TEST_INLINE_ADDITIONAL_PROPERTIES: Mime = "application/json".parse().unwrap();
@ -125,6 +133,10 @@ pub mod requests {
lazy_static! {
pub static ref UPDATE_PET_WITH_FORM: Mime = "application/x-www-form-urlencoded".parse().unwrap();
}
/// Create Mime objects for the request content types for UploadFile
lazy_static! {
pub static ref UPLOAD_FILE: Mime = "multipart/form-data".parse().unwrap();
}
/// Create Mime objects for the request content types for PlaceOrder
lazy_static! {
pub static ref PLACE_ORDER: Mime = "application/json".parse().unwrap();

Some files were not shown because too many files have changed in this diff Show More