();
+ codegenModel.additionalPropertiesType = getTypeString(addProps, "", "", referencedModelNames);
+ if (referencedModelNames.size() != 0) {
+ // Models that are referenced in the 'additionalPropertiesType' keyword
+ // must be added to the imports.
+ codegenModel.imports.addAll(referencedModelNames);
+ }
+ }
+ // If addProps is null, the value of the 'additionalProperties' keyword is set
+ // to false, i.e. no additional properties are allowed.
}
/**
- * Generate Python package name from String `packageName`
- *
- * (PEP 0008) Python packages should also have short, all-lowercase names,
- * although the use of underscores is discouraged.
+ * Gets an example if it exists
*
- * @param packageName Package name
- * @return Python package name that conforms to PEP 0008
+ * @param sc input schema
+ * @return the example value
*/
- @SuppressWarnings("static-method")
- public String generatePackageName(String packageName) {
- return underscore(packageName.replaceAll("[^\\w]+", ""));
+ protected Object getObjectExample(Schema sc) {
+ Schema schema = sc;
+ String ref = sc.get$ref();
+ if (ref != null) {
+ schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref));
+ }
+ // TODO handle examples in object models in the future
+ Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema));
+ if (objectModel) {
+ return null;
+ }
+ if (schema.getExample() != null) {
+ return schema.getExample();
+ } if (schema.getDefault() != null) {
+ return schema.getDefault();
+ } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) {
+ return schema.getEnum().get(0);
+ }
+ return null;
}
- /**
- * Return the default value of the property
+ /***
+ * Ensures that the string has a leading and trailing quote
*
- * @param p OpenAPI property object
- * @return string presentation of the default value of the property
+ * @param in input string
+ * @return quoted string
*/
- @Override
- public String toDefaultValue(Schema p) {
- if (ModelUtils.isBooleanSchema(p)) {
- if (p.getDefault() != null) {
- if (Boolean.valueOf(p.getDefault().toString()) == false)
- return "False";
- else
- return "True";
- }
- } else if (ModelUtils.isDateSchema(p)) {
- // TODO
- } else if (ModelUtils.isDateTimeSchema(p)) {
- // TODO
- } else if (ModelUtils.isNumberSchema(p)) {
- if (p.getDefault() != null) {
- return p.getDefault().toString();
- }
- } else if (ModelUtils.isIntegerSchema(p)) {
- if (p.getDefault() != null) {
- return p.getDefault().toString();
- }
- } else if (ModelUtils.isStringSchema(p)) {
- if (p.getDefault() != null) {
- if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find())
- return "'''" + p.getDefault() + "'''";
- else
- return "'" + ((String) p.getDefault()).replaceAll("'", "\'") + "'";
- }
- } else if (ModelUtils.isArraySchema(p)) {
- if (p.getDefault() != null) {
- return p.getDefault().toString();
- }
+ private String ensureQuotes(String in) {
+ Pattern pattern = Pattern.compile("\r\n|\r|\n");
+ Matcher matcher = pattern.matcher(in);
+ if (matcher.find()) {
+ // if a string has a new line in it add triple quotes to make it a python multiline string
+ return "'''" + in + "'''";
}
-
- return null;
- }
-
- @Override
- public String toRegularExpression(String pattern) {
- return addRegularExpressionDelimiter(pattern);
+ String strPattern = "^['\"].*?['\"]$";
+ if (in.matches(strPattern)) {
+ return in;
+ }
+ return "\"" + in + "\"";
}
- @Override
- public String toExampleValue(Schema schema) {
- return toExampleValueRecursive(schema, new ArrayList(), 5);
+ public String toExampleValue(Schema schema, Object objExample) {
+ String modelName = getModelName(schema);
+ return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0);
}
- private String toExampleValueRecursive(Schema schema, List included_schemas, int indentation) {
- String indentation_string = "";
- for (int i=0 ; i< indentation ; i++) indentation_string += " ";
- String example = super.toExampleValue(schema);
-
- if (ModelUtils.isNullType(schema) && null != example) {
- // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x,
- // though this tooling supports it.
- return "None";
+ private Boolean simpleStringSchema(Schema schema) {
+ Schema sc = schema;
+ String ref = schema.get$ref();
+ if (ref != null) {
+ sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref));
}
- // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans
- if (ModelUtils.isBooleanSchema(schema) && null!=example) {
- if ("false".equalsIgnoreCase(example)) example = "False";
- else example = "True";
+ if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) {
+ return true;
}
+ return false;
+ }
- // correct "'"s into "'"s after toString()
- if (ModelUtils.isStringSchema(schema) && schema.getDefault() != null && !ModelUtils.isDateSchema(schema) && !ModelUtils.isDateTimeSchema(schema)) {
- example = (String) schema.getDefault();
+ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) {
+ for ( MappedModel mm : disc.getMappedModels() ) {
+ String modelName = mm.getModelName();
+ Schema modelSchema = getModelNameToSchemaCache().get(modelName);
+ if (ModelUtils.isObjectSchema(modelSchema)) {
+ return mm;
+ }
}
+ return null;
+ }
- if (StringUtils.isNotBlank(example) && !"null".equals(example)) {
- if (ModelUtils.isStringSchema(schema)) {
- example = "'" + example + "'";
- }
- return example;
+ /***
+ * Recursively generates string examples for schemas
+ *
+ * @param modelName the string name of the refed model that will be generated for the schema or null
+ * @param schema the schema that we need an example for
+ * @param objExample the example that applies to this schema, for now only string example are used
+ * @param indentationLevel integer indentation level that we are currently at
+ * we assume the indentaion amount is 4 spaces times this integer
+ * @param prefix the string prefix that we will use when assigning an example for this line
+ * this is used when setting key: value, pairs "key: " is the prefix
+ * and this is used when setting properties like some_property='some_property_example'
+ * @param exampleLine this is the current line that we are generatign an example for, starts at 0
+ * we don't indentin the 0th line because using the example value looks like:
+ * prop = ModelName( line 0
+ * some_property='some_property_example' line 1
+ * ) line 2
+ * and our example value is:
+ * ModelName( line 0
+ * some_property='some_property_example' line 1
+ * ) line 2
+ * @return the string example
+ */
+ private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine) {
+ final String indentionConst = " ";
+ String currentIndentation = "";
+ String closingIndentation = "";
+ for (int i=0 ; i < indentationLevel ; i++) currentIndentation += indentionConst;
+ if (exampleLine.equals(0)) {
+ closingIndentation = currentIndentation;
+ currentIndentation = "";
+ } else {
+ closingIndentation = currentIndentation;
+ }
+ String openChars = "";
+ String closeChars = "";
+ if (modelName != null) {
+ openChars = modelName+"(";
+ closeChars = ")";
}
- if (schema.getEnum() != null && !schema.getEnum().isEmpty()) {
- // Enum case:
- example = schema.getEnum().get(0).toString();
- if (ModelUtils.isStringSchema(schema)) {
- example = "'" + escapeText(example) + "'";
- }
- if (null == example)
- LOGGER.warn("Empty enum. Cannot built an example!");
+ String fullPrefix = currentIndentation + prefix + openChars;
- return example;
- } else if (null != schema.get$ref()) {
- // $ref case:
+ String example = null;
+ if (objExample != null) {
+ example = objExample.toString();
+ }
+ if (null != schema.get$ref()) {
Map allDefinitions = ModelUtils.getSchemas(this.openAPI);
String ref = ModelUtils.getSimpleRef(schema.get$ref());
- if (allDefinitions != null) {
- Schema refSchema = allDefinitions.get(ref);
- if (null == refSchema) {
- return "None";
+ Schema refSchema = allDefinitions.get(ref);
+ if (null == refSchema) {
+ LOGGER.warn("Unable to find referenced schema "+schema.get$ref()+"\n");
+ return fullPrefix + "None" + closeChars;
+ }
+ String refModelName = getModelName(schema);
+ return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine);
+ } else if (ModelUtils.isNullType(schema) || isAnyTypeSchema(schema)) {
+ // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x,
+ // though this tooling supports it.
+ return fullPrefix + "None" + closeChars;
+ } else if (ModelUtils.isBooleanSchema(schema)) {
+ if (objExample == null) {
+ example = "True";
+ } else {
+ if ("false".equalsIgnoreCase(objExample.toString())) {
+ example = "False";
} else {
- String refTitle = refSchema.getTitle();
- if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) {
- refSchema.setTitle(ref);
- }
- if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) {
- included_schemas.add(schema.getTitle());
- }
- return toExampleValueRecursive(refSchema, included_schemas, indentation);
+ example = "True";
}
+ }
+ return fullPrefix + example + closeChars;
+ } else if (ModelUtils.isDateSchema(schema)) {
+ if (objExample == null) {
+ example = pythonDate("1970-01-01");
} else {
- LOGGER.warn("allDefinitions not defined in toExampleValue!\n");
+ example = pythonDate(objExample);
}
- }
- if (ModelUtils.isDateSchema(schema)) {
- example = "datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date()";
- return example;
+ return fullPrefix + example + closeChars;
} else if (ModelUtils.isDateTimeSchema(schema)) {
- example = "datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')";
- return example;
+ if (objExample == null) {
+ example = pythonDateTime("1970-01-01T00:00:00.00Z");
+ } else {
+ example = pythonDateTime(objExample);
+ }
+ return fullPrefix + example + closeChars;
} else if (ModelUtils.isBinarySchema(schema)) {
- example = "bytes(b'blah')";
- return example;
+ if (objExample == null) {
+ example = "/path/to/file";
+ }
+ example = "open('" + example + "', 'rb')";
+ return fullPrefix + example + closeChars;
} else if (ModelUtils.isByteArraySchema(schema)) {
- example = "YQ==";
+ if (objExample == null) {
+ example = "'YQ=='";
+ }
+ return fullPrefix + example + closeChars;
} else if (ModelUtils.isStringSchema(schema)) {
- // a BigDecimal:
- if ("Number".equalsIgnoreCase(schema.getFormat())) {return "1";}
- if (StringUtils.isNotBlank(schema.getPattern())) return "'a'"; // I cheat here, since it would be too complicated to generate a string from a regexp
- int len = 0;
- if (null != schema.getMinLength()) len = schema.getMinLength().intValue();
- if (len < 1) len = 1;
- example = "";
- for (int i=0;i reqs = schema.getRequired();
-
- // if required and optionals
- List reqs = new ArrayList<>();
- if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
- for (Object toAdd : schema.getProperties().keySet()) {
- reqs.add((String) toAdd);
- }
-
- Map properties = schema.getProperties();
- Set propkeys = null;
- if (properties != null) propkeys = properties.keySet();
- if (toExclude != null && reqs.contains(toExclude)) {
- reqs.remove(toExclude);
- }
- for (String toRemove : included_schemas) {
- if (reqs.contains(toRemove)) {
- reqs.remove(toRemove);
- }
- }
- if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) {
- included_schemas.add(schema.getTitle());
- }
- if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) {
- reqs.add((String) toAdd);
+ CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI);
+ if (disc != null) {
+ MappedModel mm = getDiscriminatorMappedModel(disc);
+ if (mm != null) {
+ String discPropNameValue = mm.getMappingName();
+ String chosenModelName = mm.getModelName();
+ // TODO handle this case in the future, this is when the discriminated
+ // schema allOf includes this schema, like Cat allOf includes Pet
+ // so this is the composed schema use case
+ } else {
+ return fullPrefix + closeChars;
}
- if (null != propkeys) for (String propname : propkeys) {
- Schema schema2 = properties.get(propname);
- if (reqs.contains(propname)) {
- String refTitle = schema2.getTitle();
- if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) {
- schema2.setTitle(propname);
- }
- example += "\n" + indentation_string + underscore(propname) + " = " +
- toExampleValueRecursive(schema2, included_schemas, indentation + 1) + ", ";
- }
+ }
+ return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation);
+ } else if (ModelUtils.isComposedSchema(schema)) {
+ // TODO add examples for composed schema models without discriminators
+
+ CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI);
+ if (disc != null) {
+ MappedModel mm = getDiscriminatorMappedModel(disc);
+ if (mm != null) {
+ String discPropNameValue = mm.getMappingName();
+ String chosenModelName = mm.getModelName();
+ Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName);
+ CodegenProperty cp = new CodegenProperty();
+ cp.setName(disc.getPropertyName());
+ cp.setExample(discPropNameValue);
+ return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation);
+ } else {
+ return fullPrefix + closeChars;
}
}
- example +=")";
+ return fullPrefix + closeChars;
} else {
LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue");
}
- if (ModelUtils.isStringSchema(schema)) {
- example = "'" + escapeText(example) + "'";
- }
-
return example;
}
- @Override
- public void setParameterExampleValue(CodegenParameter p) {
- String example;
-
- if (p.defaultValue == null) {
- example = p.example;
- } else {
- p.example = p.defaultValue;
- return;
+ private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation) {
+ Map requiredAndOptionalProps = schema.getProperties();
+ if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) {
+ return fullPrefix + closeChars;
}
- String type = p.baseType;
- if (type == null) {
- type = p.dataType;
- }
-
- if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) {
- if (example == null) {
- example = p.paramName + "_example";
- }
- example = "'" + escapeText(example) + "'";
- } else if ("Integer".equals(type) || "int".equals(type)) {
- if (example == null) {
- example = "56";
- }
- } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "3.4";
- }
- } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "True";
- }
- } else if ("file".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "/path/to/file";
- }
- example = "'" + escapeText(example) + "'";
- } else if ("Date".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "2013-10-20";
- }
- example = "'" + escapeText(example) + "'";
- } else if ("DateTime".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "2013-10-20T19:20:30+01:00";
+ String example = fullPrefix + "\n";
+ for (Map.Entry entry : requiredAndOptionalProps.entrySet()) {
+ String propName = entry.getKey();
+ Schema propSchema = entry.getValue();
+ propName = toVarName(propName);
+ String propModelName = null;
+ Object propExample = null;
+ if (discProp != null && propName.equals(discProp.name)) {
+ propModelName = null;
+ propExample = discProp.example;
+ } else {
+ propModelName = getModelName(propSchema);
+ propExample = exampleFromStringOrArraySchema(propSchema, null, propName);
}
- example = "'" + escapeText(example) + "'";
- } else if (!languageSpecificPrimitives.contains(type)) {
- // type is a model class, e.g. User
- example = this.packageName + "." + type + "()";
- } else {
- LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
+ example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1) + ",\n";
}
+ // TODO handle additionalProperties also
+ example += closingIndentation + closeChars;
+ return example;
+ }
- if (example == null) {
- example = "None";
- } else if (Boolean.TRUE.equals(p.isArray)) {
- example = "[" + example + "]";
- } else if (Boolean.TRUE.equals(p.isMap)) {
- example = "{'key': " + example + "}";
+ private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) {
+ if (currentExample != null) {
+ return currentExample;
}
-
- p.example = example;
+ Schema schema = sc;
+ String ref = sc.get$ref();
+ if (ref != null) {
+ schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref));
+ }
+ Object example = getObjectExample(schema);
+ if (example != null) {
+ return example;
+ } else if (simpleStringSchema(schema)) {
+ return propName + "_example";
+ } else if (ModelUtils.isArraySchema(schema)) {
+ ArraySchema arraySchema = (ArraySchema) schema;
+ Schema itemSchema = arraySchema.getItems();
+ example = getObjectExample(itemSchema);
+ if (example != null ) {
+ return example;
+ } else if (simpleStringSchema(itemSchema)) {
+ return propName + "_example";
+ }
+ }
+ return null;
}
+
+ /***
+ *
+ * Set the codegenParameter example value
+ * We have a custom version of this function so we can invoke toExampleValue
+ *
+ * @param codegenParameter the item we are setting the example on
+ * @param parameter the base parameter that came from the spec
+ */
@Override
public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) {
Schema schema = parameter.getSchema();
-
- if (parameter.getExample() != null) {
- codegenParameter.example = parameter.getExample().toString();
- } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) {
- Example example = parameter.getExamples().values().iterator().next();
- if (example.getValue() != null) {
- codegenParameter.example = example.getValue().toString();
- }
- } else if (schema != null && schema.getExample() != null) {
- codegenParameter.example = schema.getExample().toString();
+ if (schema == null) {
+ LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema");
+ return;
}
- setParameterExampleValue(codegenParameter);
+ Object example = null;
+ if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) {
+ example = codegenParameter.vendorExtensions.get("x-example");
+ } else if (parameter.getExample() != null) {
+ example = parameter.getExample();
+ } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) {
+ example = parameter.getExamples().values().iterator().next().getValue();
+ } else {
+ example = getObjectExample(schema);
+ }
+ example = exampleFromStringOrArraySchema(schema, example, parameter.getName());
+ String finalExample = toExampleValue(schema, example);
+ codegenParameter.example = finalExample;
}
+ /**
+ * Return the example value of the parameter.
+ *
+ * @param codegenParameter Codegen parameter
+ * @param requestBody Request body
+ */
@Override
- public String sanitizeTag(String tag) {
- return sanitizeName(tag);
- }
+ public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) {
+ if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) {
+ codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example"));
+ }
- @Override
- public String escapeQuotationMark(String input) {
- // remove ' to avoid code injection
- return input.replace("'", "");
- }
+ Content content = requestBody.getContent();
- @Override
- public String escapeUnsafeCharacters(String input) {
- // remove multiline comment
- return input.replace("'''", "'_'_'");
- }
+ if (content.size() > 1) {
+ // @see ModelUtils.getSchemaFromContent()
+ once(LOGGER).warn("Multiple MediaTypes found, using only the first one");
+ }
- @Override
- public void postProcessFile(File file, String fileType) {
- if (file == null) {
+ MediaType mediaType = content.values().iterator().next();
+ Schema schema = mediaType.getSchema();
+ if (schema == null) {
+ LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema");
return;
}
- String pythonPostProcessFile = System.getenv("PYTHON_POST_PROCESS_FILE");
- if (StringUtils.isEmpty(pythonPostProcessFile)) {
- return; // skip if PYTHON_POST_PROCESS_FILE env variable is not defined
+
+ Object example = null;
+ if (mediaType.getExample() != null) {
+ example = mediaType.getExample();
+ } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) {
+ example = mediaType.getExamples().values().iterator().next().getValue();
+ } else {
+ example = getObjectExample(schema);
}
+ example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName);
+ codegenParameter.example = toExampleValue(schema, example);
+ }
- // only process files with py extension
- if ("py".equals(FilenameUtils.getExtension(file.toString()))) {
- String command = pythonPostProcessFile + " " + file.toString();
- try {
- Process p = Runtime.getRuntime().exec(command);
- int exitValue = p.waitFor();
- if (exitValue != 0) {
- LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue);
- } else {
- LOGGER.info("Successfully executed: " + command);
- }
- } catch (Exception e) {
- LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
- }
+ /**
+ * Create a CodegenParameter for a Form Property
+ * We have a custom version of this method so we can invoke
+ * setParameterExampleValue(codegenParameter, parameter)
+ * rather than setParameterExampleValue(codegenParameter)
+ * This ensures that all of our samples are generated in
+ * toExampleValueRecursive
+ *
+ * @param name the property name
+ * @param propertySchema the property schema
+ * @param imports our import set
+ * @return the resultant CodegenParameter
+ */
+ @Override
+ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) {
+ CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports);
+ Parameter p = new Parameter();
+ p.setSchema(propertySchema);
+ p.setName(cp.paramName);
+ setParameterExampleValue(cp, p);
+ return cp;
+ }
+
+ /**
+ * Return a map from model name to Schema for efficient lookup.
+ *
+ * @return map from model name to Schema.
+ */
+ protected Map getModelNameToSchemaCache() {
+ if (modelNameToSchemaCache == null) {
+ // Create a cache to efficiently lookup schema based on model name.
+ Map m = new HashMap();
+ ModelUtils.getSchemas(openAPI).forEach((key, schema) -> {
+ m.put(toModelName(key), schema);
+ });
+ modelNameToSchemaCache = Collections.unmodifiableMap(m);
}
+ return modelNameToSchemaCache;
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java
deleted file mode 100644
index 5d205c9bddf0..000000000000
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openapitools.codegen.languages;
-
-import io.swagger.v3.core.util.Json;
-import io.swagger.v3.oas.models.media.*;
-import io.swagger.v3.oas.models.media.ArraySchema;
-import io.swagger.v3.oas.models.media.MediaType;
-import io.swagger.v3.oas.models.media.Schema;
-import io.swagger.v3.oas.models.parameters.Parameter;
-import io.swagger.v3.oas.models.parameters.RequestBody;
-import io.swagger.v3.oas.models.security.SecurityScheme;
-import org.apache.commons.lang3.StringUtils;
-import org.openapitools.codegen.*;
-import org.openapitools.codegen.CodegenDiscriminator.MappedModel;
-import org.openapitools.codegen.meta.features.*;
-import org.openapitools.codegen.utils.ModelUtils;
-import org.openapitools.codegen.utils.ProcessUtils;
-import org.openapitools.codegen.meta.GeneratorMetadata;
-import org.openapitools.codegen.meta.Stability;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.github.curiousoddman.rgxgen.RgxGen;
-
-import java.time.OffsetDateTime;
-import java.time.ZoneOffset;
-import java.time.format.DateTimeFormatter;
-import java.io.File;
-import java.util.*;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
-import static org.openapitools.codegen.utils.OnceLogger.once;
-
-public class PythonClientExperimentalCodegen extends PythonClientCodegen {
- private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientExperimentalCodegen.class);
- // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`.
- private Map modelNameToSchemaCache;
- private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE;
- private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME;
-
- public PythonClientExperimentalCodegen() {
- super();
-
- // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema.
- // In principle, this should be enabled by default for all code generators. However due to limitations
- // in other code generators, support needs to be enabled on a case-by-case basis.
- supportsAdditionalPropertiesWithComposedSchema = true;
-
- // When the 'additionalProperties' keyword is not present in a OAS schema, allow
- // undeclared properties. This is compliant with the JSON schema specification.
- this.setDisallowAdditionalPropertiesIfNotPresent(false);
-
- modifyFeatureSet(features -> features
- .includeDocumentationFeatures(DocumentationFeature.Readme)
- .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
- .securityFeatures(EnumSet.of(
- SecurityFeature.BasicAuth,
- SecurityFeature.BearerToken,
- SecurityFeature.ApiKey,
- SecurityFeature.OAuth2_Implicit
- ))
- .includeGlobalFeatures(
- GlobalFeature.ParameterizedServer
- )
- .excludeGlobalFeatures(
- GlobalFeature.XMLStructureDefinitions,
- GlobalFeature.Callbacks,
- GlobalFeature.LinkObjects,
- GlobalFeature.ParameterStyling
- )
- .excludeSchemaSupportFeatures(
- SchemaSupportFeature.Polymorphism
- )
- .excludeParameterFeatures(
- ParameterFeature.Cookie
- )
- );
-
- // this may set datatype right for additional properties
- instantiationTypes.put("map", "dict");
-
- languageSpecificPrimitives.add("file_type");
- languageSpecificPrimitives.add("none_type");
-
- apiTemplateFiles.remove("api.mustache");
- apiTemplateFiles.put("python-experimental/api.mustache", ".py");
-
- apiDocTemplateFiles.remove("api_doc.mustache");
- apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md");
-
- apiTestTemplateFiles.remove("api_test.mustache", ".py");
- apiTestTemplateFiles.put("python-experimental/api_test.mustache", ".py");
-
- modelDocTemplateFiles.remove("model_doc.mustache");
- modelDocTemplateFiles.put("python-experimental/model_doc.mustache", ".md");
-
- modelTemplateFiles.remove("model.mustache");
- modelTemplateFiles.put("python-experimental/model.mustache", ".py");
-
- modelTestTemplateFiles.remove("model_test.mustache", ".py");
- modelTestTemplateFiles.put("python-experimental/model_test.mustache", ".py");
-
- // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG
- // this generator uses the following order for endpoint paramters and model properties
- // required params/props with no enum of length one
- // required params/props with enum of length one (which is used to set a default value as a python named arg value)
- // optional params/props with **kwargs in python
- cliOptions.remove(4);
-
- cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC)
- .defaultValue(Boolean.FALSE.toString()));
-
- generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
- .stability(Stability.EXPERIMENTAL)
- .build();
- }
-
- @Override
- public void processOpts() {
- this.setLegacyDiscriminatorBehavior(false);
-
- super.processOpts();
- modelPackage = packageName + "." + "model";
-
- supportingFiles.remove(new SupportingFile("api_client.mustache", packagePath(), "api_client.py"));
- supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py"));
-
- supportingFiles.add(new SupportingFile("python-experimental/model_utils.mustache", packagePath(), "model_utils.py"));
-
- supportingFiles.remove(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "models", "__init__.py"));
- supportingFiles.add(new SupportingFile("python-experimental/__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py"));
-
- supportingFiles.remove(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
- supportingFiles.add(new SupportingFile("python-experimental/configuration.mustache", packagePath(), "configuration.py"));
-
- supportingFiles.remove(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py"));
- supportingFiles.add(new SupportingFile("python-experimental/__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py"));
-
- supportingFiles.remove(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py"));
- supportingFiles.add(new SupportingFile("python-experimental/exceptions.mustache", packagePath(), "exceptions.py"));
-
- if ("urllib3".equals(getLibrary())) {
- supportingFiles.remove(new SupportingFile("rest.mustache", packagePath(), "rest.py"));
- supportingFiles.add(new SupportingFile("python-experimental/rest.mustache", packagePath(), "rest.py"));
- }
-
- supportingFiles.remove(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py"));
- supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py"));
-
- // add the models and apis folders
- supportingFiles.add(new SupportingFile("python-experimental/__init__models.mustache", packagePath() + File.separatorChar + "models", "__init__.py"));
- supportingFiles.add(new SupportingFile("python-experimental/__init__apis.mustache", packagePath() + File.separatorChar + "apis", "__init__.py"));
-
- // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS.
- Map securitySchemeMap = openAPI != null ?
- (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null;
- List authMethods = fromSecurity(securitySchemeMap);
- if (ProcessUtils.hasHttpSignatureMethods(authMethods)) {
- supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py"));
- }
-
- Boolean generateSourceCodeOnly = false;
- if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) {
- generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString());
- }
-
- // remove what PythonClientCodegen did
- String readmePath = "README.md";
- String readmeTemplate = "README.mustache";
- if (generateSourceCodeOnly) {
- readmePath = packagePath() + "_" + readmePath;
- readmeTemplate = "README_onlypackage.mustache";
- }
- supportingFiles.remove(new SupportingFile(readmeTemplate, "", readmePath));
- // add the correct readme
- readmeTemplate = "python-experimental/README.mustache";
- if (generateSourceCodeOnly) {
- readmeTemplate = "python-experimental/README_onlypackage.mustache";
- }
- supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath));
-
- if (!generateSourceCodeOnly) {
- supportingFiles.remove(new SupportingFile("travis.mustache", "", ".travis.yml"));
- supportingFiles.add(new SupportingFile("python-experimental/travis.mustache", "", ".travis.yml"));
- supportingFiles.remove(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml"));
- supportingFiles.add(new SupportingFile("python-experimental/gitlab-ci.mustache", "", ".gitlab-ci.yml"));
- supportingFiles.remove(new SupportingFile("tox.mustache", "", "tox.ini"));
- supportingFiles.add(new SupportingFile("python-experimental/tox.mustache", "", "tox.ini"));
- supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py"));
- supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py"));
- supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt"));
- supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt"));
- supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt"));
- supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt"));
- }
-
- // default this to true so the python ModelSimple models will be generated
- ModelUtils.setGenerateAliasAsModel(true);
- LOGGER.info(CodegenConstants.GENERATE_ALIAS_AS_MODEL + " is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums");
-
- Boolean attrNoneIfUnset = false;
- if (additionalProperties.containsKey(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET)) {
- attrNoneIfUnset = Boolean.valueOf(additionalProperties.get(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET).toString());
- }
- additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset);
- }
-
- /**
- * Configures a friendly name for the generator. This will be used by the
- * generator to select the library with the -g flag.
- *
- * @return the friendly name for the generator
- */
- @Override
- public String getName() {
- return "python-experimental";
- }
-
- @Override
- public Schema unaliasSchema(Schema schema, Map usedImportMappings) {
- Map allSchemas = ModelUtils.getSchemas(openAPI);
- if (allSchemas == null || allSchemas.isEmpty()) {
- // skip the warning as the spec can have no model defined
- //LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'");
- return schema;
- }
-
- if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) {
- String simpleRef = ModelUtils.getSimpleRef(schema.get$ref());
- if (usedImportMappings.containsKey(simpleRef)) {
- LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, usedImportMappings.get(simpleRef));
- return schema;
- }
- Schema ref = allSchemas.get(simpleRef);
- if (ref == null) {
- once(LOGGER).warn("{} is not defined", schema.get$ref());
- return schema;
- } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) {
- // top-level enum class
- return schema;
- } else if (ModelUtils.isArraySchema(ref)) {
- if (ModelUtils.isGenerateAliasAsModel(ref)) {
- return schema; // generate a model extending array
- } else {
- return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())),
- usedImportMappings);
- }
- } else if (ModelUtils.isComposedSchema(ref)) {
- return schema;
- } else if (ModelUtils.isMapSchema(ref)) {
- if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property
- return schema; // treat it as model
- else {
- if (ModelUtils.isGenerateAliasAsModel(ref)) {
- return schema; // generate a model extending map
- } else {
- // treat it as a typical map
- return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())),
- usedImportMappings);
- }
- }
- } else if (ModelUtils.isObjectSchema(ref)) { // model
- if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property
- return schema;
- } else {
- // free form object (type: object)
- if (ModelUtils.hasValidation(ref)) {
- return schema;
- } else if (getAllOfDescendants(simpleRef, openAPI).size() > 0) {
- return schema;
- }
- return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())),
- usedImportMappings);
- }
- } else if (ModelUtils.hasValidation(ref)) {
- // non object non array non map schemas that have validations
- // are returned so we can generate those schemas as models
- // we do this to:
- // - preserve the validations in that model class in python
- // - use those validations when we use this schema in composed oneOf schemas
- return schema;
- } else {
- return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), usedImportMappings);
- }
- }
- return schema;
- }
-
- public String pythonDate(Object dateValue) {
- String strValue = null;
- if (dateValue instanceof OffsetDateTime) {
- OffsetDateTime date = null;
- try {
- date = (OffsetDateTime) dateValue;
- } catch (ClassCastException e) {
- LOGGER.warn("Invalid `date` format for value {}", dateValue.toString());
- date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC);
- }
- strValue = date.format(iso8601Date);
- } else {
- strValue = dateValue.toString();
- }
- return "dateutil_parser('" + strValue + "').date()";
- }
-
- public String pythonDateTime(Object dateTimeValue) {
- String strValue = null;
- if (dateTimeValue instanceof OffsetDateTime) {
- OffsetDateTime dateTime = null;
- try {
- dateTime = (OffsetDateTime) dateTimeValue;
- } catch (ClassCastException e) {
- LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue.toString());
- dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC);
- }
- strValue = dateTime.format(iso8601DateTime);
- } else {
- strValue = dateTimeValue.toString();
- }
- return "dateutil_parser('" + strValue + "')";
- }
-
- /**
- * Return the default value of the property
- *
- * @param p OpenAPI property object
- * @return string presentation of the default value of the property
- */
- @Override
- public String toDefaultValue(Schema p) {
- // if a variable has no default set and only has one allowed value
- // using enum of length == 1 we use that value. Server/client usage:
- // python servers: should only use default values for optional params
- // python clients: should only use default values for required params
- Object defaultObject = null;
- Boolean enumLengthOne = (p.getEnum() != null && p.getEnum().size() == 1);
- if (p.getDefault() != null) {
- defaultObject = p.getDefault();
- } else if (enumLengthOne) {
- defaultObject = p.getEnum().get(0);
- }
-
- if (defaultObject == null) {
- return null;
- }
-
- String defaultValue = defaultObject.toString();
- if (ModelUtils.isDateSchema(p)) {
- defaultValue = pythonDate(defaultObject);
- } else if (ModelUtils.isDateTimeSchema(p)) {
- defaultValue = pythonDateTime(defaultObject);
- } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) {
- defaultValue = ensureQuotes(defaultValue);
- } else if (ModelUtils.isBooleanSchema(p)) {
- if (Boolean.valueOf(defaultValue) == false) {
- defaultValue = "False";
- } else {
- defaultValue = "True";
- }
- }
- return defaultValue;
- }
-
- @Override
- public String toModelImport(String name) {
- // name looks like Cat
- return "from " + modelPackage() + "." + toModelFilename(name) + " import "+ toModelName(name);
- }
-
- @Override
- @SuppressWarnings("static-method")
- public Map postProcessOperationsWithModels(Map objs, List allModels) {
- // fix the imports that each model has, add the module reference to the model
- // loops through imports and converts them all
- // from 'Pet' to 'from petstore_api.model.pet import Pet'
-
- HashMap val = (HashMap)objs.get("operations");
- ArrayList operations = (ArrayList) val.get("operation");
- ArrayList> imports = (ArrayList>)objs.get("imports");
- for (CodegenOperation operation : operations) {
- if (operation.imports.size() == 0) {
- continue;
- }
- String[] modelNames = operation.imports.toArray(new String[0]);
- operation.imports.clear();
- for (String modelName : modelNames) {
- operation.imports.add(toModelImport(modelName));
- }
- }
- return objs;
- }
-
- /***
- * Override with special post-processing for all models.
- * we have a custom version of this method to:
- * - remove any primitive models that do not contain validations
- * these models are unaliased as inline definitions wherever the spec has them as refs
- * this means that the generated client does not use these models
- * because they are not used we do not write them
- * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer
- *
- * @param objs a map going from the model name to a object hoding the model info
- * @return the updated objs
- */
- @Override
- public Map postProcessAllModels(Map objs) {
- super.postProcessAllModels(objs);
-
- List modelsToRemove = new ArrayList<>();
- Map allDefinitions = ModelUtils.getSchemas(this.openAPI);
- for (String schemaName: allDefinitions.keySet()) {
- Schema refSchema = new Schema().$ref("#/components/schemas/"+schemaName);
- Schema unaliasedSchema = unaliasSchema(refSchema, importMapping);
- String modelName = toModelName(schemaName);
- if (unaliasedSchema.get$ref() == null) {
- modelsToRemove.add(modelName);
- } else {
- HashMap objModel = (HashMap) objs.get(modelName);
- List> models = (List>) objModel.get("models");
- for (Map model : models) {
- CodegenModel cm = (CodegenModel) model.get("model");
- String[] importModelNames = cm.imports.toArray(new String[0]);
- cm.imports.clear();
- for (String importModelName : importModelNames) {
- cm.imports.add(toModelImport(importModelName));
- String globalImportFixer = "globals()['" + importModelName + "'] = " + importModelName;
- cm.imports.add(globalImportFixer);
- }
- }
- }
- }
-
- for (String modelName : modelsToRemove) {
- objs.remove(modelName);
- }
-
- return objs;
- }
-
- /**
- * Convert OAS Property object to Codegen Property object
- * We have a custom version of this method to always set allowableValues.enumVars on all enum variables
- * Together with unaliasSchema this sets primitive types with validations as models
- * This method is used by fromResponse
- *
- * @param name name of the property
- * @param p OAS property object
- * @return Codegen Property object
- */
- @Override
- public CodegenProperty fromProperty(String name, Schema p) {
- CodegenProperty cp = super.fromProperty(name, p);
- if (cp.isEnum) {
- updateCodegenPropertyEnum(cp);
- }
- if (cp.isPrimitiveType && p.get$ref() != null) {
- cp.complexType = cp.dataType;
- }
- if (cp.isArray && cp.complexType == null && cp.mostInnerItems.complexType != null) {
- cp.complexType = cp.mostInnerItems.complexType;
- }
- return cp;
- }
-
- /**
- * Update codegen property's enum by adding "enumVars" (with name and value)
- *
- * @param var list of CodegenProperty
- */
- @Override
- public void updateCodegenPropertyEnum(CodegenProperty var) {
- // we have a custom version of this method to omit overwriting the defaultValue
- Map allowableValues = var.allowableValues;
-
- // handle array
- if (var.mostInnerItems != null) {
- allowableValues = var.mostInnerItems.allowableValues;
- }
-
- if (allowableValues == null) {
- return;
- }
-
- List values = (List) allowableValues.get("values");
- if (values == null) {
- return;
- }
-
- String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType;
- Schema referencedSchema = getModelNameToSchemaCache().get(varDataType);
- String dataType = (referencedSchema != null) ? getTypeDeclaration(referencedSchema) : varDataType;
-
- // put "enumVars" map into `allowableValues", including `name` and `value`
- List> enumVars = buildEnumVars(values, dataType);
-
- // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames
- Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions();
- if (referencedSchema != null) {
- extensions = referencedSchema.getExtensions();
- }
- updateEnumVarsWithExtensions(enumVars, extensions);
- allowableValues.put("enumVars", enumVars);
- // overwriting defaultValue omitted from here
- }
-
- /***
- * We have a custom version of this method to produce links to models when they are
- * primitive type (not map, not array, not object) and include validations or are enums
- *
- * @param body requesst body
- * @param imports import collection
- * @param bodyParameterName body parameter name
- * @return the resultant CodegenParameter
- */
- @Override
- public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) {
- CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName);
- Schema schema = ModelUtils.getSchemaFromRequestBody(body);
- if (schema.get$ref() == null) {
- return cp;
- }
- Schema unaliasedSchema = unaliasSchema(schema, importMapping);
- CodegenProperty unaliasedProp = fromProperty("body", unaliasedSchema);
- Boolean dataTypeMismatch = !cp.dataType.equals(unaliasedProp.dataType);
- Boolean baseTypeMismatch = !cp.baseType.equals(unaliasedProp.complexType) && unaliasedProp.complexType != null;
- if (dataTypeMismatch || baseTypeMismatch) {
- cp.dataType = unaliasedProp.dataType;
- cp.baseType = unaliasedProp.complexType;
- }
- return cp;
- }
-
- /***
- * Adds the body model schema to the body parameter
- * We have a custom version of this method so we can flip forceSimpleRef
- * to True based upon the results of unaliasSchema
- * With this customization, we ensure that when schemas are passed to getSchemaType
- * - if they have ref in them they are a model
- * - if they do not have ref in them they are not a model
- *
- * @param codegenParameter the body parameter
- * @param name model schema ref key in components
- * @param schema the model schema (not refed)
- * @param imports collection of imports
- * @param bodyParameterName body parameter name
- * @param forceSimpleRef if true use a model reference
- */
- @Override
- protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) {
- if (name != null) {
- Schema bodySchema = new Schema().$ref("#/components/schemas/" + name);
- Schema unaliased = unaliasSchema(bodySchema, importMapping);
- if (unaliased.get$ref() != null) {
- forceSimpleRef = true;
- }
- }
- super.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, forceSimpleRef);
-
- }
-
-
- /**
- * Return the sanitized variable name for enum
- *
- * @param value enum variable name
- * @param datatype data type
- * @return the sanitized variable name for enum
- */
- public String toEnumVarName(String value, String datatype) {
- // our enum var names are keys in a python dict, so change spaces to underscores
- if (value.length() == 0) {
- return "EMPTY";
- }
-
- String var = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT);
- return var;
- }
-
- /**
- * Return the enum value in the language specified format
- * e.g. status becomes "status"
- *
- * @param value enum variable name
- * @param datatype data type
- * @return the sanitized value for enum
- */
- public String toEnumValue(String value, String datatype) {
- if (datatype.equals("int") || datatype.equals("float")) {
- return value;
- } else {
- return ensureQuotes(value);
- }
- }
-
- @Override
- public void postProcessModelProperty(CodegenModel model, CodegenProperty p) {
- postProcessPattern(p.pattern, p.vendorExtensions);
- // set property.complexType so the model docs will link to the ClassName.md
- if (p.complexType == null && p.isArray && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) {
- // fix ListContainers
- p.complexType = p.mostInnerItems.complexType;
- }
- }
-
- @Override
- public void postProcessParameter(CodegenParameter p) {
- postProcessPattern(p.pattern, p.vendorExtensions);
- if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)){
- // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives
- p.baseType = null;
- }
- }
-
- private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result){
- // for composed schema models, if the required properties are only from oneOf or anyOf models
- // give them a nulltype.Null so the user can omit including them in python
- ComposedSchema cs = (ComposedSchema) schema;
-
- // these are the properties that are from properties in self cs or cs allOf
- Map selfProperties = new LinkedHashMap();
- List selfRequired = new ArrayList();
-
- // these are the properties that are from properties in cs oneOf or cs anyOf
- Map otherProperties = new LinkedHashMap();
- List otherRequired = new ArrayList();
-
- List oneOfanyOfSchemas = new ArrayList<>();
- List oneOf = cs.getOneOf();
- if (oneOf != null) {
- oneOfanyOfSchemas.addAll(oneOf);
- }
- List anyOf = cs.getAnyOf();
- if (anyOf != null) {
- oneOfanyOfSchemas.addAll(anyOf);
- }
- for (Schema sc: oneOfanyOfSchemas) {
- Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc);
- addProperties(otherProperties, otherRequired, refSchema);
- }
- Set otherRequiredSet = new HashSet(otherRequired);
-
- List allOf = cs.getAllOf();
- if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) {
- // NOTE: this function also adds the allOf propesrties inside schema
- addProperties(selfProperties, selfRequired, schema);
- }
- if (result.discriminator != null) {
- selfRequired.add(result.discriminator.getPropertyBaseName());
- }
- Set selfRequiredSet = new HashSet(selfRequired);
-
- List reqVars = result.getRequiredVars();
- if (reqVars != null) {
- for (CodegenProperty cp: reqVars) {
- String propName = cp.baseName;
- if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) {
- // if var is in otherRequiredSet and is not in selfRequiredSet and is in result.requiredVars
- // then set it to nullable because the user doesn't have to give a value for it
- cp.setDefaultValue("nulltype.Null");
- }
- }
- }
- }
-
- /**
- * Sets the value of the 'model.parent' property in CodegenModel
- * We have a custom version of this function so we can add the dataType on the ArrayModel
- */
- @Override
- protected void addParentContainer(CodegenModel model, String name, Schema schema) {
- super.addParentContainer(model, name, schema);
-
- List referencedModelNames = new ArrayList();
- model.dataType = getTypeString(schema, "", "", referencedModelNames);
- }
-
- /**
- * Convert OAS Model object to Codegen Model object
- * We have a custom version of this method so we can:
- * - set the correct regex values for requiredVars + optionalVars
- * - set model.defaultValue and model.hasRequired per the three use cases defined in this method
- *
- * @param name the name of the model
- * @param sc OAS Model object
- * @return Codegen Model object
- */
- @Override
- public CodegenModel fromModel(String name, Schema sc) {
- CodegenModel cm = super.fromModel(name, sc);
- if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) {
- addNullDefaultToOneOfAnyOfReqProps(sc, cm);
- }
- ArrayList> listOfLists = new ArrayList>();
- listOfLists.add(cm.requiredVars);
- listOfLists.add(cm.optionalVars);
- for (List cpList : listOfLists) {
- for (CodegenProperty cp : cpList) {
- // sets regex values
- postProcessModelProperty(cm, cp);
- }
- }
- Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc));
- if (isNotPythonModelSimpleModel) {
- return cm;
- }
- // Use cases for default values / enums of length one
- // 1. no default exists
- // schema does not contain default
- // cm.defaultValue unset, cm.hasRequired = true
- // 2. spec has a default
- // schema contains default
- // cm.defaultValue set, cm.hasRequired = false
- // different value here to differentiate between use case 3 below
- // This defaultValue is used when a consumer (client or server) lacks the input argument, defaultValue will be used
- // 3. only one value is allowed in an enum
- // schema does not contain default
- // cm.defaultValue set, cm.hasRequired = false
- // because we know what value needs to be set so the user doesn't need to input it
- // This defaultValue is used in the client and is sent to the server
- String defaultValue = toDefaultValue(sc);
- if (sc.getDefault() == null && defaultValue == null) {
- cm.hasRequired = true;
- } else if (sc.getDefault() != null) {
- cm.defaultValue = defaultValue;
- cm.hasRequired = false;
- } else if (defaultValue != null && cm.defaultValue == null) {
- cm.defaultValue = defaultValue;
- cm.hasRequired = false;
- }
- return cm;
- }
-
- /**
- * Returns the python type for the property.
- *
- * @param schema property schema
- * @return string presentation of the type
- **/
- @SuppressWarnings("static-method")
- @Override
- public String getSchemaType(Schema schema) {
- String openAPIType = getSingleSchemaType(schema);
- if (typeMapping.containsKey(openAPIType)) {
- String type = typeMapping.get(openAPIType);
- return type;
- }
- return toModelName(openAPIType);
- }
-
- public String getModelName(Schema sc) {
- if (sc.get$ref() != null) {
- Schema unaliasedSchema = unaliasSchema(sc, importMapping);
- if (unaliasedSchema.get$ref() != null) {
- return toModelName(ModelUtils.getSimpleRef(sc.get$ref()));
- }
- }
- return null;
- }
-
- /**
- * Return a string representation of the Python types for the specified OAS schema.
- * Primitive types in the OAS specification are implemented in Python using the corresponding
- * Python primitive types.
- * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types.
- *
- * The caller should set the prefix and suffix arguments to empty string, except when
- * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified
- * to wrap the return value in a python dict, list or tuple.
- *
- * Examples:
- * - "bool, date, float" The data must be a bool, date or float.
- * - "[bool, date]" The data must be an array, and the array items must be a bool or date.
- *
- * @param p The OAS schema.
- * @param prefix prepended to the returned value.
- * @param suffix appended to the returned value.
- * @param referencedModelNames a list of models that are being referenced while generating the types,
- * may be used to generate imports.
- * @return a comma-separated string representation of the Python types
- */
- private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) {
- String fullSuffix = suffix;
- if (")".equals(suffix)) {
- fullSuffix = "," + suffix;
- }
- if (StringUtils.isNotEmpty(p.get$ref())) {
- // The input schema is a reference. If the resolved schema is
- // a composed schema, convert the name to a Python class.
- Schema unaliasedSchema = unaliasSchema(p, importMapping);
- if (unaliasedSchema.get$ref() != null) {
- String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref()));
- if (referencedModelNames != null) {
- referencedModelNames.add(modelName);
- }
- return prefix + modelName + fullSuffix;
- }
- }
- if (isAnyTypeSchema(p)) {
- return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix;
- }
- // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references.
- if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) {
- fullSuffix = ", none_type" + suffix;
- }
- if (isFreeFormObject(p) && getAdditionalProperties(p) == null) {
- return prefix + "bool, date, datetime, dict, float, int, list, str" + fullSuffix;
- }
- if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) {
- Schema inner = getAdditionalProperties(p);
- return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix;
- } else if (ModelUtils.isArraySchema(p)) {
- ArraySchema ap = (ArraySchema) p;
- Schema inner = ap.getItems();
- if (inner == null) {
- // In OAS 3.0.x, the array "items" attribute is required.
- // In OAS >= 3.1, the array "items" attribute is optional such that the OAS
- // specification is aligned with the JSON schema specification.
- // When "items" is not specified, the elements of the array may be anything at all.
- // In that case, the return value should be:
- // "[bool, date, datetime, dict, float, int, list, str, none_type]"
- // Using recursion to wrap the allowed python types in an array.
- Schema anyType = new Schema(); // A Schema without any attribute represents 'any type'.
- return getTypeString(anyType, "[", "]", referencedModelNames);
- } else {
- return prefix + getTypeString(inner, "[", "]", referencedModelNames) + fullSuffix;
- }
- }
- if (ModelUtils.isFileSchema(p)) {
- return prefix + "file_type" + fullSuffix;
- }
- String baseType = getSchemaType(p);
- return prefix + baseType + fullSuffix;
- }
-
- /**
- * Output the type declaration of a given name
- *
- * @param p property schema
- * @return a string presentation of the type
- */
- @Override
- public String getTypeDeclaration(Schema p) {
- // this is used to set dataType, which defines a python tuple of classes
- // in Python we will wrap this in () to make it a tuple but here we
- // will omit the parens so the generated documentaion will not include
- // them
- return getTypeString(p, "", "", null);
- }
-
- @Override
- public String toInstantiationType(Schema property) {
- if (ModelUtils.isArraySchema(property) || ModelUtils.isMapSchema(property) || property.getAdditionalProperties() != null) {
- return getSchemaType(property);
- }
- return super.toInstantiationType(property);
- }
-
- @Override
- protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
- Schema addProps = getAdditionalProperties(schema);
- if (addProps != null) {
- // if AdditionalProperties exists, get its datatype and
- // store it in codegenModel.additionalPropertiesType.
- // The 'addProps' may be a reference, getTypeDeclaration will resolve
- // the reference.
- List referencedModelNames = new ArrayList();
- codegenModel.additionalPropertiesType = getTypeString(addProps, "", "", referencedModelNames);
- if (referencedModelNames.size() != 0) {
- // Models that are referenced in the 'additionalPropertiesType' keyword
- // must be added to the imports.
- codegenModel.imports.addAll(referencedModelNames);
- }
- }
- // If addProps is null, the value of the 'additionalProperties' keyword is set
- // to false, i.e. no additional properties are allowed.
- }
-
- /**
- * Gets an example if it exists
- *
- * @param sc input schema
- * @return the example value
- */
- protected Object getObjectExample(Schema sc) {
- Schema schema = sc;
- String ref = sc.get$ref();
- if (ref != null) {
- schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref));
- }
- // TODO handle examples in object models in the future
- Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema));
- if (objectModel) {
- return null;
- }
- if (schema.getExample() != null) {
- return schema.getExample();
- } if (schema.getDefault() != null) {
- return schema.getDefault();
- } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) {
- return schema.getEnum().get(0);
- }
- return null;
- }
-
- /***
- * Ensures that the string has a leading and trailing quote
- *
- * @param in input string
- * @return quoted string
- */
- private String ensureQuotes(String in) {
- Pattern pattern = Pattern.compile("\r\n|\r|\n");
- Matcher matcher = pattern.matcher(in);
- if (matcher.find()) {
- // if a string has a new line in it add triple quotes to make it a python multiline string
- return "'''" + in + "'''";
- }
- String strPattern = "^['\"].*?['\"]$";
- if (in.matches(strPattern)) {
- return in;
- }
- return "\"" + in + "\"";
- }
-
- public String toExampleValue(Schema schema, Object objExample) {
- String modelName = getModelName(schema);
- return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0);
- }
-
- private Boolean simpleStringSchema(Schema schema) {
- Schema sc = schema;
- String ref = schema.get$ref();
- if (ref != null) {
- sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref));
- }
- if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) {
- return true;
- }
- return false;
- }
-
- private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) {
- for ( MappedModel mm : disc.getMappedModels() ) {
- String modelName = mm.getModelName();
- Schema modelSchema = getModelNameToSchemaCache().get(modelName);
- if (ModelUtils.isObjectSchema(modelSchema)) {
- return mm;
- }
- }
- return null;
- }
-
- /***
- * Recursively generates string examples for schemas
- *
- * @param modelName the string name of the refed model that will be generated for the schema or null
- * @param schema the schema that we need an example for
- * @param objExample the example that applies to this schema, for now only string example are used
- * @param indentationLevel integer indentation level that we are currently at
- * we assume the indentaion amount is 4 spaces times this integer
- * @param prefix the string prefix that we will use when assigning an example for this line
- * this is used when setting key: value, pairs "key: " is the prefix
- * and this is used when setting properties like some_property='some_property_example'
- * @param exampleLine this is the current line that we are generatign an example for, starts at 0
- * we don't indentin the 0th line because using the example value looks like:
- * prop = ModelName( line 0
- * some_property='some_property_example' line 1
- * ) line 2
- * and our example value is:
- * ModelName( line 0
- * some_property='some_property_example' line 1
- * ) line 2
- * @return the string example
- */
- private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine) {
- final String indentionConst = " ";
- String currentIndentation = "";
- String closingIndentation = "";
- for (int i=0 ; i < indentationLevel ; i++) currentIndentation += indentionConst;
- if (exampleLine.equals(0)) {
- closingIndentation = currentIndentation;
- currentIndentation = "";
- } else {
- closingIndentation = currentIndentation;
- }
- String openChars = "";
- String closeChars = "";
- if (modelName != null) {
- openChars = modelName+"(";
- closeChars = ")";
- }
-
- String fullPrefix = currentIndentation + prefix + openChars;
-
- String example = null;
- if (objExample != null) {
- example = objExample.toString();
- }
- if (null != schema.get$ref()) {
- Map allDefinitions = ModelUtils.getSchemas(this.openAPI);
- String ref = ModelUtils.getSimpleRef(schema.get$ref());
- Schema refSchema = allDefinitions.get(ref);
- if (null == refSchema) {
- LOGGER.warn("Unable to find referenced schema "+schema.get$ref()+"\n");
- return fullPrefix + "None" + closeChars;
- }
- String refModelName = getModelName(schema);
- return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine);
- } else if (ModelUtils.isNullType(schema) || isAnyTypeSchema(schema)) {
- // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x,
- // though this tooling supports it.
- return fullPrefix + "None" + closeChars;
- } else if (ModelUtils.isBooleanSchema(schema)) {
- if (objExample == null) {
- example = "True";
- } else {
- if ("false".equalsIgnoreCase(objExample.toString())) {
- example = "False";
- } else {
- example = "True";
- }
- }
- return fullPrefix + example + closeChars;
- } else if (ModelUtils.isDateSchema(schema)) {
- if (objExample == null) {
- example = pythonDate("1970-01-01");
- } else {
- example = pythonDate(objExample);
- }
- return fullPrefix + example + closeChars;
- } else if (ModelUtils.isDateTimeSchema(schema)) {
- if (objExample == null) {
- example = pythonDateTime("1970-01-01T00:00:00.00Z");
- } else {
- example = pythonDateTime(objExample);
- }
- return fullPrefix + example + closeChars;
- } else if (ModelUtils.isBinarySchema(schema)) {
- if (objExample == null) {
- example = "/path/to/file";
- }
- example = "open('" + example + "', 'rb')";
- return fullPrefix + example + closeChars;
- } else if (ModelUtils.isByteArraySchema(schema)) {
- if (objExample == null) {
- example = "'YQ=='";
- }
- return fullPrefix + example + closeChars;
- } else if (ModelUtils.isStringSchema(schema)) {
- if (objExample == null) {
- // a BigDecimal:
- if ("Number".equalsIgnoreCase(schema.getFormat())) {
- example = "2";
- return fullPrefix + example + closeChars;
- } else if (StringUtils.isNotBlank(schema.getPattern())) {
- String pattern = schema.getPattern();
- RgxGen rgxGen = new RgxGen(pattern);
- // this seed makes it so if we have [a-z] we pick a
- Random random = new Random(18);
- String sample = rgxGen.generate(random);
- // omit leading / and trailing /, omit trailing /i
- Pattern valueExtractor = Pattern.compile("^/?(.+?)/?.?$");
- Matcher m = valueExtractor.matcher(sample);
- if (m.find()) {
- example = m.group(m.groupCount());
- } else {
- example = "";
- }
- } else if (schema.getMinLength() != null) {
- example = "";
- int len = schema.getMinLength().intValue();
- for (int i=0;i requiredAndOptionalProps = schema.getProperties();
- if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) {
- return fullPrefix + closeChars;
- }
-
- String example = fullPrefix + "\n";
- for (Map.Entry entry : requiredAndOptionalProps.entrySet()) {
- String propName = entry.getKey();
- Schema propSchema = entry.getValue();
- propName = toVarName(propName);
- String propModelName = null;
- Object propExample = null;
- if (discProp != null && propName.equals(discProp.name)) {
- propModelName = null;
- propExample = discProp.example;
- } else {
- propModelName = getModelName(propSchema);
- propExample = exampleFromStringOrArraySchema(propSchema, null, propName);
- }
- example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1) + ",\n";
- }
- // TODO handle additionalProperties also
- example += closingIndentation + closeChars;
- return example;
- }
-
- private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) {
- if (currentExample != null) {
- return currentExample;
- }
- Schema schema = sc;
- String ref = sc.get$ref();
- if (ref != null) {
- schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref));
- }
- Object example = getObjectExample(schema);
- if (example != null) {
- return example;
- } else if (simpleStringSchema(schema)) {
- return propName + "_example";
- } else if (ModelUtils.isArraySchema(schema)) {
- ArraySchema arraySchema = (ArraySchema) schema;
- Schema itemSchema = arraySchema.getItems();
- example = getObjectExample(itemSchema);
- if (example != null ) {
- return example;
- } else if (simpleStringSchema(itemSchema)) {
- return propName + "_example";
- }
- }
- return null;
- }
-
-
- /***
- *
- * Set the codegenParameter example value
- * We have a custom version of this function so we can invoke toExampleValue
- *
- * @param codegenParameter the item we are setting the example on
- * @param parameter the base parameter that came from the spec
- */
- @Override
- public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) {
- Schema schema = parameter.getSchema();
- if (schema == null) {
- LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema");
- return;
- }
-
- Object example = null;
- if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) {
- example = codegenParameter.vendorExtensions.get("x-example");
- } else if (parameter.getExample() != null) {
- example = parameter.getExample();
- } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) {
- example = parameter.getExamples().values().iterator().next().getValue();
- } else {
- example = getObjectExample(schema);
- }
- example = exampleFromStringOrArraySchema(schema, example, parameter.getName());
- String finalExample = toExampleValue(schema, example);
- codegenParameter.example = finalExample;
- }
-
- /**
- * Return the example value of the parameter.
- *
- * @param codegenParameter Codegen parameter
- * @param requestBody Request body
- */
- @Override
- public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) {
- if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) {
- codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example"));
- }
-
- Content content = requestBody.getContent();
-
- if (content.size() > 1) {
- // @see ModelUtils.getSchemaFromContent()
- once(LOGGER).warn("Multiple MediaTypes found, using only the first one");
- }
-
- MediaType mediaType = content.values().iterator().next();
- Schema schema = mediaType.getSchema();
- if (schema == null) {
- LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema");
- return;
- }
-
- Object example = null;
- if (mediaType.getExample() != null) {
- example = mediaType.getExample();
- } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) {
- example = mediaType.getExamples().values().iterator().next().getValue();
- } else {
- example = getObjectExample(schema);
- }
- example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName);
- codegenParameter.example = toExampleValue(schema, example);
- }
-
- /**
- * Create a CodegenParameter for a Form Property
- * We have a custom version of this method so we can invoke
- * setParameterExampleValue(codegenParameter, parameter)
- * rather than setParameterExampleValue(codegenParameter)
- * This ensures that all of our samples are generated in
- * toExampleValueRecursive
- *
- * @param name the property name
- * @param propertySchema the property schema
- * @param imports our import set
- * @return the resultant CodegenParameter
- */
- @Override
- public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) {
- CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports);
- Parameter p = new Parameter();
- p.setSchema(propertySchema);
- p.setName(cp.paramName);
- setParameterExampleValue(cp, p);
- return cp;
- }
-
- /**
- * Return a map from model name to Schema for efficient lookup.
- *
- * @return map from model name to Schema.
- */
- protected Map getModelNameToSchemaCache() {
- if (modelNameToSchemaCache == null) {
- // Create a cache to efficiently lookup schema based on model name.
- Map m = new HashMap();
- ModelUtils.getSchemas(openAPI).forEach((key, schema) -> {
- m.put(toModelName(key), schema);
- });
- modelNameToSchemaCache = Collections.unmodifiableMap(m);
- }
- return modelNameToSchemaCache;
- }
-}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
new file mode 100644
index 000000000000..372e6becdbcd
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
@@ -0,0 +1,1053 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.languages;
+
+import com.github.curiousoddman.rgxgen.RgxGen;
+import io.swagger.v3.oas.models.examples.Example;
+import io.swagger.v3.oas.models.media.ArraySchema;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.meta.features.*;
+import org.openapitools.codegen.utils.ModelUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static org.openapitools.codegen.utils.StringUtils.camelize;
+import static org.openapitools.codegen.utils.StringUtils.underscore;
+
+public class PythonLegacyClientCodegen extends DefaultCodegen implements CodegenConfig {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PythonLegacyClientCodegen.class);
+
+ public static final String PACKAGE_URL = "packageUrl";
+ public static final String DEFAULT_LIBRARY = "urllib3";
+ // nose is a python testing framework, we use pytest if USE_NOSE is unset
+ public static final String USE_NOSE = "useNose";
+ public static final String RECURSION_LIMIT = "recursionLimit";
+
+ protected String packageName = "openapi_client";
+ protected String packageVersion = "1.0.0";
+ protected String projectName; // for setup.py, e.g. petstore-api
+ protected String packageUrl;
+ protected String apiDocPath = "docs/";
+ protected String modelDocPath = "docs/";
+ protected boolean useNose = Boolean.FALSE;
+
+ protected Map regexModifiers;
+
+ private String testFolder;
+
+ public PythonLegacyClientCodegen() {
+ super();
+
+ modifyFeatureSet(features -> features
+ .includeDocumentationFeatures(DocumentationFeature.Readme)
+ .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
+ .securityFeatures(EnumSet.of(
+ SecurityFeature.BasicAuth,
+ SecurityFeature.BearerToken,
+ SecurityFeature.ApiKey,
+ SecurityFeature.OAuth2_Implicit
+ ))
+ .excludeGlobalFeatures(
+ GlobalFeature.XMLStructureDefinitions,
+ GlobalFeature.Callbacks,
+ GlobalFeature.LinkObjects,
+ GlobalFeature.ParameterStyling
+ )
+ .excludeSchemaSupportFeatures(
+ SchemaSupportFeature.Polymorphism
+ )
+ .excludeParameterFeatures(
+ ParameterFeature.Cookie
+ )
+ );
+
+ // clear import mapping (from default generator) as python does not use it
+ // at the moment
+ importMapping.clear();
+
+ supportsInheritance = true;
+ modelPackage = "models";
+ apiPackage = "api";
+ outputFolder = "generated-code" + File.separatorChar + "python";
+
+ modelTemplateFiles.put("model.mustache", ".py");
+ apiTemplateFiles.put("api.mustache", ".py");
+
+ modelTestTemplateFiles.put("model_test.mustache", ".py");
+ apiTestTemplateFiles.put("api_test.mustache", ".py");
+
+ embeddedTemplateDir = templateDir = "python-legacy";
+
+ modelDocTemplateFiles.put("model_doc.mustache", ".md");
+ apiDocTemplateFiles.put("api_doc.mustache", ".md");
+
+ testFolder = "test";
+
+ // default HIDE_GENERATION_TIMESTAMP to true
+ hideGenerationTimestamp = Boolean.TRUE;
+
+ languageSpecificPrimitives.clear();
+ languageSpecificPrimitives.add("int");
+ languageSpecificPrimitives.add("float");
+ languageSpecificPrimitives.add("list");
+ languageSpecificPrimitives.add("dict");
+ languageSpecificPrimitives.add("bool");
+ languageSpecificPrimitives.add("str");
+ languageSpecificPrimitives.add("datetime");
+ languageSpecificPrimitives.add("date");
+ languageSpecificPrimitives.add("object");
+ // TODO file and binary is mapped as `file`
+ languageSpecificPrimitives.add("file");
+ languageSpecificPrimitives.add("bytes");
+
+ typeMapping.clear();
+ typeMapping.put("integer", "int");
+ typeMapping.put("float", "float");
+ typeMapping.put("number", "float");
+ typeMapping.put("long", "int");
+ typeMapping.put("double", "float");
+ typeMapping.put("array", "list");
+ typeMapping.put("set", "list");
+ typeMapping.put("map", "dict");
+ typeMapping.put("boolean", "bool");
+ typeMapping.put("string", "str");
+ typeMapping.put("date", "date");
+ typeMapping.put("DateTime", "datetime");
+ typeMapping.put("object", "object");
+ typeMapping.put("AnyType", "object");
+ typeMapping.put("file", "file");
+ // TODO binary should be mapped to byte array
+ // mapped to String as a workaround
+ typeMapping.put("binary", "str");
+ typeMapping.put("ByteArray", "str");
+ // map uuid to string for the time being
+ typeMapping.put("UUID", "str");
+ typeMapping.put("URI", "str");
+ typeMapping.put("null", "none_type");
+
+ // from https://docs.python.org/3/reference/lexical_analysis.html#keywords
+ setReservedWordsLowerCase(
+ Arrays.asList(
+ // local variable name used in API methods (endpoints)
+ "all_params", "resource_path", "path_params", "query_params",
+ "header_params", "form_params", "local_var_files", "body_params", "auth_settings",
+ // @property
+ "property",
+ // python reserved words
+ "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with",
+ "assert", "else", "if", "pass", "yield", "break", "except", "import",
+ "print", "class", "exec", "in", "raise", "continue", "finally", "is",
+ "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True",
+ "False", "async", "await"));
+
+ regexModifiers = new HashMap();
+ regexModifiers.put('i', "IGNORECASE");
+ regexModifiers.put('l', "LOCALE");
+ regexModifiers.put('m', "MULTILINE");
+ regexModifiers.put('s', "DOTALL");
+ regexModifiers.put('u', "UNICODE");
+ regexModifiers.put('x', "VERBOSE");
+
+ cliOptions.clear();
+ cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).")
+ .defaultValue("openapi_client"));
+ cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api)."));
+ cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.")
+ .defaultValue("1.0.0"));
+ cliOptions.add(new CliOption(PACKAGE_URL, "python package URL."));
+ cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG,
+ CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString()));
+ cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC)
+ .defaultValue(Boolean.TRUE.toString()));
+ cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC)
+ .defaultValue(Boolean.FALSE.toString()));
+ cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework").
+ defaultValue(Boolean.FALSE.toString()));
+ cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value."));
+
+ supportedLibraries.put("urllib3", "urllib3-based client");
+ supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)");
+ supportedLibraries.put("tornado", "tornado-based client");
+ CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: asyncio, tornado, urllib3");
+ libraryOption.setDefault(DEFAULT_LIBRARY);
+ cliOptions.add(libraryOption);
+ setLibrary(DEFAULT_LIBRARY);
+ }
+
+ @Override
+ public void processOpts() {
+ super.processOpts();
+
+ if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) {
+ LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)");
+ LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
+ }
+
+ Boolean excludeTests = false;
+
+ if (additionalProperties.containsKey(CodegenConstants.EXCLUDE_TESTS)) {
+ excludeTests = Boolean.valueOf(additionalProperties.get(CodegenConstants.EXCLUDE_TESTS).toString());
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
+ setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) {
+ setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME));
+ } else {
+ // default: set project based on package name
+ // e.g. petstore_api (package name) => petstore-api (project name)
+ setProjectName(packageName.replaceAll("_", "-"));
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {
+ setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION));
+ }
+
+ Boolean generateSourceCodeOnly = false;
+ if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) {
+ generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString());
+ }
+
+ additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName);
+ additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
+ additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
+
+ if (generateSourceCodeOnly) {
+ // tests in /test
+ testFolder = packagePath() + File.separatorChar + testFolder;
+ // api/model docs in /docs
+ apiDocPath = packagePath() + File.separatorChar + apiDocPath;
+ modelDocPath = packagePath() + File.separatorChar + modelDocPath;
+ }
+ // make api and model doc path available in mustache template
+ additionalProperties.put("apiDocPath", apiDocPath);
+ additionalProperties.put("modelDocPath", modelDocPath);
+
+ if (additionalProperties.containsKey(PACKAGE_URL)) {
+ setPackageUrl((String) additionalProperties.get(PACKAGE_URL));
+ }
+
+ if (additionalProperties.containsKey(USE_NOSE)) {
+ setUseNose((String) additionalProperties.get(USE_NOSE));
+ }
+
+ // check to see if setRecursionLimit is set and whether it's an integer
+ if (additionalProperties.containsKey(RECURSION_LIMIT)) {
+ try {
+ Integer.parseInt((String)additionalProperties.get(RECURSION_LIMIT));
+ } catch(NumberFormatException | NullPointerException e) {
+ throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000.");
+ }
+ }
+
+ String readmePath = "README.md";
+ String readmeTemplate = "README.mustache";
+ if (generateSourceCodeOnly) {
+ readmePath = packagePath() + "_" + readmePath;
+ readmeTemplate = "README_onlypackage.mustache";
+ }
+ supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath));
+
+ if (!generateSourceCodeOnly) {
+ supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini"));
+ supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt"));
+ supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt"));
+ supportingFiles.add(new SupportingFile("setup_cfg.mustache", "", "setup.cfg"));
+
+ supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
+ supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
+ supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
+ supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml"));
+ supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py"));
+ }
+ supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
+ supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py"));
+ supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + modelPackage, "__init__.py"));
+ supportingFiles.add(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + apiPackage, "__init__.py"));
+
+ // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files.
+ String[] packageNameSplits = packageName.split("\\.");
+ String currentPackagePath = "";
+ for (int i = 0; i < packageNameSplits.length - 1; i++) {
+ if (i > 0) {
+ currentPackagePath = currentPackagePath + File.separatorChar;
+ }
+ currentPackagePath = currentPackagePath + packageNameSplits[i];
+ supportingFiles.add(new SupportingFile("__init__.mustache", currentPackagePath, "__init__.py"));
+ }
+
+ supportingFiles.add(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py"));
+
+ if (Boolean.FALSE.equals(excludeTests)) {
+ supportingFiles.add(new SupportingFile("__init__.mustache", testFolder, "__init__.py"));
+ }
+
+ supportingFiles.add(new SupportingFile("api_client.mustache", packagePath(), "api_client.py"));
+
+ if ("asyncio".equals(getLibrary())) {
+ supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packagePath(), "rest.py"));
+ additionalProperties.put("asyncio", "true");
+ } else if ("tornado".equals(getLibrary())) {
+ supportingFiles.add(new SupportingFile("tornado/rest.mustache", packagePath(), "rest.py"));
+ additionalProperties.put("tornado", "true");
+ } else {
+ supportingFiles.add(new SupportingFile("rest.mustache", packagePath(), "rest.py"));
+ }
+
+ modelPackage = packageName + "." + modelPackage;
+ apiPackage = packageName + "." + apiPackage;
+
+ }
+
+ protected static String dropDots(String str) {
+ return str.replaceAll("\\.", "_");
+ }
+
+ @Override
+ public String toModelImport(String name) {
+ String modelImport;
+ if (StringUtils.startsWithAny(name, "import", "from")) {
+ modelImport = name;
+ } else {
+ modelImport = "from ";
+ if (!"".equals(modelPackage())) {
+ modelImport += modelPackage() + ".";
+ }
+ modelImport += toModelFilename(name) + " import " + name;
+ }
+ return modelImport;
+ }
+
+ @Override
+ public Map postProcessModels(Map objs) {
+ // process enum in models
+ return postProcessModelsEnum(objs);
+ }
+
+ @Override
+ public void postProcessParameter(CodegenParameter parameter) {
+ postProcessPattern(parameter.pattern, parameter.vendorExtensions);
+ }
+
+ @Override
+ public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
+ postProcessPattern(property.pattern, property.vendorExtensions);
+ }
+
+ /*
+ * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python
+ * does not support this in as natural a way so it needs to convert it. See
+ * https://docs.python.org/2/howto/regex.html#compilation-flags for details.
+ */
+ public void postProcessPattern(String pattern, Map vendorExtensions) {
+ if (pattern != null) {
+ int i = pattern.lastIndexOf('/');
+
+ //Must follow Perl /pattern/modifiers convention
+ if (pattern.charAt(0) != '/' || i < 2) {
+ throw new IllegalArgumentException("Pattern must follow the Perl "
+ + "/pattern/modifiers convention. " + pattern + " is not valid.");
+ }
+
+ String regex = pattern.substring(1, i).replace("'", "\\'");
+ List modifiers = new ArrayList();
+
+ for (char c : pattern.substring(i).toCharArray()) {
+ if (regexModifiers.containsKey(c)) {
+ String modifier = regexModifiers.get(c);
+ modifiers.add(modifier);
+ }
+ }
+
+ vendorExtensions.put("x-regex", regex);
+ vendorExtensions.put("x-modifiers", modifiers);
+ }
+ }
+
+ @Override
+ public CodegenType getTag() {
+ return CodegenType.CLIENT;
+ }
+
+ @Override
+ public String getName() {
+ return "python-legacy";
+ }
+
+ @Override
+ public String getHelp() {
+ return "Generates a Python client library.";
+ }
+
+ @Override
+ public String escapeReservedWord(String name) {
+ if (this.reservedWordsMappings().containsKey(name)) {
+ return this.reservedWordsMappings().get(name);
+ }
+ return "_" + name;
+ }
+
+ @Override
+ public String apiDocFileFolder() {
+ return (outputFolder + "/" + apiDocPath);
+ }
+
+ @Override
+ public String modelDocFileFolder() {
+ return (outputFolder + "/" + modelDocPath);
+ }
+
+ @Override
+ public String toModelDocFilename(String name) {
+ return toModelName(name);
+ }
+
+ @Override
+ public String toApiDocFilename(String name) {
+ return toApiName(name);
+ }
+
+ @Override
+ public String addRegularExpressionDelimiter(String pattern) {
+ if (StringUtils.isEmpty(pattern)) {
+ return pattern;
+ }
+
+ if (!pattern.matches("^/.*")) {
+ // Perform a negative lookbehind on each `/` to ensure that it is escaped.
+ return "/" + pattern.replaceAll("(? pet_id
+ name = underscore(name);
+
+ // remove leading underscore
+ name = name.replaceAll("^_*", "");
+
+ // for reserved word or word starting with number, append _
+ if (isReservedWord(name) || name.matches("^\\d.*")) {
+ name = escapeReservedWord(name);
+ }
+
+ return name;
+ }
+
+ @Override
+ public String toParamName(String name) {
+ // to avoid conflicts with 'callback' parameter for async call
+ if ("callback".equals(name)) {
+ return "param_callback";
+ }
+
+ // should be the same as variable name
+ return toVarName(name);
+ }
+
+ @Override
+ public String toModelName(String name) {
+ name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
+ // remove dollar sign
+ name = name.replaceAll("$", "");
+
+ // model name cannot use reserved keyword, e.g. return
+ if (isReservedWord(name)) {
+ LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name));
+ name = "model_" + name; // e.g. return => ModelReturn (after camelize)
+ }
+
+ // model name starts with number
+ if (name.matches("^\\d.*")) {
+ LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name));
+ name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
+ }
+
+ if (!StringUtils.isEmpty(modelNamePrefix)) {
+ name = modelNamePrefix + "_" + name;
+ }
+
+ if (!StringUtils.isEmpty(modelNameSuffix)) {
+ name = name + "_" + modelNameSuffix;
+ }
+
+ // camelize the model name
+ // phone_number => PhoneNumber
+ return camelize(name);
+ }
+
+ @Override
+ public String toModelFilename(String name) {
+ // underscore the model file name
+ // PhoneNumber => phone_number
+ return underscore(dropDots(toModelName(name)));
+ }
+
+ @Override
+ public String toModelTestFilename(String name) {
+ return "test_" + toModelFilename(name);
+ }
+
+ @Override
+ public String toApiFilename(String name) {
+ // replace - with _ e.g. created-at => created_at
+ name = name.replaceAll("-", "_");
+
+ // e.g. PhoneNumberApi.py => phone_number_api.py
+ return underscore(name + "_" + apiNameSuffix);
+ }
+
+ @Override
+ public String toApiTestFilename(String name) {
+ return "test_" + toApiFilename(name);
+ }
+
+ @Override
+ public String toApiName(String name) {
+ return super.toApiName(name);
+ }
+
+ @Override
+ public String toApiVarName(String name) {
+ if (name.length() == 0) {
+ return "default_api";
+ }
+ return underscore(name + "_" + apiNameSuffix);
+ }
+
+ @Override
+ public String toOperationId(String operationId) {
+ // throw exception if method name is empty (should not occur as an auto-generated method name will be used)
+ if (StringUtils.isEmpty(operationId)) {
+ throw new RuntimeException("Empty method name (operationId) not allowed");
+ }
+
+ // method name cannot use reserved keyword, e.g. return
+ if (isReservedWord(operationId)) {
+ LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
+ operationId = "call_" + operationId;
+ }
+
+ // operationId starts with a number
+ if (operationId.matches("^\\d.*")) {
+ LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
+ operationId = "call_" + operationId;
+ }
+
+ return underscore(sanitizeName(operationId));
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ public void setUseNose(String val) {
+ this.useNose = Boolean.valueOf(val);
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public void setPackageVersion(String packageVersion) {
+ this.packageVersion = packageVersion;
+ }
+
+ public void setPackageUrl(String packageUrl) {
+ this.packageUrl = packageUrl;
+ }
+
+ public String packagePath() {
+ return packageName.replace('.', File.separatorChar);
+ }
+
+ /**
+ * Generate Python package name from String `packageName`
+ *
+ * (PEP 0008) Python packages should also have short, all-lowercase names,
+ * although the use of underscores is discouraged.
+ *
+ * @param packageName Package name
+ * @return Python package name that conforms to PEP 0008
+ */
+ @SuppressWarnings("static-method")
+ public String generatePackageName(String packageName) {
+ return underscore(packageName.replaceAll("[^\\w]+", ""));
+ }
+
+ /**
+ * Return the default value of the property
+ *
+ * @param p OpenAPI property object
+ * @return string presentation of the default value of the property
+ */
+ @Override
+ public String toDefaultValue(Schema p) {
+ if (ModelUtils.isBooleanSchema(p)) {
+ if (p.getDefault() != null) {
+ if (Boolean.valueOf(p.getDefault().toString()) == false)
+ return "False";
+ else
+ return "True";
+ }
+ } else if (ModelUtils.isDateSchema(p)) {
+ // TODO
+ } else if (ModelUtils.isDateTimeSchema(p)) {
+ // TODO
+ } else if (ModelUtils.isNumberSchema(p)) {
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ }
+ } else if (ModelUtils.isIntegerSchema(p)) {
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ }
+ } else if (ModelUtils.isStringSchema(p)) {
+ if (p.getDefault() != null) {
+ if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find())
+ return "'''" + p.getDefault() + "'''";
+ else
+ return "'" + ((String) p.getDefault()).replaceAll("'", "\'") + "'";
+ }
+ } else if (ModelUtils.isArraySchema(p)) {
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String toRegularExpression(String pattern) {
+ return addRegularExpressionDelimiter(pattern);
+ }
+
+ @Override
+ public String toExampleValue(Schema schema) {
+ return toExampleValueRecursive(schema, new ArrayList(), 5);
+ }
+
+ private String toExampleValueRecursive(Schema schema, List included_schemas, int indentation) {
+ String indentation_string = "";
+ for (int i=0 ; i< indentation ; i++) indentation_string += " ";
+ String example = null;
+ if (schema.getExample() != null) {
+ example = schema.getExample().toString();
+ }
+
+ if (ModelUtils.isNullType(schema) && null != example) {
+ // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x,
+ // though this tooling supports it.
+ return "None";
+ }
+ // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans
+ if (ModelUtils.isBooleanSchema(schema) && null!=example) {
+ if ("false".equalsIgnoreCase(example)) example = "False";
+ else example = "True";
+ }
+
+ // correct "'"s into "'"s after toString()
+ if (ModelUtils.isStringSchema(schema) && schema.getDefault() != null && !ModelUtils.isDateSchema(schema) && !ModelUtils.isDateTimeSchema(schema)) {
+ example = (String) schema.getDefault();
+ }
+
+ if (StringUtils.isNotBlank(example) && !"null".equals(example)) {
+ if (ModelUtils.isStringSchema(schema)) {
+ example = "'" + example + "'";
+ }
+ return example;
+ }
+
+ if (schema.getEnum() != null && !schema.getEnum().isEmpty()) {
+ // Enum case:
+ example = schema.getEnum().get(0).toString();
+ if (ModelUtils.isStringSchema(schema)) {
+ example = "'" + escapeText(example) + "'";
+ }
+ if (null == example)
+ LOGGER.warn("Empty enum. Cannot built an example!");
+
+ return example;
+ } else if (null != schema.get$ref()) {
+ // $ref case:
+ Map allDefinitions = ModelUtils.getSchemas(this.openAPI);
+ String ref = ModelUtils.getSimpleRef(schema.get$ref());
+ if (allDefinitions != null) {
+ Schema refSchema = allDefinitions.get(ref);
+ if (null == refSchema) {
+ return "None";
+ } else {
+ String refTitle = refSchema.getTitle();
+ if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) {
+ refSchema.setTitle(ref);
+ }
+ if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) {
+ included_schemas.add(schema.getTitle());
+ }
+ return toExampleValueRecursive(refSchema, included_schemas, indentation);
+ }
+ } else {
+ LOGGER.warn("allDefinitions not defined in toExampleValue!\n");
+ }
+ }
+ if (ModelUtils.isDateSchema(schema)) {
+ example = "datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date()";
+ return example;
+ } else if (ModelUtils.isDateTimeSchema(schema)) {
+ example = "datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')";
+ return example;
+ } else if (ModelUtils.isBinarySchema(schema)) {
+ example = "bytes(b'blah')";
+ return example;
+ } else if (ModelUtils.isByteArraySchema(schema)) {
+ example = "YQ==";
+ } else if (ModelUtils.isStringSchema(schema)) {
+ // a BigDecimal:
+ if ("Number".equalsIgnoreCase(schema.getFormat())) {return "1";}
+ if (StringUtils.isNotBlank(schema.getPattern())) {
+ String pattern = schema.getPattern();
+ RgxGen rgxGen = new RgxGen(pattern);
+ // this seed makes it so if we have [a-z] we pick a
+ Random random = new Random(18);
+ String sample = rgxGen.generate(random);
+ // omit leading / and trailing /, omit trailing /i
+ Pattern valueExtractor = Pattern.compile("^/\\^?(.+?)\\$?/.?$");
+ Matcher m = valueExtractor.matcher(sample);
+ if (m.find()) {
+ example = m.group(m.groupCount());
+ } else {
+ example = sample;
+ }
+ }
+ if (example == null) {
+ example = "";
+ }
+ int len = 0;
+ if (null != schema.getMinLength()) {
+ len = schema.getMinLength().intValue();
+ if (len < 1) {
+ example = "";
+ } else {
+ for (int i=0;i reqs = schema.getRequired();
+
+ // if required and optionals
+ List reqs = new ArrayList<>();
+ if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
+ for (Object toAdd : schema.getProperties().keySet()) {
+ reqs.add((String) toAdd);
+ }
+
+ Map properties = schema.getProperties();
+ Set propkeys = null;
+ if (properties != null) propkeys = properties.keySet();
+ if (toExclude != null && reqs.contains(toExclude)) {
+ reqs.remove(toExclude);
+ }
+ for (String toRemove : included_schemas) {
+ if (reqs.contains(toRemove)) {
+ reqs.remove(toRemove);
+ }
+ }
+ if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) {
+ included_schemas.add(schema.getTitle());
+ }
+ if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) {
+ reqs.add((String) toAdd);
+ }
+ if (null != propkeys) for (String propname : propkeys) {
+ Schema schema2 = properties.get(propname);
+ if (reqs.contains(propname)) {
+ String refTitle = schema2.getTitle();
+ if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) {
+ schema2.setTitle(propname);
+ }
+ example += "\n" + indentation_string + underscore(propname) + " = " +
+ toExampleValueRecursive(schema2, included_schemas, indentation + 1) + ", ";
+ }
+ }
+ }
+ example +=")";
+ } else {
+ LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue");
+ }
+
+ if (ModelUtils.isStringSchema(schema)) {
+ example = "'" + escapeText(example) + "'";
+ }
+
+ return example;
+ }
+
+ @Override
+ public void setParameterExampleValue(CodegenParameter p) {
+ String example;
+
+ if (p.defaultValue == null) {
+ example = p.example;
+ } else {
+ p.example = p.defaultValue;
+ return;
+ }
+
+ String type = p.baseType;
+ if (type == null) {
+ type = p.dataType;
+ }
+
+ if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) {
+ if (example == null) {
+ example = p.paramName + "_example";
+ }
+ example = "'" + escapeText(example) + "'";
+ } else if ("Integer".equals(type) || "int".equals(type)) {
+ if (example == null) {
+ example = "56";
+ }
+ } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) {
+ if (example == null) {
+ example = "3.4";
+ }
+ } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) {
+ if (example == null) {
+ example = "True";
+ }
+ } else if ("file".equalsIgnoreCase(type)) {
+ if (example == null) {
+ example = "/path/to/file";
+ }
+ example = "'" + escapeText(example) + "'";
+ } else if ("Date".equalsIgnoreCase(type)) {
+ if (example == null) {
+ example = "2013-10-20";
+ }
+ example = "'" + escapeText(example) + "'";
+ } else if ("DateTime".equalsIgnoreCase(type)) {
+ if (example == null) {
+ example = "2013-10-20T19:20:30+01:00";
+ }
+ example = "'" + escapeText(example) + "'";
+ } else if (!languageSpecificPrimitives.contains(type)) {
+ // type is a model class, e.g. User
+ example = this.packageName + "." + type + "()";
+ } else {
+ LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
+ }
+
+ if (example == null) {
+ example = "None";
+ } else if (Boolean.TRUE.equals(p.isArray)) {
+ example = "[" + example + "]";
+ } else if (Boolean.TRUE.equals(p.isMap)) {
+ example = "{'key': " + example + "}";
+ }
+
+ p.example = example;
+ }
+
+ @Override
+ public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) {
+ Schema schema = parameter.getSchema();
+
+ if (parameter.getExample() != null) {
+ codegenParameter.example = parameter.getExample().toString();
+ } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) {
+ Example example = parameter.getExamples().values().iterator().next();
+ if (example.getValue() != null) {
+ codegenParameter.example = example.getValue().toString();
+ }
+ } else if (schema != null && schema.getExample() != null) {
+ codegenParameter.example = schema.getExample().toString();
+ }
+
+ setParameterExampleValue(codegenParameter);
+ }
+
+ @Override
+ public String sanitizeTag(String tag) {
+ return sanitizeName(tag);
+ }
+
+ @Override
+ public String escapeQuotationMark(String input) {
+ // remove ' to avoid code injection
+ return input.replace("'", "");
+ }
+
+ @Override
+ public String escapeUnsafeCharacters(String input) {
+ // remove multiline comment
+ return input.replace("'''", "'_'_'");
+ }
+
+ @Override
+ public void postProcessFile(File file, String fileType) {
+ if (file == null) {
+ return;
+ }
+ String pythonPostProcessFile = System.getenv("PYTHON_POST_PROCESS_FILE");
+ if (StringUtils.isEmpty(pythonPostProcessFile)) {
+ return; // skip if PYTHON_POST_PROCESS_FILE env variable is not defined
+ }
+
+ // only process files with py extension
+ if ("py".equals(FilenameUtils.getExtension(file.toString()))) {
+ String command = pythonPostProcessFile + " " + file.toString();
+ try {
+ Process p = Runtime.getRuntime().exec(command);
+ int exitValue = p.waitFor();
+ if (exitValue != 0) {
+ LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue);
+ } else {
+ LOGGER.info("Successfully executed: " + command);
+ }
+ } catch (Exception e) {
+ LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
+ }
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
index 9a8d8ad03d2b..c3c1cf584e29 100644
--- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
+++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
@@ -89,8 +89,8 @@ org.openapitools.codegen.languages.PhpSymfonyServerCodegen
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
org.openapitools.codegen.languages.PowerShellClientCodegen
org.openapitools.codegen.languages.ProtobufSchemaCodegen
+org.openapitools.codegen.languages.PythonLegacyClientCodegen
org.openapitools.codegen.languages.PythonClientCodegen
-org.openapitools.codegen.languages.PythonClientExperimentalCodegen
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen
org.openapitools.codegen.languages.PythonBluePlanetServerCodegen
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache b/modules/openapi-generator/src/main/resources/python-legacy/README.mustache
similarity index 95%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/README.mustache
index 7368913ef8ea..9d854a4f1b9b 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/README.mustache
@@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
## Requirements.
-Python >= 3.5
+Python 2.7 and 3.4+
## Installation & Usage
### pip install
@@ -52,4 +52,4 @@ import {{{packageName}}}
Please follow the [installation procedure](#installation--usage) and then run the following:
-{{> python-experimental/README_common }}
+{{> common_README }}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache
similarity index 94%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache
index 3ef048b67a38..826454b1eac8 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache
@@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
## Requirements.
-Python >= 3.5
+Python 2.7 and 3.4+
## Installation & Usage
@@ -26,6 +26,7 @@ This python library package is generated without supporting files like setup.py
To be able to use it, you will need these dependencies in your own package that uses this library:
* urllib3 >= 1.15
+* six >= 1.10
* certifi
* python-dateutil
{{#asyncio}}
@@ -40,4 +41,4 @@ To be able to use it, you will need these dependencies in your own package that
In your own code, to use this library to connect and interact with {{{projectName}}},
you can run the following:
-{{> python-experimental/README_common }}
+{{> common_README }}
diff --git a/samples/client/petstore/python-experimental/test/__init__.py b/modules/openapi-generator/src/main/resources/python-legacy/__init__.mustache
similarity index 100%
rename from samples/client/petstore/python-experimental/test/__init__.py
rename to modules/openapi-generator/src/main/resources/python-legacy/__init__.mustache
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache
new file mode 100644
index 000000000000..db658a10fa89
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache
@@ -0,0 +1,7 @@
+from __future__ import absolute_import
+
+# flake8: noqa
+
+# import apis into api package
+{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
+{{/apis}}{{/apiInfo}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache
new file mode 100644
index 000000000000..2266b3d17f44
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache
@@ -0,0 +1,10 @@
+# coding: utf-8
+
+# flake8: noqa
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+# import models into model package
+{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}}
+{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache
similarity index 66%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache
index d7ff5b826025..f81dd5735fa9 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache
@@ -4,24 +4,25 @@
{{>partial_header}}
+from __future__ import absolute_import
+
__version__ = "{{packageVersion}}"
+# import apis into sdk package
+{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
+{{/apis}}{{/apiInfo}}
# import ApiClient
from {{packageName}}.api_client import ApiClient
-
-# import Configuration
from {{packageName}}.configuration import Configuration
-{{#hasHttpSignatureMethods}}
-from {{packageName}}.signing import HttpSigningConfiguration
-{{/hasHttpSignatureMethods}}
-
-# import exceptions
from {{packageName}}.exceptions import OpenApiException
-from {{packageName}}.exceptions import ApiAttributeError
from {{packageName}}.exceptions import ApiTypeError
from {{packageName}}.exceptions import ApiValueError
from {{packageName}}.exceptions import ApiKeyError
+from {{packageName}}.exceptions import ApiAttributeError
from {{packageName}}.exceptions import ApiException
+# import models into sdk package
+{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}
+{{/model}}{{/models}}
{{#recursionLimit}}
__import__('sys').setrecursionlimit({{{.}}})
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache
new file mode 100644
index 000000000000..38d137c3c401
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache
@@ -0,0 +1,294 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from {{packageName}}.api_client import ApiClient
+from {{packageName}}.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+{{#operations}}
+class {{classname}}(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+{{#operation}}
+
+ def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
+ """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
+
+{{#notes}}
+ {{{notes}}} # noqa: E501
+{{/notes}}
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+{{#sortParamsByRequiredFlag}}
+ >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True)
+{{/sortParamsByRequiredFlag}}
+{{^sortParamsByRequiredFlag}}
+ >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True)
+{{/sortParamsByRequiredFlag}}
+ >>> result = thread.get()
+
+{{#allParams}}
+ :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
+ :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}}
+{{/allParams}}
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501
+
+ def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
+ """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
+
+{{#notes}}
+ {{{notes}}} # noqa: E501
+{{/notes}}
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+{{#sortParamsByRequiredFlag}}
+ >>> 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_req=True)
+{{/sortParamsByRequiredFlag}}
+ >>> result = thread.get()
+
+{{#allParams}}
+ :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
+ :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}}
+{{/allParams}}
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: {{#returnType}}tuple({{returnType}}, status_code(int), headers(HTTPHeaderDict)){{/returnType}}{{^returnType}}None{{/returnType}}
+ """
+
+ {{#servers.0}}
+ local_var_hosts = [
+{{#servers}}
+ '{{{url}}}'{{^-last}},{{/-last}}
+{{/servers}}
+ ]
+ local_var_host = local_var_hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(local_var_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(local_var_host)
+ )
+ local_var_host = local_var_hosts[_host_index]
+ {{/servers.0}}
+ local_var_params = locals()
+
+ all_params = [
+{{#allParams}}
+ '{{paramName}}'{{^-last}},{{/-last}}
+{{/allParams}}
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params{{#servers.0}} and key != "_host_index"{{/servers.0}}:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method {{operationId}}" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+{{#allParams}}
+{{^isNullable}}
+{{#required}}
+ # verify the required parameter '{{paramName}}' is set
+ if self.api_client.client_side_validation and ('{{paramName}}' not in local_var_params or # noqa: E501
+ local_var_params['{{paramName}}'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501
+{{/required}}
+{{/isNullable}}
+{{/allParams}}
+
+{{#allParams}}
+{{#hasValidation}}
+ {{#maxLength}}
+ if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
+ len(local_var_params['{{paramName}}']) > {{maxLength}}): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
+ {{/maxLength}}
+ {{#minLength}}
+ if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
+ len(local_var_params['{{paramName}}']) < {{minLength}}): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
+ {{/minLength}}
+ {{#maximum}}
+ if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
+ {{/maximum}}
+ {{#minimum}}
+ if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
+ {{/minimum}}
+ {{#pattern}}
+ if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501
+ {{/pattern}}
+ {{#maxItems}}
+ if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
+ len(local_var_params['{{paramName}}']) > {{maxItems}}): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
+ {{/maxItems}}
+ {{#minItems}}
+ if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
+ len(local_var_params['{{paramName}}']) < {{minItems}}): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
+ {{/minItems}}
+{{/hasValidation}}
+{{#-last}}
+{{/-last}}
+{{/allParams}}
+ collection_formats = {}
+
+ path_params = {}
+{{#pathParams}}
+ if '{{paramName}}' in local_var_params:
+ path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501
+ collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
+{{/pathParams}}
+
+ query_params = []
+{{#queryParams}}
+ if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] is not None: # noqa: E501
+ query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isArray}} # noqa: E501
+ collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
+{{/queryParams}}
+
+ header_params = {}
+{{#headerParams}}
+ if '{{paramName}}' in local_var_params:
+ header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501
+ collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
+{{/headerParams}}
+
+ form_params = []
+ local_var_files = {}
+{{#formParams}}
+ if '{{paramName}}' in local_var_params:
+ {{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isArray}} # noqa: E501
+ collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
+{{/formParams}}
+
+ body_params = None
+{{#bodyParam}}
+ if '{{paramName}}' in local_var_params:
+ body_params = local_var_params['{{paramName}}']
+{{/bodyParam}}
+ {{#hasProduces}}
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) # noqa: E501
+
+ {{/hasProduces}}
+ {{#hasConsumes}}
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}]) # noqa: E501
+
+ {{/hasConsumes}}
+ # Authentication setting
+ auth_settings = [{{#authMethods}}'{{name}}'{{^-last}}, {{/-last}}{{/authMethods}}] # noqa: E501
+
+ {{#returnType}}
+ {{#responses}}
+ {{#-first}}
+ response_types_map = {
+ {{/-first}}
+ {{^isWildcard}}
+ {{code}}: {{#dataType}}"{{dataType}}"{{/dataType}}{{^dataType}}None{{/dataType}},
+ {{/isWildcard}}
+ {{#-last}}
+ }
+ {{/-last}}
+ {{/responses}}
+ {{/returnType}}
+ {{^returnType}}
+ response_types_map = {}
+ {{/returnType}}
+
+ return self.api_client.call_api(
+ '{{{path}}}', '{{httpMethod}}',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ {{#servers.0}}
+ _host=local_var_host,
+ {{/servers.0}}
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+{{/operation}}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache
new file mode 100644
index 000000000000..4f230dff623c
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache
@@ -0,0 +1,717 @@
+# coding: utf-8
+{{>partial_header}}
+from __future__ import absolute_import
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+# python 2 and python 3 compatibility library
+import six
+from six.moves.urllib.parse import quote
+{{#tornado}}
+import tornado.gen
+{{/tornado}}
+
+from {{packageName}}.configuration import Configuration
+import {{modelPackage}}
+from {{packageName}} import rest
+from {{packageName}}.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int if six.PY3 else long, # noqa: F821
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ if configuration is None:
+ configuration = Configuration.get_default_copy()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}'
+ self.client_side_validation = configuration.client_side_validation
+
+ {{#asyncio}}
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, exc_type, exc_value, traceback):
+ await self.close()
+ {{/asyncio}}
+ {{^asyncio}}
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
+ {{/asyncio}}
+
+ {{#asyncio}}async {{/asyncio}}def close(self):
+ {{#asyncio}}
+ await self.rest_client.close()
+ {{/asyncio}}
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+ {{#tornado}}
+ @tornado.gen.coroutine
+ {{/tornado}}
+ {{#asyncio}}async {{/asyncio}}def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ query_params = self.parameters_to_tuples(query_params,
+ collection_formats)
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ try:
+ # perform request and return response
+ response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request(
+ method, url, query_params=query_params, headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ e.body = e.body.decode('utf-8') if six.PY3 else e.body
+ raise e
+
+ self.last_response = response_data
+
+ return_data = response_data
+
+ if not _preload_content:
+ {{^tornado}}
+ return return_data
+ {{/tornado}}
+ {{#tornado}}
+ raise tornado.gen.Return(return_data)
+ {{/tornado}}
+
+ response_type = response_types_map.get(response_data.status, None)
+
+ if six.PY3 and response_type not in ["file", "bytes"]:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+
+ if response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+{{^tornado}}
+ if _return_http_data_only:
+ return (return_data)
+ else:
+ return (return_data, response_data.status,
+ response_data.getheaders())
+{{/tornado}}
+{{#tornado}}
+ if _return_http_data_only:
+ raise tornado.gen.Return(return_data)
+ else:
+ raise tornado.gen.Return((return_data, response_data.status,
+ response_data.getheaders()))
+{{/tornado}}
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
+ for attr, _ in six.iteritems(obj.openapi_types)
+ if getattr(obj, attr) is not None}
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in six.iteritems(obj_dict)}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('list['):
+ sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('dict('):
+ sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in six.iteritems(data)}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr({{modelPackage}}, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None,_preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :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,
+ header, and post parameters.
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.GET(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.HEAD(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.OPTIONS(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.POST(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.PUT(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.PATCH(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.DELETE(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in six.iteritems(files):
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ accepts = [x.lower() for x in accepts]
+
+ if 'application/json' in accepts:
+ return 'application/json'
+ else:
+ return ', '.join(accepts)
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return 'application/json'
+
+ content_types = [x.lower() for x in content_types]
+
+ if 'application/json' in content_types or '*/*' in content_types:
+ return 'application/json'
+ else:
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, querys, auth_settings,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param querys: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, querys, request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, querys, auth_setting)
+
+ def _apply_auth_params(self, headers, querys, auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param querys: Query parameters tuple list to be updated.
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ headers[auth_setting['key']] = auth_setting['value']
+ elif auth_setting['in'] == 'query':
+ querys.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return six.text_type(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+ has_discriminator = False
+ if (hasattr(klass, 'get_real_child_model')
+ and klass.discriminator_value_class_map):
+ has_discriminator = True
+
+ if not klass.openapi_types and has_discriminator is False:
+ return data
+
+ kwargs = {}
+ if (data is not None and
+ klass.openapi_types is not None and
+ isinstance(data, (list, dict))):
+ for attr, attr_type in six.iteritems(klass.openapi_types):
+ if klass.attribute_map[attr] in data:
+ value = data[klass.attribute_map[attr]]
+ kwargs[attr] = self.__deserialize(value, attr_type)
+
+ instance = klass(**kwargs)
+
+ if has_discriminator:
+ klass_name = instance.get_real_child_model(data)
+ if klass_name:
+ instance = self.__deserialize(data, klass_name)
+ return instance
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache
similarity index 73%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache
index f9dac707f7b9..dddec917196f 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache
@@ -11,7 +11,7 @@ Method | HTTP request | Description
{{#operations}}
{{#operation}}
# **{{{operationId}}}**
-> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
+> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
{{{summary}}}{{#notes}}
@@ -35,17 +35,18 @@ Method | HTTP request | Description
{{#isOAuth}}
* OAuth Authentication ({{name}}):
{{/isOAuth }}
+{{> api_doc_example }}
{{/authMethods}}
{{/hasAuthMethods}}
-{{> python-experimental/api_doc_example }}
+{{^hasAuthMethods}}
+{{> api_doc_example }}
+{{/hasAuthMethods}}
### Parameters
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
-{{#requiredParams}}{{^defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} |
-{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | defaults to {{{.}}}
-{{/defaultValue}}{{/requiredParams}}{{#optionalParams}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
-{{/optionalParams}}
+{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
+{{/allParams}}
### Return type
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache
new file mode 100644
index 000000000000..526c5950a012
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache
@@ -0,0 +1,26 @@
+```python
+from __future__ import print_function
+import time
+import {{{packageName}}}
+from {{{packageName}}}.rest import ApiException
+from pprint import pprint
+{{> python_doc_auth_partial}}
+# Enter a context with an instance of the API client
+{{#hasAuthMethods}}
+with {{{packageName}}}.ApiClient(configuration) as api_client:
+{{/hasAuthMethods}}
+{{^hasAuthMethods}}
+with {{{packageName}}}.ApiClient() as api_client:
+{{/hasAuthMethods}}
+ # Create an instance of the API class
+ api_instance = {{{packageName}}}.{{{classname}}}(api_client)
+ {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
+ {{/allParams}}
+
+ try:
+ {{#summary}} # {{{.}}}
+ {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}
+ pprint(api_response){{/returnType}}
+ except ApiException as e:
+ print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+```
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache
similarity index 77%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache
index f9276b443ce6..90fafc15f337 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache
@@ -2,17 +2,20 @@
{{>partial_header}}
+from __future__ import absolute_import
+
import unittest
import {{packageName}}
from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501
+from {{packageName}}.rest import ApiException
class {{#operations}}Test{{classname}}(unittest.TestCase):
"""{{classname}} unit test stubs"""
def setUp(self):
- self.api = {{classname}}() # noqa: E501
+ self.api = {{apiPackage}}.{{classVarName}}.{{classname}}() # noqa: E501
def tearDown(self):
pass
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache
new file mode 100644
index 000000000000..44531fce5a26
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache
@@ -0,0 +1,246 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+import io
+import json
+import logging
+import re
+import ssl
+
+import aiohttp
+import certifi
+# python 2 and python 3 compatibility library
+from six.moves.urllib.parse import urlencode
+
+from {{packageName}}.exceptions import ApiException, ApiValueError
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp, data):
+ self.aiohttp_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = data
+
+ def getheaders(self):
+ """Returns a CIMultiDictProxy of the response headers."""
+ return self.aiohttp_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.aiohttp_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+
+ # maxsize is number of requests to host that are allowed in parallel
+ if maxsize is None:
+ maxsize = configuration.connection_pool_maxsize
+
+ # ca_certs
+ if configuration.ssl_ca_cert:
+ ca_certs = configuration.ssl_ca_cert
+ else:
+ # if not set certificate file, use Mozilla's root certificates.
+ ca_certs = certifi.where()
+
+ ssl_context = ssl.create_default_context(cafile=ca_certs)
+ if configuration.cert_file:
+ ssl_context.load_cert_chain(
+ configuration.cert_file, keyfile=configuration.key_file
+ )
+
+ if not configuration.verify_ssl:
+ ssl_context.check_hostname = False
+ ssl_context.verify_mode = ssl.CERT_NONE
+
+ connector = aiohttp.TCPConnector(
+ limit=maxsize,
+ ssl=ssl_context
+ )
+
+ self.proxy = configuration.proxy
+ self.proxy_headers = configuration.proxy_headers
+
+ # https pool manager
+ self.pool_manager = aiohttp.ClientSession(
+ connector=connector
+ )
+
+ async def close(self):
+ await self.pool_manager.close()
+
+ async def request(self, method, url, query_params=None, headers=None,
+ body=None, post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Execute request
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: this is a non-applicable field for
+ the AiohttpClient.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ timeout = _request_timeout or 5 * 60
+
+ if 'Content-Type' not in headers:
+ headers['Content-Type'] = 'application/json'
+
+ args = {
+ "method": method,
+ "url": url,
+ "timeout": timeout,
+ "headers": headers
+ }
+
+ if self.proxy:
+ args["proxy"] = self.proxy
+ if self.proxy_headers:
+ args["proxy_headers"] = self.proxy_headers
+
+ if query_params:
+ args["url"] += '?' + urlencode(query_params)
+
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
+ if body is not None:
+ body = json.dumps(body)
+ args["data"] = body
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ args["data"] = aiohttp.FormData(post_params)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by aiohttp
+ del headers['Content-Type']
+ data = aiohttp.FormData()
+ for param in post_params:
+ k, v = param
+ if isinstance(v, tuple) and len(v) == 3:
+ data.add_field(k,
+ value=v[1],
+ filename=v[0],
+ content_type=v[2])
+ else:
+ data.add_field(k, v)
+ args["data"] = data
+
+ # Pass a `bytes` parameter directly in the body to support
+ # other content types than Json when `body` argument is provided
+ # in serialized form
+ elif isinstance(body, bytes):
+ args["data"] = body
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+
+ r = await self.pool_manager.request(**args)
+ if _preload_content:
+
+ data = await r.read()
+ r = RESTResponse(r, data)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ raise ApiException(http_resp=r)
+
+ return r
+
+ async def GET(self, url, headers=None, query_params=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params))
+
+ async def HEAD(self, url, headers=None, query_params=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params))
+
+ async def OPTIONS(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def DELETE(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def POST(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def PUT(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return (await self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def PATCH(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python-legacy/common_README.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/common_README.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/common_README.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache b/modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache
similarity index 97%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache
index ca6fc37747fd..9f2542f5a915 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache
@@ -2,6 +2,8 @@
{{>partial_header}}
+from __future__ import absolute_import
+
import copy
import logging
{{^asyncio}}
@@ -10,7 +12,8 @@ import multiprocessing
import sys
import urllib3
-from http import client as http_client
+import six
+from six.moves import http_client as httplib
from {{packageName}}.exceptions import ApiValueError
@@ -299,8 +302,9 @@ conf = {{{packageName}}}.Configuration(
# Enable client side validation
self.client_side_validation = True
- # Options to pass down to the underlying urllib3 socket
self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -385,7 +389,7 @@ conf = {{{packageName}}}.Configuration(
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
@property
@@ -407,17 +411,17 @@ conf = {{{packageName}}}.Configuration(
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
- # turn on http_client debug
- http_client.HTTPConnection.debuglevel = 1
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
- # turn off http_client debug
- http_client.HTTPConnection.debuglevel = 0
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache b/modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache
similarity index 83%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache
index 8d445c6e248e..6c7726953306 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache
@@ -2,6 +2,8 @@
{{>partial_header}}
+import six
+
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -118,11 +120,35 @@ class ApiException(OpenApiException):
return error_message
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, int):
+ if isinstance(pth, six.integer_types):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache
new file mode 100755
index 000000000000..8b3f689c9121
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache
@@ -0,0 +1,58 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="{{{gitHost}}}"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="{{{gitUserId}}}"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="{{{gitRepoId}}}"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="{{{releaseNote}}}"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/samples/client/petstore/python-experimental/.gitignore b/modules/openapi-generator/src/main/resources/python-legacy/gitignore.mustache
similarity index 100%
rename from samples/client/petstore/python-experimental/.gitignore
rename to modules/openapi-generator/src/main/resources/python-legacy/gitignore.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache
similarity index 53%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache
index 60c4b3789335..2cabff63c786 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache
@@ -3,7 +3,7 @@
stages:
- test
-.tests:
+.nosetest:
stage: test
script:
- pip install -r requirements.txt
@@ -15,15 +15,24 @@ stages:
- pytest --cov={{{packageName}}}
{{/useNose}}
-test-3.5:
- extends: .tests
+nosetest-2.7:
+ extends: .nosetest
+ image: python:2.7-alpine
+nosetest-3.3:
+ extends: .nosetest
+ image: python:3.3-alpine
+nosetest-3.4:
+ extends: .nosetest
+ image: python:3.4-alpine
+nosetest-3.5:
+ extends: .nosetest
image: python:3.5-alpine
-test-3.6:
- extends: .tests
+nosetest-3.6:
+ extends: .nosetest
image: python:3.6-alpine
-test-3.7:
- extends: .tests
+nosetest-3.7:
+ extends: .nosetest
image: python:3.7-alpine
-test-3.8:
- extends: .tests
+nosetest-3.8:
+ extends: .nosetest
image: python:3.8-alpine
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model.mustache
new file mode 100644
index 000000000000..857a3e48fb4d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/model.mustache
@@ -0,0 +1,254 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+import inspect
+import pprint
+import re # noqa: F401
+import six
+
+from {{packageName}}.configuration import Configuration
+
+
+{{#models}}
+{{#model}}
+class {{classname}}(object):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """{{#allowableValues}}
+
+ """
+ allowed enum values
+ """
+{{#enumVars}}
+ {{name}} = {{{value}}}{{^-last}}
+{{/-last}}
+{{/enumVars}}{{/allowableValues}}
+
+{{#allowableValues}}
+ allowable_values = [{{#enumVars}}{{name}}{{^-last}}, {{/-last}}{{/enumVars}}] # noqa: E501
+
+{{/allowableValues}}
+ """
+ Attributes:
+ openapi_types (dict): The key is attribute name
+ and the value is attribute type.
+ attribute_map (dict): The key is attribute name
+ and the value is json key in definition.
+ """
+ openapi_types = {
+{{#vars}}
+ '{{name}}': '{{{dataType}}}'{{^-last}},{{/-last}}
+{{/vars}}
+ }
+
+ attribute_map = {
+{{#vars}}
+ '{{name}}': '{{baseName}}'{{^-last}},{{/-last}}
+{{/vars}}
+ }
+{{#discriminator}}
+
+ discriminator_value_class_map = {
+{{#children}}
+ '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}}
+{{/children}}
+ }
+{{/discriminator}}
+
+ def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501
+ """{{classname}} - a model defined in OpenAPI""" # noqa: E501
+ if local_vars_configuration is None:
+ local_vars_configuration = Configuration()
+ self.local_vars_configuration = local_vars_configuration
+{{#vars}}{{#-first}}
+{{/-first}}
+ self._{{name}} = None
+{{/vars}}
+ self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}}
+{{#vars}}{{#-first}}
+{{/-first}}
+{{#required}}
+ self.{{name}} = {{name}}
+{{/required}}
+{{^required}}
+{{#isNullable}}
+ self.{{name}} = {{name}}
+{{/isNullable}}
+{{^isNullable}}
+ if {{name}} is not None:
+ self.{{name}} = {{name}}
+{{/isNullable}}
+{{/required}}
+{{/vars}}
+
+{{#vars}}
+ @property
+ def {{name}}(self):
+ """Gets the {{name}} of this {{classname}}. # noqa: E501
+
+{{#description}}
+ {{{description}}} # noqa: E501
+{{/description}}
+
+ :return: The {{name}} of this {{classname}}. # noqa: E501
+ :rtype: {{dataType}}
+ """
+ return self._{{name}}
+
+ @{{name}}.setter
+ def {{name}}(self, {{name}}):
+ """Sets the {{name}} of this {{classname}}.
+
+{{#description}}
+ {{{description}}} # noqa: E501
+{{/description}}
+
+ :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501
+ :type {{name}}: {{dataType}}
+ """
+{{^isNullable}}
+{{#required}}
+ if self.local_vars_configuration.client_side_validation and {{name}} is None: # noqa: E501
+ raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501
+{{/required}}
+{{/isNullable}}
+{{#isEnum}}
+{{#isContainer}}
+ allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
+{{#isArray}}
+ if (self.local_vars_configuration.client_side_validation and
+ not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501
+ raise ValueError(
+ "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
+ .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
+ ", ".join(map(str, allowed_values)))
+ )
+{{/isArray}}
+{{#isMap}}
+ if (self.local_vars_configuration.client_side_validation and
+ not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501
+ raise ValueError(
+ "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
+ .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
+ ", ".join(map(str, allowed_values)))
+ )
+{{/isMap}}
+{{/isContainer}}
+{{^isContainer}}
+ allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
+ if self.local_vars_configuration.client_side_validation and {{{name}}} not in allowed_values: # noqa: E501
+ raise ValueError(
+ "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501
+ .format({{{name}}}, allowed_values)
+ )
+{{/isContainer}}
+{{/isEnum}}
+{{^isEnum}}
+{{#hasValidation}}
+{{#maxLength}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and len({{name}}) > {{maxLength}}):
+ raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
+{{/maxLength}}
+{{#minLength}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and len({{name}}) < {{minLength}}):
+ raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
+{{/minLength}}
+{{#maximum}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501
+ raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
+{{/maximum}}
+{{#minimum}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501
+ raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
+{{/minimum}}
+{{#pattern}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501
+ raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501
+{{/pattern}}
+{{#maxItems}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and len({{name}}) > {{maxItems}}):
+ raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
+{{/maxItems}}
+{{#minItems}}
+ if (self.local_vars_configuration.client_side_validation and
+ {{name}} is not None and len({{name}}) < {{minItems}}):
+ raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
+{{/minItems}}
+{{/hasValidation}}
+{{/isEnum}}
+
+ self._{{name}} = {{name}}
+
+{{/vars}}
+{{#discriminator}}
+ def get_real_child_model(self, data):
+ """Returns the real base class specified by the discriminator"""
+ discriminator_key = self.attribute_map[self.discriminator]
+ discriminator_value = data[discriminator_key]
+ return self.discriminator_value_class_map.get(discriminator_value)
+
+{{/discriminator}}
+ def to_dict(self, serialize=False):
+ """Returns the model properties as a dict"""
+ result = {}
+
+ def convert(x):
+ if hasattr(x, "to_dict"):
+ args = inspect.getargspec(x.to_dict).args
+ if len(args) == 1:
+ return x.to_dict()
+ else:
+ return x.to_dict(serialize)
+ else:
+ return x
+
+ for attr, _ in six.iteritems(self.openapi_types):
+ value = getattr(self, attr)
+ attr = self.attribute_map.get(attr, attr) if serialize else attr
+ if isinstance(value, list):
+ result[attr] = list(map(
+ lambda x: convert(x),
+ value
+ ))
+ elif isinstance(value, dict):
+ result[attr] = dict(map(
+ lambda item: (item[0], convert(item[1])),
+ value.items()
+ ))
+ else:
+ result[attr] = convert(value)
+
+ return result
+
+ def to_str(self):
+ """Returns the string representation of the model"""
+ return pprint.pformat(self.to_dict())
+
+ def __repr__(self):
+ """For `print` and `pprint`"""
+ return self.to_str()
+
+ def __eq__(self, other):
+ """Returns true if both objects are equal"""
+ if not isinstance(other, {{classname}}):
+ return False
+
+ return self.to_dict() == other.to_dict()
+
+ def __ne__(self, other):
+ """Returns true if both objects are not equal"""
+ if not isinstance(other, {{classname}}):
+ return True
+
+ return self.to_dict() != other.to_dict()
+{{/model}}
+{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache
new file mode 100644
index 000000000000..fc90a2e0fc51
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache
@@ -0,0 +1,13 @@
+{{#models}}{{#model}}# {{classname}}
+
+{{#description}}{{&description}}
+{{/description}}
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
+{{/vars}}
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache
new file mode 100644
index 000000000000..6fb8ac7fb406
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+{{#models}}
+{{#model}}
+import {{packageName}}
+from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501
+from {{packageName}}.rest import ApiException
+
+class Test{{classname}}(unittest.TestCase):
+ """{{classname}} unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+{{^interfaces}}
+
+ def make_instance(self, include_optional):
+ """Test {{classname}}
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501
+ if include_optional :
+ return {{classname}}(
+{{#vars}}
+ {{name}} = {{#example}}{{{.}}}{{/example}}{{^example}}None{{/example}}{{^-last}}, {{/-last}}
+{{/vars}}
+ )
+ else :
+ return {{classname}}(
+{{#vars}}
+{{#required}}
+ {{name}} = {{#example}}{{{.}}}{{/example}}{{^example}}None{{/example}},
+{{/required}}
+{{/vars}}
+ )
+{{/interfaces}}
+
+ def test{{classname}}(self):
+ """Test {{classname}}"""
+{{^interfaces}}
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+{{/interfaces}}
+{{#interfaces}}
+{{#-last}}
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+{{/-last}}
+{{/interfaces}}
+{{/model}}
+{{/models}}
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache b/modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache
new file mode 100644
index 000000000000..c52fbceb138a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache
@@ -0,0 +1,17 @@
+"""
+{{#appName}}
+ {{{appName}}}
+{{/appName}}
+
+{{#appDescription}}
+ {{{appDescription}}} # noqa: E501
+{{/appDescription}}
+
+ {{#version}}
+ The version of the OpenAPI document: {{{version}}}
+ {{/version}}
+ {{#infoEmail}}
+ Contact: {{{infoEmail}}}
+ {{/infoEmail}}
+ Generated by: https://openapi-generator.tech
+"""
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache
new file mode 100644
index 000000000000..5106632d214e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache
@@ -0,0 +1,109 @@
+# Defining the host is optional and defaults to {{{basePath}}}
+# See configuration.py for a list of all supported configuration parameters.
+configuration = {{{packageName}}}.Configuration(
+ host = "{{{basePath}}}"
+)
+
+{{#hasAuthMethods}}
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+{{#authMethods}}
+{{#isBasic}}
+{{#isBasicBasic}}
+
+# Configure HTTP basic authorization: {{{name}}}
+configuration = {{{packageName}}}.Configuration(
+ username = 'YOUR_USERNAME',
+ password = 'YOUR_PASSWORD'
+)
+{{/isBasicBasic}}
+{{#isBasicBearer}}
+
+# Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}}
+configuration = {{{packageName}}}.Configuration(
+ access_token = 'YOUR_BEARER_TOKEN'
+)
+{{/isBasicBearer}}
+{{#isHttpSignature}}
+
+# Configure HTTP message signature: {{{name}}}
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See {{{packageName}}}.signing for a list of all supported parameters.
+configuration = {{{packageName}}}.Configuration(
+ host = "{{{basePath}}}",
+ signing_info = {{{packageName}}}.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019,
+ signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ {{{packageName}}}.signing.HEADER_REQUEST_TARGET,
+ {{{packageName}}}.signing.HEADER_CREATED,
+ {{{packageName}}}.signing.HEADER_EXPIRES,
+ {{{packageName}}}.signing.HEADER_HOST,
+ {{{packageName}}}.signing.HEADER_DATE,
+ {{{packageName}}}.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+{{/isHttpSignature}}
+{{/isBasic}}
+{{#isApiKey}}
+
+# Configure API key authorization: {{{name}}}
+configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY'
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['{{name}}'] = 'Bearer'
+{{/isApiKey}}
+{{#isOAuth}}
+
+# Configure OAuth2 access token for authorization: {{{name}}}
+configuration = {{{packageName}}}.Configuration(
+ host = "{{{basePath}}}"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+{{/isOAuth}}
+{{/authMethods}}
+{{/hasAuthMethods}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache b/modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache
similarity index 66%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache
index 2c2f00fcb27b..eb358efd5bd3 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache
@@ -1,5 +1,6 @@
-nulltype
certifi >= 14.05.14
+future; python_version<="2.7"
+six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/rest.mustache
similarity index 94%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/rest.mustache
index 5fb2da0af28c..391687862441 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/rest.mustache
@@ -2,17 +2,21 @@
{{>partial_header}}
+from __future__ import absolute_import
+
import io
import json
import logging
import re
import ssl
-from urllib.parse import urlencode
import certifi
+# python 2 and python 3 compatibility library
+import six
+from six.moves.urllib.parse import urlencode
import urllib3
-from {{packageName}}.exceptions import ApiException, ApiValueError
+from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
logger = logging.getLogger(__name__)
@@ -132,7 +136,7 @@ class RESTClientObject(object):
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
+ if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
@@ -212,6 +216,18 @@ class RESTClientObject(object):
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
+ if r.status == 401:
+ raise UnauthorizedException(http_resp=r)
+
+ if r.status == 403:
+ raise ForbiddenException(http_resp=r)
+
+ if r.status == 404:
+ raise NotFoundException(http_resp=r)
+
+ if 500 <= r.status <= 599:
+ raise ServiceException(http_resp=r)
+
raise ApiException(http_resp=r)
return r
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache
similarity index 80%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/setup.mustache
index 632584a592a7..a14de4016fa3 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache
@@ -16,22 +16,13 @@ VERSION = "{{packageVersion}}"
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = [
- "urllib3 >= 1.15",
- "certifi",
- "python-dateutil",
- "nulltype",
+REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
{{#asyncio}}
- "aiohttp >= 3.0.0",
+REQUIRES.append("aiohttp >= 3.0.0")
{{/asyncio}}
{{#tornado}}
- "tornado>=4.2,<5",
+REQUIRES.append("tornado>=4.2,<5")
{{/tornado}}
-{{#hasHttpSignatureMethods}}
- "pem>=19.3.0",
- "pycryptodome>=3.9.0",
-{{/hasHttpSignatureMethods}}
-]
setup(
name=NAME,
@@ -41,7 +32,6 @@ setup(
author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}",
url="{{packageUrl}}",
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
- python_requires=">=3.5",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache
new file mode 100644
index 000000000000..931f02c5d14d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache
@@ -0,0 +1,13 @@
+{{#useNose}}
+[nosetests]
+logging-clear-handlers=true
+verbosity=2
+randomize=true
+exe=true
+with-coverage=true
+cover-package={{{packageName}}}
+cover-erase=true
+
+{{/useNose}}
+[flake8]
+max-line-length=99
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache
new file mode 100644
index 000000000000..12021b47a1c2
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache
@@ -0,0 +1,12 @@
+{{#useNose}}
+coverage>=4.0.3
+nose>=1.3.7
+pluggy>=0.3.1
+py>=1.4.31
+randomize>=0.13
+{{/useNose}}
+{{^useNose}}
+pytest~=4.6.7 # needed for python 2.7+3.4
+pytest-cov>=2.8.1
+pytest-randomly==1.2.3 # needed for python 2.7+3.4
+{{/useNose}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache
new file mode 100644
index 000000000000..2679760ea5bd
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache
@@ -0,0 +1,224 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+import io
+import json
+import logging
+import re
+
+# python 2 and python 3 compatibility library
+from six.moves.urllib.parse import urlencode
+import tornado
+import tornado.gen
+from tornado import httpclient
+from urllib3.filepost import encode_multipart_formdata
+
+from {{packageName}}.exceptions import ApiException, ApiValueError
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp):
+ self.tornado_response = resp
+ self.status = resp.code
+ self.reason = resp.reason
+
+ if resp.body:
+ self.data = resp.body
+ else:
+ self.data = None
+
+ def getheaders(self):
+ """Returns a CIMultiDictProxy of the response headers."""
+ return self.tornado_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.tornado_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=4):
+ # maxsize is number of requests to host that are allowed in parallel
+
+ self.ca_certs = configuration.ssl_ca_cert
+ self.client_key = configuration.key_file
+ self.client_cert = configuration.cert_file
+
+ self.proxy_port = self.proxy_host = None
+
+ # https pool manager
+ if configuration.proxy:
+ self.proxy_port = 80
+ self.proxy_host = configuration.proxy
+
+ self.pool_manager = httpclient.AsyncHTTPClient()
+
+ @tornado.gen.coroutine
+ def request(self, method, url, query_params=None, headers=None, body=None,
+ post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Execute Request
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: this is a non-applicable field for
+ the AiohttpClient.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ request = httpclient.HTTPRequest(url)
+ request.allow_nonstandard_methods = True
+ request.ca_certs = self.ca_certs
+ request.client_key = self.client_key
+ request.client_cert = self.client_cert
+ request.proxy_host = self.proxy_host
+ request.proxy_port = self.proxy_port
+ request.method = method
+ if headers:
+ request.headers = headers
+ if 'Content-Type' not in headers:
+ request.headers['Content-Type'] = 'application/json'
+ request.request_timeout = _request_timeout or 5 * 60
+
+ post_params = post_params or {}
+
+ if query_params:
+ request.url += '?' + urlencode(query_params)
+
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
+ if body:
+ body = json.dumps(body)
+ request.body = body
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ request.body = urlencode(post_params)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ multipart = encode_multipart_formdata(post_params)
+ request.body, headers['Content-Type'] = multipart
+ # Pass a `bytes` parameter directly in the body to support
+ # other content types than Json when `body` argument is provided
+ # in serialized form
+ elif isinstance(body, bytes):
+ request.body = body
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+
+ r = yield self.pool_manager.fetch(request, raise_error=False)
+
+ if _preload_content:
+
+ r = RESTResponse(r)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ raise ApiException(http_resp=r)
+
+ raise tornado.gen.Return(r)
+
+ @tornado.gen.coroutine
+ def GET(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ result = yield self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ result = yield self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def DELETE(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ result = yield self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def POST(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def PUT(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def PATCH(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache b/modules/openapi-generator/src/main/resources/python-legacy/tox.mustache
similarity index 74%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/tox.mustache
index 4c771c472b8b..fe989faf9302 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/tox.mustache
@@ -1,5 +1,10 @@
[tox]
+{{^asyncio}}
+envlist = py27, py3
+{{/asyncio}}
+{{#asyncio}}
envlist = py3
+{{/asyncio}}
[testenv]
deps=-r{toxinidir}/requirements.txt
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache b/modules/openapi-generator/src/main/resources/python-legacy/travis.mustache
similarity index 90%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache
rename to modules/openapi-generator/src/main/resources/python-legacy/travis.mustache
index 3c255f64e991..195488737d6b 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/travis.mustache
@@ -1,6 +1,10 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
+ - "2.7"
+ - "3.2"
+ - "3.3"
+ - "3.4"
- "3.5"
- "3.6"
- "3.7"
diff --git a/modules/openapi-generator/src/main/resources/python/README.mustache b/modules/openapi-generator/src/main/resources/python/README.mustache
index 9d854a4f1b9b..463e4e0d5655 100644
--- a/modules/openapi-generator/src/main/resources/python/README.mustache
+++ b/modules/openapi-generator/src/main/resources/python/README.mustache
@@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
## Requirements.
-Python 2.7 and 3.4+
+Python >= 3.5
## Installation & Usage
### pip install
@@ -52,4 +52,4 @@ import {{{packageName}}}
Please follow the [installation procedure](#installation--usage) and then run the following:
-{{> common_README }}
+{{> README_common }}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/README_common.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache
rename to modules/openapi-generator/src/main/resources/python/README_common.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache
index 826454b1eac8..40dc242b7b6f 100644
--- a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache
+++ b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache
@@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
## Requirements.
-Python 2.7 and 3.4+
+Python >= 3.5
## Installation & Usage
@@ -26,7 +26,6 @@ This python library package is generated without supporting files like setup.py
To be able to use it, you will need these dependencies in your own package that uses this library:
* urllib3 >= 1.15
-* six >= 1.10
* certifi
* python-dateutil
{{#asyncio}}
@@ -41,4 +40,4 @@ To be able to use it, you will need these dependencies in your own package that
In your own code, to use this library to connect and interact with {{{projectName}}},
you can run the following:
-{{> common_README }}
+{{> README_common }}
diff --git a/modules/openapi-generator/src/main/resources/python/__init__api.mustache b/modules/openapi-generator/src/main/resources/python/__init__api.mustache
index db658a10fa89..8a9e6b91b952 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__api.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__api.mustache
@@ -1,7 +1,9 @@
-from __future__ import absolute_import
-
-# flake8: noqa
-
-# import apis into api package
-{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
-{{/apis}}{{/apiInfo}}
\ No newline at end of file
+{{#apiInfo}}
+{{#apis}}
+{{#-first}}
+# do not import all apis into this module because that uses a lot of memory and stack frames
+# if you need the ability to import all apis from one package, import them with
+# from {{packageName}}.apis import {{classname}}
+{{/-first}}
+{{/apis}}
+{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__apis.mustache b/modules/openapi-generator/src/main/resources/python/__init__apis.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/__init__apis.mustache
rename to modules/openapi-generator/src/main/resources/python/__init__apis.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/__init__model.mustache b/modules/openapi-generator/src/main/resources/python/__init__model.mustache
index 2266b3d17f44..cfe32b784926 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__model.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__model.mustache
@@ -1,10 +1,5 @@
-# coding: utf-8
-
-# flake8: noqa
-{{>partial_header}}
-
-from __future__ import absolute_import
-
-# import models into model package
-{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}}
-{{/models}}
+# we can not import model classes here because that would create a circular
+# reference which would not work in python2
+# do not import all models into this module because that uses a lot of memory and stack frames
+# if you need the ability to import all models from one package, import them with
+# from {{packageName}.models import ModelA, ModelB
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache b/modules/openapi-generator/src/main/resources/python/__init__models.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache
rename to modules/openapi-generator/src/main/resources/python/__init__models.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache
index f81dd5735fa9..d7ff5b826025 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache
@@ -4,25 +4,24 @@
{{>partial_header}}
-from __future__ import absolute_import
-
__version__ = "{{packageVersion}}"
-# import apis into sdk package
-{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
-{{/apis}}{{/apiInfo}}
# import ApiClient
from {{packageName}}.api_client import ApiClient
+
+# import Configuration
from {{packageName}}.configuration import Configuration
+{{#hasHttpSignatureMethods}}
+from {{packageName}}.signing import HttpSigningConfiguration
+{{/hasHttpSignatureMethods}}
+
+# import exceptions
from {{packageName}}.exceptions import OpenApiException
+from {{packageName}}.exceptions import ApiAttributeError
from {{packageName}}.exceptions import ApiTypeError
from {{packageName}}.exceptions import ApiValueError
from {{packageName}}.exceptions import ApiKeyError
-from {{packageName}}.exceptions import ApiAttributeError
from {{packageName}}.exceptions import ApiException
-# import models into sdk package
-{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}
-{{/model}}{{/models}}
{{#recursionLimit}}
__import__('sys').setrecursionlimit({{{.}}})
diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache
index 38d137c3c401..0e76b3f29fb2 100644
--- a/modules/openapi-generator/src/main/resources/python/api.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api.mustache
@@ -2,18 +2,22 @@
{{>partial_header}}
-from __future__ import absolute_import
-
import re # noqa: F401
+import sys # noqa: F401
-# python 2 and python 3 compatibility library
-import six
-
-from {{packageName}}.api_client import ApiClient
-from {{packageName}}.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+from {{packageName}}.api_client import ApiClient, Endpoint
+from {{packageName}}.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+{{#imports}}
+{{{import}}}
+{{/imports}}
{{#operations}}
@@ -30,265 +34,275 @@ class {{classname}}(object):
self.api_client = api_client
{{#operation}}
- def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
- """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
+ def __{{operationId}}(
+ self,
+{{#requiredParams}}
+{{^defaultValue}}
+ {{paramName}},
+{{/defaultValue}}
+{{/requiredParams}}
+{{#requiredParams}}
+{{#defaultValue}}
+ {{paramName}}={{{defaultValue}}},
+{{/defaultValue}}
+{{/requiredParams}}
+ **kwargs
+ ):
+ """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
{{#notes}}
- {{{notes}}} # noqa: E501
+ {{{notes}}} # noqa: E501
{{/notes}}
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
-{{#sortParamsByRequiredFlag}}
- >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True)
-{{/sortParamsByRequiredFlag}}
-{{^sortParamsByRequiredFlag}}
- >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True)
-{{/sortParamsByRequiredFlag}}
- >>> result = thread.get()
+ >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True)
+ >>> result = thread.get()
-{{#allParams}}
- :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
- :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}}
-{{/allParams}}
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
- """
- kwargs['_return_http_data_only'] = True
- return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501
-
- def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
- """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
-
-{{#notes}}
- {{{notes}}} # noqa: E501
-{{/notes}}
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
+{{#requiredParams}}
+{{#-last}}
+ Args:
+{{/-last}}
+{{/requiredParams}}
+{{#requiredParams}}
+{{^defaultValue}}
+ {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}}
+{{/defaultValue}}
+{{/requiredParams}}
+{{#requiredParams}}
+{{#defaultValue}}
+ {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]
+{{/defaultValue}}
+{{/requiredParams}}
-{{#sortParamsByRequiredFlag}}
- >>> 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_req=True)
-{{/sortParamsByRequiredFlag}}
- >>> result = thread.get()
+ Keyword Args:{{#optionalParams}}
+ {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}}
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
-{{#allParams}}
- :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
- :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}}
-{{/allParams}}
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: {{#returnType}}tuple({{returnType}}, status_code(int), headers(HTTPHeaderDict)){{/returnType}}{{^returnType}}None{{/returnType}}
- """
+ Returns:
+ {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+{{#requiredParams}}
+ kwargs['{{paramName}}'] = \
+ {{paramName}}
+{{/requiredParams}}
+ return self.call_with_http_info(**kwargs)
- {{#servers.0}}
- local_var_hosts = [
+ self.{{operationId}} = Endpoint(
+ settings={
+ 'response_type': {{#returnType}}({{{returnType}}},){{/returnType}}{{^returnType}}None{{/returnType}},
+{{#authMethods}}
+{{#-first}}
+ 'auth': [
+{{/-first}}
+ '{{name}}'{{^-last}},{{/-last}}
+{{#-last}}
+ ],
+{{/-last}}
+{{/authMethods}}
+{{^authMethods}}
+ 'auth': [],
+{{/authMethods}}
+ 'endpoint_path': '{{{path}}}',
+ 'operation_id': '{{operationId}}',
+ 'http_method': '{{httpMethod}}',
{{#servers}}
- '{{{url}}}'{{^-last}},{{/-last}}
+{{#-first}}
+ 'servers': [
+{{/-first}}
+ {
+ 'url': "{{{url}}}",
+ 'description': "{{{description}}}{{^description}}No description provided{{/description}}",
+ {{#variables}}
+ {{#-first}}
+ 'variables': {
+ {{/-first}}
+ '{{{name}}}': {
+ 'description': "{{{description}}}{{^description}}No description provided{{/description}}",
+ 'default_value': "{{{defaultValue}}}",
+ {{#enumValues}}
+ {{#-first}}
+ 'enum_values': [
+ {{/-first}}
+ "{{{.}}}"{{^-last}},{{/-last}}
+ {{#-last}}
+ ]
+ {{/-last}}
+ {{/enumValues}}
+ }{{^-last}},{{/-last}}
+ {{#-last}}
+ }
+ {{/-last}}
+ {{/variables}}
+ },
+{{#-last}}
+ ]
+{{/-last}}
{{/servers}}
- ]
- local_var_host = local_var_hosts[0]
- if kwargs.get('_host_index'):
- _host_index = int(kwargs.get('_host_index'))
- if _host_index < 0 or _host_index >= len(local_var_hosts):
- raise ApiValueError(
- "Invalid host index. Must be 0 <= index < %s"
- % len(local_var_host)
- )
- local_var_host = local_var_hosts[_host_index]
- {{/servers.0}}
- local_var_params = locals()
-
- all_params = [
+{{^servers}}
+ 'servers': None,
+{{/servers}}
+ },
+ params_map={
+ 'all': [
{{#allParams}}
- '{{paramName}}'{{^-last}},{{/-last}}
+ '{{paramName}}',
{{/allParams}}
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
- )
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params{{#servers.0}} and key != "_host_index"{{/servers.0}}:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method {{operationId}}" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
+ ],
+{{#requiredParams}}
+{{#-first}}
+ 'required': [
+{{/-first}}
+ '{{paramName}}',
+{{#-last}}
+ ],
+{{/-last}}
+{{/requiredParams}}
+{{^requiredParams}}
+ 'required': [],
+{{/requiredParams}}
+ 'nullable': [
{{#allParams}}
-{{^isNullable}}
-{{#required}}
- # verify the required parameter '{{paramName}}' is set
- if self.api_client.client_side_validation and ('{{paramName}}' not in local_var_params or # noqa: E501
- local_var_params['{{paramName}}'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501
-{{/required}}
+{{#isNullable}}
+ '{{paramName}}',
{{/isNullable}}
{{/allParams}}
-
+ ],
+ 'enum': [
+{{#allParams}}
+{{#isEnum}}
+ '{{paramName}}',
+{{/isEnum}}
+{{/allParams}}
+ ],
+ 'validation': [
{{#allParams}}
{{#hasValidation}}
- {{#maxLength}}
- if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
- len(local_var_params['{{paramName}}']) > {{maxLength}}): # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
- {{/maxLength}}
- {{#minLength}}
- if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
- len(local_var_params['{{paramName}}']) < {{minLength}}): # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
- {{/minLength}}
- {{#maximum}}
- if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
- {{/maximum}}
- {{#minimum}}
- if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
- {{/minimum}}
- {{#pattern}}
- if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501
- {{/pattern}}
- {{#maxItems}}
- if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
- len(local_var_params['{{paramName}}']) > {{maxItems}}): # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
- {{/maxItems}}
- {{#minItems}}
- if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501
- len(local_var_params['{{paramName}}']) < {{minItems}}): # noqa: E501
- raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
- {{/minItems}}
+ '{{paramName}}',
{{/hasValidation}}
-{{#-last}}
-{{/-last}}
{{/allParams}}
- collection_formats = {}
-
- path_params = {}
-{{#pathParams}}
- if '{{paramName}}' in local_var_params:
- path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501
- collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
-{{/pathParams}}
-
- query_params = []
-{{#queryParams}}
- if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] is not None: # noqa: E501
- query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isArray}} # noqa: E501
- collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
-{{/queryParams}}
-
- header_params = {}
-{{#headerParams}}
- if '{{paramName}}' in local_var_params:
- header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501
- collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
-{{/headerParams}}
-
- form_params = []
- local_var_files = {}
-{{#formParams}}
- if '{{paramName}}' in local_var_params:
- {{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isArray}} # noqa: E501
- collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501
-{{/formParams}}
-
- body_params = None
-{{#bodyParam}}
- if '{{paramName}}' in local_var_params:
- body_params = local_var_params['{{paramName}}']
-{{/bodyParam}}
- {{#hasProduces}}
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) # noqa: E501
-
- {{/hasProduces}}
- {{#hasConsumes}}
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}]) # noqa: E501
-
- {{/hasConsumes}}
- # Authentication setting
- auth_settings = [{{#authMethods}}'{{name}}'{{^-last}}, {{/-last}}{{/authMethods}}] # noqa: E501
-
- {{#returnType}}
- {{#responses}}
- {{#-first}}
- response_types_map = {
- {{/-first}}
- {{^isWildcard}}
- {{code}}: {{#dataType}}"{{dataType}}"{{/dataType}}{{^dataType}}None{{/dataType}},
- {{/isWildcard}}
- {{#-last}}
- }
- {{/-last}}
- {{/responses}}
- {{/returnType}}
- {{^returnType}}
- response_types_map = {}
- {{/returnType}}
-
- return self.api_client.call_api(
- '{{{path}}}', '{{httpMethod}}',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- {{#servers.0}}
- _host=local_var_host,
- {{/servers.0}}
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
+ ]
+ },
+ root_map={
+ 'validations': {
+{{#allParams}}
+{{#hasValidation}}
+ ('{{paramName}}',): {
+{{#maxLength}}
+ 'max_length': {{maxLength}},{{/maxLength}}{{#minLength}}
+ 'min_length': {{minLength}},{{/minLength}}{{#maxItems}}
+ 'max_items': {{maxItems}},{{/maxItems}}{{#minItems}}
+ 'min_items': {{minItems}},{{/minItems}}{{#maximum}}
+ {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}}
+ {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}}
+ 'regex': {
+ 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}}
+ {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}}
+ },{{/pattern}}
+ },
+{{/hasValidation}}
+{{/allParams}}
+ },
+ 'allowed_values': {
+{{#allParams}}
+{{#isEnum}}
+ ('{{paramName}}',): {
+{{#isNullable}}
+ 'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}}
+ "{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
+ },
+{{/isEnum}}
+{{/allParams}}
+ },
+ 'openapi_types': {
+{{#allParams}}
+ '{{paramName}}':
+ ({{{dataType}}},),
+{{/allParams}}
+ },
+ 'attribute_map': {
+{{#allParams}}
+{{^isBodyParam}}
+ '{{paramName}}': '{{baseName}}',
+{{/isBodyParam}}
+{{/allParams}}
+ },
+ 'location_map': {
+{{#allParams}}
+ '{{paramName}}': '{{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isCookieParam}}cookie{{/isCookieParam}}{{#isBodyParam}}body{{/isBodyParam}}',
+{{/allParams}}
+ },
+ 'collection_format_map': {
+{{#allParams}}
+{{#collectionFormat}}
+ '{{paramName}}': '{{collectionFormat}}',
+{{/collectionFormat}}
+{{/allParams}}
+ }
+ },
+ headers_map={
+{{#hasProduces}}
+ 'accept': [
+{{#produces}}
+ '{{{mediaType}}}'{{^-last}},{{/-last}}
+{{/produces}}
+ ],
+{{/hasProduces}}
+{{^hasProduces}}
+ 'accept': [],
+{{/hasProduces}}
+{{#hasConsumes}}
+ 'content_type': [
+{{#consumes}}
+ '{{{mediaType}}}'{{^-last}},{{/-last}}
+{{/consumes}}
+ ]
+{{/hasConsumes}}
+{{^hasConsumes}}
+ 'content_type': [],
+{{/hasConsumes}}
+ },
+ api_client=api_client,
+ callable=__{{operationId}}
+ )
{{/operation}}
{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache
index 4f230dff623c..fd3d0b8a200a 100644
--- a/modules/openapi-generator/src/main/resources/python/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache
@@ -1,28 +1,37 @@
# coding: utf-8
{{>partial_header}}
-from __future__ import absolute_import
-import atexit
-import datetime
-from dateutil.parser import parse
import json
+import atexit
import mimetypes
from multiprocessing.pool import ThreadPool
+import io
import os
import re
-import tempfile
+import typing
+from urllib.parse import quote
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import quote
{{#tornado}}
import tornado.gen
{{/tornado}}
-from {{packageName}}.configuration import Configuration
-import {{modelPackage}}
from {{packageName}} import rest
-from {{packageName}}.exceptions import ApiValueError, ApiException
+from {{packageName}}.configuration import Configuration
+from {{packageName}}.exceptions import ApiTypeError, ApiValueError, ApiException
+from {{packageName}}.model_utils import (
+ ModelNormal,
+ ModelSimple,
+ ModelComposed,
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ deserialize_file,
+ file_type,
+ model_to_dict,
+ none_type,
+ validate_and_convert_types
+)
class ApiClient(object):
@@ -47,23 +56,12 @@ class ApiClient(object):
to the API. More threads means more concurrent API requests.
"""
- PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
- NATIVE_TYPES_MAPPING = {
- 'int': int,
- 'long': int if six.PY3 else long, # noqa: F821
- 'float': float,
- 'str': str,
- 'bool': bool,
- 'date': datetime.date,
- 'datetime': datetime.datetime,
- 'object': object,
- }
_pool = None
def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None, pool_threads=1):
if configuration is None:
- configuration = Configuration.get_default_copy()
+ configuration = Configuration()
self.configuration = configuration
self.pool_threads = pool_threads
@@ -74,27 +72,14 @@ class ApiClient(object):
self.cookie = cookie
# Set default User-Agent.
self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}'
- self.client_side_validation = configuration.client_side_validation
- {{#asyncio}}
- async def __aenter__(self):
- return self
-
- async def __aexit__(self, exc_type, exc_value, traceback):
- await self.close()
- {{/asyncio}}
- {{^asyncio}}
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()
- {{/asyncio}}
- {{#asyncio}}async {{/asyncio}}def close(self):
- {{#asyncio}}
- await self.rest_client.close()
- {{/asyncio}}
+ def close(self):
if self._pool:
self._pool.close()
self._pool.join()
@@ -128,12 +113,24 @@ class ApiClient(object):
@tornado.gen.coroutine
{{/tornado}}
{{#asyncio}}async {{/asyncio}}def __call_api(
- self, resource_path, method, path_params=None,
- query_params=None, header_params=None, body=None, post_params=None,
- files=None, response_types_map=None, auth_settings=None,
- _return_http_data_only=None, collection_formats=None,
- _preload_content=True, _request_timeout=None, _host=None,
- _request_auth=None):
+ self,
+ resource_path: str,
+ method: str,
+ path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ body: typing.Optional[typing.Any] = None,
+ post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
+ response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
+ auth_settings: typing.Optional[typing.List[str]] = None,
+ _return_http_data_only: typing.Optional[bool] = None,
+ collection_formats: typing.Optional[typing.Dict[str, str]] = None,
+ _preload_content: bool = True,
+ _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
+ _host: typing.Optional[str] = None,
+ _check_type: typing.Optional[bool] = None
+ ):
config = self.configuration
@@ -173,15 +170,14 @@ class ApiClient(object):
collection_formats)
post_params.extend(self.files_parameters(files))
- # auth setting
- self.update_params_for_auth(
- header_params, query_params, auth_settings,
- request_auth=_request_auth)
-
# body
if body:
body = self.sanitize_for_serialization(body)
+ # auth setting
+ self.update_params_for_auth(header_params, query_params,
+ auth_settings, resource_path, method, body)
+
# request url
if _host is None:
url = self.configuration.host + resource_path
@@ -197,35 +193,38 @@ class ApiClient(object):
_preload_content=_preload_content,
_request_timeout=_request_timeout)
except ApiException as e:
- e.body = e.body.decode('utf-8') if six.PY3 else e.body
+ e.body = e.body.decode('utf-8')
raise e
+ content_type = response_data.getheader('content-type')
+
self.last_response = response_data
return_data = response_data
if not _preload_content:
{{^tornado}}
- return return_data
+ return (return_data)
{{/tornado}}
{{#tornado}}
raise tornado.gen.Return(return_data)
{{/tornado}}
-
- response_type = response_types_map.get(response_data.status, None)
+ return return_data
- if six.PY3 and response_type not in ["file", "bytes"]:
+ if response_type not in ["file", "bytes"]:
match = None
- content_type = response_data.getheader('content-type')
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
encoding = match.group(1) if match else "utf-8"
response_data.data = response_data.data.decode(encoding)
# deserialize response data
-
if response_type:
- return_data = self.deserialize(response_data, response_type)
+ return_data = self.deserialize(
+ response_data,
+ response_type,
+ _check_type
+ )
else:
return_data = None
@@ -244,9 +243,9 @@ class ApiClient(object):
response_data.getheaders()))
{{/tornado}}
- def sanitize_for_serialization(self, obj):
+ @classmethod
+ def sanitize_for_serialization(cls, obj):
"""Builds a JSON POST object.
-
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
@@ -254,106 +253,90 @@ class ApiClient(object):
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is OpenAPI model, return the properties dict.
-
:param obj: The data to serialize.
:return: The serialized form of data.
"""
- if obj is None:
- return None
- elif isinstance(obj, self.PRIMITIVE_TYPES):
+ if isinstance(obj, (ModelNormal, ModelComposed)):
+ return {
+ key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()
+ }
+ elif isinstance(obj, (str, int, float, none_type, bool)):
return obj
- elif isinstance(obj, list):
- return [self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj]
- elif isinstance(obj, tuple):
- return tuple(self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj)
- elif isinstance(obj, (datetime.datetime, datetime.date)):
+ elif isinstance(obj, (datetime, date)):
return obj.isoformat()
-
+ elif isinstance(obj, ModelSimple):
+ return cls.sanitize_for_serialization(obj.value)
+ elif isinstance(obj, (list, tuple)):
+ return [cls.sanitize_for_serialization(item) for item in obj]
if isinstance(obj, dict):
- obj_dict = obj
- else:
- # Convert model obj to dict except
- # attributes `openapi_types`, `attribute_map`
- # and attributes which value is not None.
- # Convert attribute name to json key in
- # model definition for request.
- obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
- for attr, _ in six.iteritems(obj.openapi_types)
- if getattr(obj, attr) is not None}
-
- return {key: self.sanitize_for_serialization(val)
- for key, val in six.iteritems(obj_dict)}
-
- def deserialize(self, response, response_type):
+ return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
+ raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))
+
+ def deserialize(self, response, response_type, _check_type):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
- :param response_type: class literal for
- deserialized object, or string of class name.
+ :param response_type: For the response, a tuple containing:
+ valid classes
+ a list containing valid classes (for list schemas)
+ a dict containing a tuple of valid classes as the value
+ Example values:
+ (str,)
+ (Pet,)
+ (float, none_type)
+ ([int, none_type],)
+ ({str: (bool, str, int, float, date, datetime, str, none_type)},)
+ :param _check_type: boolean, whether to check the types of the data
+ received from the server
+ :type _check_type: bool
:return: deserialized object.
"""
# handle file downloading
# save response body into a tmp file and return the instance
- if response_type == "file":
- return self.__deserialize_file(response)
+ if response_type == (file_type,):
+ content_disposition = response.getheader("Content-Disposition")
+ return deserialize_file(response.data, self.configuration,
+ content_disposition=content_disposition)
# fetch data from response object
try:
- data = json.loads(response.data)
+ received_data = json.loads(response.data)
except ValueError:
- data = response.data
-
- return self.__deserialize(data, response_type)
-
- def __deserialize(self, data, klass):
- """Deserializes dict, list, str into an object.
-
- :param data: dict, list or str.
- :param klass: class literal, or string of class name.
-
- :return: object.
- """
- if data is None:
- return None
-
- if type(klass) == str:
- if klass.startswith('list['):
- sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
- return [self.__deserialize(sub_data, sub_kls)
- for sub_data in data]
-
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
- return {k: self.__deserialize(v, sub_kls)
- for k, v in six.iteritems(data)}
-
- # convert str to class
- if klass in self.NATIVE_TYPES_MAPPING:
- klass = self.NATIVE_TYPES_MAPPING[klass]
- else:
- klass = getattr({{modelPackage}}, klass)
-
- if klass in self.PRIMITIVE_TYPES:
- return self.__deserialize_primitive(data, klass)
- elif klass == object:
- return self.__deserialize_object(data)
- elif klass == datetime.date:
- return self.__deserialize_date(data)
- elif klass == datetime.datetime:
- return self.__deserialize_datetime(data)
- else:
- return self.__deserialize_model(data, klass)
-
- def call_api(self, resource_path, method,
- path_params=None, query_params=None, header_params=None,
- body=None, post_params=None, files=None,
- response_types_map=None, auth_settings=None,
- async_req=None, _return_http_data_only=None,
- collection_formats=None,_preload_content=True,
- _request_timeout=None, _host=None, _request_auth=None):
+ received_data = response.data
+
+ # store our data under the key of 'received_data' so users have some
+ # context if they are deserializing a string and the data type is wrong
+ deserialized_data = validate_and_convert_types(
+ received_data,
+ response_type,
+ ['received_data'],
+ True,
+ _check_type,
+ configuration=self.configuration
+ )
+ return deserialized_data
+
+ def call_api(
+ self,
+ resource_path: str,
+ method: str,
+ path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ body: typing.Optional[typing.Any] = None,
+ post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
+ response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
+ auth_settings: typing.Optional[typing.List[str]] = None,
+ async_req: typing.Optional[bool] = None,
+ _return_http_data_only: typing.Optional[bool] = None,
+ collection_formats: typing.Optional[typing.Dict[str, str]] = None,
+ _preload_content: bool = True,
+ _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
+ _host: typing.Optional[str] = None,
+ _check_type: typing.Optional[bool] = None
+ ):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async_req request, set the async_req parameter.
@@ -368,25 +351,38 @@ class ApiClient(object):
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
- :param response: Response data type.
- :param files dict: key -> filename, value -> filepath,
- for `multipart/form-data`.
+ :param response_type: For the response, a tuple containing:
+ valid classes
+ a list containing valid classes (for list schemas)
+ a dict containing a tuple of valid classes as the value
+ Example values:
+ (str,)
+ (Pet,)
+ (float, none_type)
+ ([int, none_type],)
+ ({str: (bool, str, int, float, date, datetime, str, none_type)},)
+ :param files: key -> field name, value -> a list of open file
+ objects for `multipart/form-data`.
+ :type files: dict
:param async_req bool: execute request asynchronously
+ :type async_req: bool, optional
:param _return_http_data_only: response data without head status code
and headers
+ :type _return_http_data_only: bool, optional
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
+ :type collection_formats: dict, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
+ :type _preload_content: bool, optional
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_token: dict, optional
+ :param _check_type: boolean describing if the data back from the server
+ should have its type checked.
+ :type _check_type: bool, optional
:return:
If async_req parameter is True,
the request will be called asynchronously.
@@ -398,23 +394,23 @@ class ApiClient(object):
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
- response_types_map, auth_settings,
+ response_type, auth_settings,
_return_http_data_only, collection_formats,
_preload_content, _request_timeout, _host,
- _request_auth)
+ _check_type)
return self.pool.apply_async(self.__call_api, (resource_path,
method, path_params,
query_params,
header_params, body,
post_params, files,
- response_types_map,
+ response_type,
auth_settings,
_return_http_data_only,
collection_formats,
_preload_content,
_request_timeout,
- _host, _request_auth))
+ _host, _check_type))
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True,
@@ -436,8 +432,10 @@ class ApiClient(object):
return self.rest_client.OPTIONS(url,
query_params=query_params,
headers=headers,
+ post_params=post_params,
_preload_content=_preload_content,
- _request_timeout=_request_timeout)
+ _request_timeout=_request_timeout,
+ body=body)
elif method == "POST":
return self.rest_client.POST(url,
query_params=query_params,
@@ -485,7 +483,7 @@ class ApiClient(object):
new_params = []
if collection_formats is None:
collection_formats = {}
- for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
@@ -505,27 +503,37 @@ class ApiClient(object):
new_params.append((k, v))
return new_params
- def files_parameters(self, files=None):
+ def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
"""Builds form parameters.
- :param files: File parameters.
- :return: Form parameters with files.
+ :param files: None or a dict with key=param_name and
+ value is a list of open file objects
+ :return: List of tuples of form parameters with file data
"""
- params = []
+ if files is None:
+ return []
- if files:
- for k, v in six.iteritems(files):
- if not v:
+ params = []
+ for param_name, file_instances in files.items():
+ if file_instances is None:
+ # if the file field is nullable, skip None values
+ continue
+ for file_instance in file_instances:
+ if file_instance is None:
+ # if the file field is nullable, skip None values
continue
- file_names = v if type(v) is list else [v]
- for n in file_names:
- with open(n, 'rb') as f:
- filename = os.path.basename(f.name)
- filedata = f.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([k, tuple([filename, filedata, mimetype])]))
+ if file_instance.closed is True:
+ raise ApiValueError(
+ "Cannot read a closed file. The passed in file_type "
+ "for %s must be open." % param_name
+ )
+ filename = os.path.basename(file_instance.name)
+ filedata = file_instance.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([param_name, tuple([filename, filedata, mimetype])]))
+ file_instance.close()
return params
@@ -562,156 +570,270 @@ class ApiClient(object):
return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings,
- request_auth=None):
+ resource_path, method, body):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
- :param request_auth: if set, the provided settings will
- override the token in the configuration.
+ :param resource_path: A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method.
+ :param body: A object representing the body of the HTTP request.
+ The object type is the return value of _encoder.default().
"""
if not auth_settings:
return
- if request_auth:
- self._apply_auth_params(headers, querys, request_auth)
- return
-
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
- self._apply_auth_params(headers, querys, auth_setting)
-
- def _apply_auth_params(self, headers, querys, auth_setting):
- """Updates the request parameters based on a single auth_setting
-
- :param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
- :param auth_setting: auth settings for the endpoint
- """
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- headers[auth_setting['key']] = auth_setting['value']
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
-
- def __deserialize_file(self, response):
- """Deserializes body to file
-
- Saves response body into a file in a temporary folder,
- using the filename from the `Content-Disposition` header if provided.
-
- :param response: RESTResponse.
- :return: file path.
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+{{#hasHttpSignatureMethods}}
+ else:
+ # The HTTP signature scheme requires multiple HTTP headers
+ # that are calculated dynamically.
+ signing_info = self.configuration.signing_info
+ auth_headers = signing_info.get_http_signature_headers(
+ resource_path, method, headers, body, querys)
+ headers.update(auth_headers)
+{{/hasHttpSignatureMethods}}
+ elif auth_setting['in'] == 'query':
+ querys.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+
+class Endpoint(object):
+ def __init__(self, settings=None, params_map=None, root_map=None,
+ headers_map=None, api_client=None, callable=None):
+ """Creates an endpoint
+
+ Args:
+ settings (dict): see below key value pairs
+ 'response_type' (tuple/None): response type
+ 'auth' (list): a list of auth type keys
+ 'endpoint_path' (str): the endpoint path
+ 'operation_id' (str): endpoint string identifier
+ 'http_method' (str): POST/PUT/PATCH/GET etc
+ 'servers' (list): list of str servers that this endpoint is at
+ params_map (dict): see below key value pairs
+ 'all' (list): list of str endpoint parameter names
+ 'required' (list): list of required parameter names
+ 'nullable' (list): list of nullable parameter names
+ 'enum' (list): list of parameters with enum values
+ 'validation' (list): list of parameters with validations
+ root_map
+ 'validations' (dict): the dict mapping endpoint parameter tuple
+ paths to their validation dictionaries
+ 'allowed_values' (dict): the dict mapping endpoint parameter
+ tuple paths to their allowed_values (enum) dictionaries
+ 'openapi_types' (dict): param_name to openapi type
+ 'attribute_map' (dict): param_name to camelCase name
+ 'location_map' (dict): param_name to 'body', 'file', 'form',
+ 'header', 'path', 'query'
+ collection_format_map (dict): param_name to `csv` etc.
+ headers_map (dict): see below key value pairs
+ 'accept' (list): list of Accept header strings
+ 'content_type' (list): list of Content-Type header strings
+ api_client (ApiClient) api client instance
+ callable (function): the function which is invoked when the
+ Endpoint is called
"""
- fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
- os.close(fd)
- os.remove(path)
-
- content_disposition = response.getheader("Content-Disposition")
- if content_disposition:
- filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
- content_disposition).group(1)
- path = os.path.join(os.path.dirname(path), filename)
-
- with open(path, "wb") as f:
- f.write(response.data)
-
- return path
+ self.settings = settings
+ self.params_map = params_map
+ self.params_map['all'].extend([
+ 'async_req',
+ '_host_index',
+ '_preload_content',
+ '_request_timeout',
+ '_return_http_data_only',
+ '_check_input_type',
+ '_check_return_type'
+ ])
+ self.params_map['nullable'].extend(['_request_timeout'])
+ self.validations = root_map['validations']
+ self.allowed_values = root_map['allowed_values']
+ self.openapi_types = root_map['openapi_types']
+ extra_types = {
+ 'async_req': (bool,),
+ '_host_index': (none_type, int),
+ '_preload_content': (bool,),
+ '_request_timeout': (none_type, int, (int,), [int]),
+ '_return_http_data_only': (bool,),
+ '_check_input_type': (bool,),
+ '_check_return_type': (bool,)
+ }
+ self.openapi_types.update(extra_types)
+ self.attribute_map = root_map['attribute_map']
+ self.location_map = root_map['location_map']
+ self.collection_format_map = root_map['collection_format_map']
+ self.headers_map = headers_map
+ self.api_client = api_client
+ self.callable = callable
+
+ def __validate_inputs(self, kwargs):
+ for param in self.params_map['enum']:
+ if param in kwargs:
+ check_allowed_values(
+ self.allowed_values,
+ (param,),
+ kwargs[param]
+ )
- def __deserialize_primitive(self, data, klass):
- """Deserializes string to primitive type.
+ for param in self.params_map['validation']:
+ if param in kwargs:
+ check_validations(
+ self.validations,
+ (param,),
+ kwargs[param],
+ configuration=self.api_client.configuration
+ )
- :param data: str.
- :param klass: class literal.
+ if kwargs['_check_input_type'] is False:
+ return
- :return: int, long, float, str, bool.
- """
- try:
- return klass(data)
- except UnicodeEncodeError:
- return six.text_type(data)
- except TypeError:
- return data
+ for key, value in kwargs.items():
+ fixed_val = validate_and_convert_types(
+ value,
+ self.openapi_types[key],
+ [key],
+ False,
+ kwargs['_check_input_type'],
+ configuration=self.api_client.configuration
+ )
+ kwargs[key] = fixed_val
+
+ def __gather_params(self, kwargs):
+ params = {
+ 'body': None,
+ 'collection_format': {},
+ 'file': {},
+ 'form': [],
+ 'header': {},
+ 'path': {},
+ 'query': []
+ }
+
+ for param_name, param_value in kwargs.items():
+ param_location = self.location_map.get(param_name)
+ if param_location is None:
+ continue
+ if param_location:
+ if param_location == 'body':
+ params['body'] = param_value
+ continue
+ base_name = self.attribute_map[param_name]
+ if (param_location == 'form' and
+ self.openapi_types[param_name] == (file_type,)):
+ params['file'][param_name] = [param_value]
+ elif (param_location == 'form' and
+ self.openapi_types[param_name] == ([file_type],)):
+ # param_value is already a list
+ params['file'][param_name] = param_value
+ elif param_location in {'form', 'query'}:
+ param_value_full = (base_name, param_value)
+ params[param_location].append(param_value_full)
+ if param_location not in {'form', 'query'}:
+ params[param_location][base_name] = param_value
+ collection_format = self.collection_format_map.get(param_name)
+ if collection_format:
+ params['collection_format'][base_name] = collection_format
- def __deserialize_object(self, value):
- """Return an original value.
+ return params
- :return: object.
+ def __call__(self, *args, **kwargs):
+ """ This method is invoked when endpoints are called
+ Example:
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
+ api_instance = {{classname}}()
+ api_instance.{{operationId}} # this is an instance of the class Endpoint
+ api_instance.{{operationId}}() # this invokes api_instance.{{operationId}}.__call__()
+ which then invokes the callable functions stored in that endpoint at
+ api_instance.{{operationId}}.callable or self.callable in this class
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
"""
- return value
+ return self.callable(self, *args, **kwargs)
- def __deserialize_date(self, string):
- """Deserializes string to date.
+ def call_with_http_info(self, **kwargs):
- :param string: str.
- :return: date.
- """
try:
- return parse(string).date()
- except ImportError:
- return string
- except ValueError:
- raise rest.ApiException(
- status=0,
- reason="Failed to parse `{0}` as date object".format(string)
+ index = self.api_client.configuration.server_operation_index.get(
+ self.settings['operation_id'], self.api_client.configuration.server_index
+ ) if kwargs['_host_index'] is None else kwargs['_host_index']
+ server_variables = self.api_client.configuration.server_operation_variables.get(
+ self.settings['operation_id'], self.api_client.configuration.server_variables
)
-
- def __deserialize_datetime(self, string):
- """Deserializes string to datetime.
-
- The string should be in iso8601 datetime format.
-
- :param string: str.
- :return: datetime.
- """
- try:
- return parse(string)
- except ImportError:
- return string
- except ValueError:
- raise rest.ApiException(
- status=0,
- reason=(
- "Failed to parse `{0}` as datetime object"
- .format(string)
- )
+ _host = self.api_client.configuration.get_host_from_settings(
+ index, variables=server_variables, servers=self.settings['servers']
)
+ except IndexError:
+ if self.settings['servers']:
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s" %
+ len(self.settings['servers'])
+ )
+ _host = None
+
+ for key, value in kwargs.items():
+ if key not in self.params_map['all']:
+ raise ApiTypeError(
+ "Got an unexpected parameter '%s'"
+ " to method `%s`" %
+ (key, self.settings['operation_id'])
+ )
+ # only throw this nullable ApiValueError if _check_input_type
+ # is False, if _check_input_type==True we catch this case
+ # in self.__validate_inputs
+ if (key not in self.params_map['nullable'] and value is None
+ and kwargs['_check_input_type'] is False):
+ raise ApiValueError(
+ "Value may not be None for non-nullable parameter `%s`"
+ " when calling `%s`" %
+ (key, self.settings['operation_id'])
+ )
- def __deserialize_model(self, data, klass):
- """Deserializes list or dict to model.
+ for key in self.params_map['required']:
+ if key not in kwargs.keys():
+ raise ApiValueError(
+ "Missing the required parameter `%s` when calling "
+ "`%s`" % (key, self.settings['operation_id'])
+ )
- :param data: dict, list.
- :param klass: class literal.
- :return: model object.
- """
- has_discriminator = False
- if (hasattr(klass, 'get_real_child_model')
- and klass.discriminator_value_class_map):
- has_discriminator = True
-
- if not klass.openapi_types and has_discriminator is False:
- return data
-
- kwargs = {}
- if (data is not None and
- klass.openapi_types is not None and
- isinstance(data, (list, dict))):
- for attr, attr_type in six.iteritems(klass.openapi_types):
- if klass.attribute_map[attr] in data:
- value = data[klass.attribute_map[attr]]
- kwargs[attr] = self.__deserialize(value, attr_type)
-
- instance = klass(**kwargs)
-
- if has_discriminator:
- klass_name = instance.get_real_child_model(data)
- if klass_name:
- instance = self.__deserialize(data, klass_name)
- return instance
+ self.__validate_inputs(kwargs)
+
+ params = self.__gather_params(kwargs)
+
+ accept_headers_list = self.headers_map['accept']
+ if accept_headers_list:
+ params['header']['Accept'] = self.api_client.select_header_accept(
+ accept_headers_list)
+
+ content_type_headers_list = self.headers_map['content_type']
+ if content_type_headers_list:
+ header_list = self.api_client.select_header_content_type(
+ content_type_headers_list)
+ params['header']['Content-Type'] = header_list
+
+ return self.api_client.call_api(
+ self.settings['endpoint_path'], self.settings['http_method'],
+ params['path'],
+ params['query'],
+ params['header'],
+ body=params['body'],
+ post_params=params['form'],
+ files=params['file'],
+ response_type=self.settings['response_type'],
+ auth_settings=self.settings['auth'],
+ async_req=kwargs['async_req'],
+ _check_type=kwargs['_check_return_type'],
+ _return_http_data_only=kwargs['_return_http_data_only'],
+ _preload_content=kwargs['_preload_content'],
+ _request_timeout=kwargs['_request_timeout'],
+ _host=_host,
+ collection_formats=params['collection_format'])
diff --git a/modules/openapi-generator/src/main/resources/python/api_doc.mustache b/modules/openapi-generator/src/main/resources/python/api_doc.mustache
index dddec917196f..36eac3ca9191 100644
--- a/modules/openapi-generator/src/main/resources/python/api_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api_doc.mustache
@@ -11,7 +11,7 @@ Method | HTTP request | Description
{{#operations}}
{{#operation}}
# **{{{operationId}}}**
-> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
+> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
{{{summary}}}{{#notes}}
@@ -35,18 +35,17 @@ Method | HTTP request | Description
{{#isOAuth}}
* OAuth Authentication ({{name}}):
{{/isOAuth }}
-{{> api_doc_example }}
{{/authMethods}}
{{/hasAuthMethods}}
-{{^hasAuthMethods}}
{{> api_doc_example }}
-{{/hasAuthMethods}}
### Parameters
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
-{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
-{{/allParams}}
+{{#requiredParams}}{{^defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} |
+{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | defaults to {{{.}}}
+{{/defaultValue}}{{/requiredParams}}{{#optionalParams}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
+{{/optionalParams}}
### Return type
diff --git a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache
index 526c5950a012..bf989ae43006 100644
--- a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache
@@ -1,8 +1,10 @@
```python
-from __future__ import print_function
import time
import {{{packageName}}}
-from {{{packageName}}}.rest import ApiException
+from {{apiPackage}} import {{classVarName}}
+{{#imports}}
+{{{.}}}
+{{/imports}}
from pprint import pprint
{{> python_doc_auth_partial}}
# Enter a context with an instance of the API client
@@ -13,14 +15,62 @@ with {{{packageName}}}.ApiClient(configuration) as api_client:
with {{{packageName}}}.ApiClient() as api_client:
{{/hasAuthMethods}}
# Create an instance of the API class
- api_instance = {{{packageName}}}.{{{classname}}}(api_client)
- {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
- {{/allParams}}
+ api_instance = {{classVarName}}.{{{classname}}}(api_client)
+{{#requiredParams}}
+{{^defaultValue}}
+ {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}
+{{/defaultValue}}
+{{/requiredParams}}
+{{#optionalParams}}
+ {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}
+{{/optionalParams}}
+{{#requiredParams}}
+{{#-last}}
+ # example passing only required values which don't have defaults set
try:
- {{#summary}} # {{{.}}}
- {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}
- pprint(api_response){{/returnType}}
- except ApiException as e:
+{{#summary}}
+ # {{{.}}}
+{{/summary}}
+ {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
+{{#returnType}}
+ pprint(api_response)
+{{/returnType}}
+ except {{{packageName}}}.ApiException as e:
print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+{{/-last}}
+{{/requiredParams}}
+{{#optionalParams}}
+{{#-last}}
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+{{#summary}}
+ # {{{.}}}
+{{/summary}}
+ {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{^-last}}, {{/-last}}{{/optionalParams}})
+{{#returnType}}
+ pprint(api_response)
+{{/returnType}}
+ except {{{packageName}}}.ApiException as e:
+ print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+{{/-last}}
+{{/optionalParams}}
+{{^requiredParams}}
+{{^optionalParams}}
+
+ # example, this endpoint has no required or optional parameters
+ try:
+{{#summary}}
+ # {{{.}}}
+{{/summary}}
+ {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}()
+{{#returnType}}
+ pprint(api_response)
+{{/returnType}}
+ except {{{packageName}}}.ApiException as e:
+ print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+{{/optionalParams}}
+{{/requiredParams}}
```
diff --git a/modules/openapi-generator/src/main/resources/python/api_test.mustache b/modules/openapi-generator/src/main/resources/python/api_test.mustache
index 90fafc15f337..f9276b443ce6 100644
--- a/modules/openapi-generator/src/main/resources/python/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api_test.mustache
@@ -2,20 +2,17 @@
{{>partial_header}}
-from __future__ import absolute_import
-
import unittest
import {{packageName}}
from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501
-from {{packageName}}.rest import ApiException
class {{#operations}}Test{{classname}}(unittest.TestCase):
"""{{classname}} unit test stubs"""
def setUp(self):
- self.api = {{apiPackage}}.{{classVarName}}.{{classname}}() # noqa: E501
+ self.api = {{classname}}() # noqa: E501
def tearDown(self):
pass
diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache
index 9f2542f5a915..ca6fc37747fd 100644
--- a/modules/openapi-generator/src/main/resources/python/configuration.mustache
+++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache
@@ -2,8 +2,6 @@
{{>partial_header}}
-from __future__ import absolute_import
-
import copy
import logging
{{^asyncio}}
@@ -12,8 +10,7 @@ import multiprocessing
import sys
import urllib3
-import six
-from six.moves import http_client as httplib
+from http import client as http_client
from {{packageName}}.exceptions import ApiValueError
@@ -302,9 +299,8 @@ conf = {{{packageName}}}.Configuration(
# Enable client side validation
self.client_side_validation = True
+ # Options to pass down to the underlying urllib3 socket
self.socket_options = None
- """Options to pass down to the underlying urllib3 socket
- """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -389,7 +385,7 @@ conf = {{{packageName}}}.Configuration(
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
@@ -411,17 +407,17 @@ conf = {{{packageName}}}.Configuration(
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
- # turn on httplib debug
- httplib.HTTPConnection.debuglevel = 1
+ # turn on http_client debug
+ http_client.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
- # turn off httplib debug
- httplib.HTTPConnection.debuglevel = 0
+ # turn off http_client debug
+ http_client.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
diff --git a/modules/openapi-generator/src/main/resources/python/exceptions.mustache b/modules/openapi-generator/src/main/resources/python/exceptions.mustache
index 6c7726953306..8d445c6e248e 100644
--- a/modules/openapi-generator/src/main/resources/python/exceptions.mustache
+++ b/modules/openapi-generator/src/main/resources/python/exceptions.mustache
@@ -2,8 +2,6 @@
{{>partial_header}}
-import six
-
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -120,35 +118,11 @@ class ApiException(OpenApiException):
return error_message
-class NotFoundException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(NotFoundException, self).__init__(status, reason, http_resp)
-
-
-class UnauthorizedException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(UnauthorizedException, self).__init__(status, reason, http_resp)
-
-
-class ForbiddenException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(ForbiddenException, self).__init__(status, reason, http_resp)
-
-
-class ServiceException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(ServiceException, self).__init__(status, reason, http_resp)
-
-
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, six.integer_types):
+ if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache
index 2cabff63c786..60c4b3789335 100644
--- a/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache
+++ b/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache
@@ -3,7 +3,7 @@
stages:
- test
-.nosetest:
+.tests:
stage: test
script:
- pip install -r requirements.txt
@@ -15,24 +15,15 @@ stages:
- pytest --cov={{{packageName}}}
{{/useNose}}
-nosetest-2.7:
- extends: .nosetest
- image: python:2.7-alpine
-nosetest-3.3:
- extends: .nosetest
- image: python:3.3-alpine
-nosetest-3.4:
- extends: .nosetest
- image: python:3.4-alpine
-nosetest-3.5:
- extends: .nosetest
+test-3.5:
+ extends: .tests
image: python:3.5-alpine
-nosetest-3.6:
- extends: .nosetest
+test-3.6:
+ extends: .tests
image: python:3.6-alpine
-nosetest-3.7:
- extends: .nosetest
+test-3.7:
+ extends: .tests
image: python:3.7-alpine
-nosetest-3.8:
- extends: .nosetest
+test-3.8:
+ extends: .tests
image: python:3.8-alpine
diff --git a/modules/openapi-generator/src/main/resources/python/model.mustache b/modules/openapi-generator/src/main/resources/python/model.mustache
index 857a3e48fb4d..f2cb2368ca03 100644
--- a/modules/openapi-generator/src/main/resources/python/model.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model.mustache
@@ -1,254 +1,59 @@
# coding: utf-8
-{{>partial_header}}
+{{> partial_header }}
-import inspect
-import pprint
import re # noqa: F401
-import six
-
-from {{packageName}}.configuration import Configuration
-
-
+import sys # noqa: F401
+
+import nulltype # noqa: F401
+
+from {{packageName}}.model_utils import ( # noqa: F401
+ ApiTypeError,
+ ModelComposed,
+ ModelNormal,
+ ModelSimple,
+ cached_property,
+ change_keys_js_to_python,
+ convert_js_args_to_python_args,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_get_composed_info,
+)
{{#models}}
{{#model}}
-class {{classname}}(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """{{#allowableValues}}
-
- """
- allowed enum values
- """
-{{#enumVars}}
- {{name}} = {{{value}}}{{^-last}}
-{{/-last}}
-{{/enumVars}}{{/allowableValues}}
-
-{{#allowableValues}}
- allowable_values = [{{#enumVars}}{{name}}{{^-last}}, {{/-last}}{{/enumVars}}] # noqa: E501
-
-{{/allowableValues}}
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
-{{#vars}}
- '{{name}}': '{{{dataType}}}'{{^-last}},{{/-last}}
-{{/vars}}
- }
+{{#imports}}
+{{#-first}}
- attribute_map = {
-{{#vars}}
- '{{name}}': '{{baseName}}'{{^-last}},{{/-last}}
-{{/vars}}
- }
-{{#discriminator}}
-
- discriminator_value_class_map = {
-{{#children}}
- '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}}
-{{/children}}
- }
-{{/discriminator}}
-
- def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501
- """{{classname}} - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-{{#vars}}{{#-first}}
+def lazy_import():
{{/-first}}
- self._{{name}} = None
-{{/vars}}
- self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}}
-{{#vars}}{{#-first}}
-{{/-first}}
-{{#required}}
- self.{{name}} = {{name}}
-{{/required}}
-{{^required}}
-{{#isNullable}}
- self.{{name}} = {{name}}
-{{/isNullable}}
-{{^isNullable}}
- if {{name}} is not None:
- self.{{name}} = {{name}}
-{{/isNullable}}
-{{/required}}
-{{/vars}}
-
-{{#vars}}
- @property
- def {{name}}(self):
- """Gets the {{name}} of this {{classname}}. # noqa: E501
+ {{{.}}}
+{{/imports}}
-{{#description}}
- {{{description}}} # noqa: E501
-{{/description}}
- :return: The {{name}} of this {{classname}}. # noqa: E501
- :rtype: {{dataType}}
- """
- return self._{{name}}
-
- @{{name}}.setter
- def {{name}}(self, {{name}}):
- """Sets the {{name}} of this {{classname}}.
-
-{{#description}}
- {{{description}}} # noqa: E501
-{{/description}}
-
- :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501
- :type {{name}}: {{dataType}}
- """
-{{^isNullable}}
-{{#required}}
- if self.local_vars_configuration.client_side_validation and {{name}} is None: # noqa: E501
- raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501
-{{/required}}
-{{/isNullable}}
-{{#isEnum}}
-{{#isContainer}}
- allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
+{{^interfaces}}
{{#isArray}}
- if (self.local_vars_configuration.client_side_validation and
- not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501
- raise ValueError(
- "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
- .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
- ", ".join(map(str, allowed_values)))
- )
+{{> model_templates/model_simple }}
{{/isArray}}
-{{#isMap}}
- if (self.local_vars_configuration.client_side_validation and
- not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501
- raise ValueError(
- "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
- .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
- ", ".join(map(str, allowed_values)))
- )
-{{/isMap}}
-{{/isContainer}}
-{{^isContainer}}
- allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
- if self.local_vars_configuration.client_side_validation and {{{name}}} not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501
- .format({{{name}}}, allowed_values)
- )
-{{/isContainer}}
+{{#isEnum}}
+{{> model_templates/model_simple }}
{{/isEnum}}
+{{#isAlias}}
+{{> model_templates/model_simple }}
+{{/isAlias}}
+{{^isArray}}
{{^isEnum}}
-{{#hasValidation}}
-{{#maxLength}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and len({{name}}) > {{maxLength}}):
- raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
-{{/maxLength}}
-{{#minLength}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and len({{name}}) < {{minLength}}):
- raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
-{{/minLength}}
-{{#maximum}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501
- raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
-{{/maximum}}
-{{#minimum}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501
- raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
-{{/minimum}}
-{{#pattern}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501
- raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501
-{{/pattern}}
-{{#maxItems}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and len({{name}}) > {{maxItems}}):
- raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
-{{/maxItems}}
-{{#minItems}}
- if (self.local_vars_configuration.client_side_validation and
- {{name}} is not None and len({{name}}) < {{minItems}}):
- raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
-{{/minItems}}
-{{/hasValidation}}
+{{^isAlias}}
+{{> model_templates/model_normal }}
+{{/isAlias}}
{{/isEnum}}
-
- self._{{name}} = {{name}}
-
-{{/vars}}
-{{#discriminator}}
- def get_real_child_model(self, data):
- """Returns the real base class specified by the discriminator"""
- discriminator_key = self.attribute_map[self.discriminator]
- discriminator_value = data[discriminator_key]
- return self.discriminator_value_class_map.get(discriminator_value)
-
-{{/discriminator}}
- def to_dict(self, serialize=False):
- """Returns the model properties as a dict"""
- result = {}
-
- def convert(x):
- if hasattr(x, "to_dict"):
- args = inspect.getargspec(x.to_dict).args
- if len(args) == 1:
- return x.to_dict()
- else:
- return x.to_dict(serialize)
- else:
- return x
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- attr = self.attribute_map.get(attr, attr) if serialize else attr
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: convert(x),
- value
- ))
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], convert(item[1])),
- value.items()
- ))
- else:
- result[attr] = convert(value)
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, {{classname}}):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, {{classname}}):
- return True
-
- return self.to_dict() != other.to_dict()
+{{/isArray}}
+{{/interfaces}}
+{{#interfaces}}
+{{#-last}}
+{{> model_templates/model_composed }}
+{{/-last}}
+{{/interfaces}}
{{/model}}
{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python/model_doc.mustache b/modules/openapi-generator/src/main/resources/python/model_doc.mustache
index fc90a2e0fc51..7971d6c85f66 100644
--- a/modules/openapi-generator/src/main/resources/python/model_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_doc.mustache
@@ -5,8 +5,31 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
-{{/vars}}
+{{#isEnum}}
+**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}{{#allowableValues}}{{#defaultValue}}, {{/defaultValue}} must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}}
+{{/isEnum}}
+{{#isAlias}}
+**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}
+{{/isAlias}}
+{{#isArray}}
+**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}}{{#arrayModelType}}[**{{dataType}}**]({{arrayModelType}}.md){{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}
+{{/isArray}}
+{{#requiredVars}}
+{{^defaultValue}}
+**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{#isReadOnly}}[readonly] {{/isReadOnly}}
+{{/defaultValue}}
+{{/requiredVars}}
+{{#requiredVars}}
+{{#defaultValue}}
+**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}defaults to {{{.}}}{{/defaultValue}}
+{{/defaultValue}}
+{{/requiredVars}}
+{{#optionalVars}}
+**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
+{{/optionalVars}}
+{{#additionalPropertiesType}}
+**any string name** | **{{additionalPropertiesType}}** | any string name can be used but the value must be the correct type | [optional]
+{{/additionalPropertiesType}}
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache
similarity index 94%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache
index f2ea42679a66..88ae5df9f121 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache
@@ -44,18 +44,18 @@
validations = {
{{#hasValidation}}
('value',): {
-{{> python-experimental/model_templates/validations }}
+{{> model_templates/validations }}
{{/hasValidation}}
{{#requiredVars}}
{{#hasValidation}}
('{{name}}',): {
-{{> python-experimental/model_templates/validations }}
+{{> model_templates/validations }}
{{/hasValidation}}
{{/requiredVars}}
{{#optionalVars}}
{{#hasValidation}}
('{{name}}',): {
-{{> python-experimental/model_templates/validations }}
+{{> model_templates/validations }}
{{/hasValidation}}
{{/optionalVars}}
}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_allowed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/docstring_allowed.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_allowed.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/docstring_allowed.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_init_required_kwargs.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/docstring_init_required_kwargs.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_init_required_kwargs.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/docstring_init_required_kwargs.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_openapi_validations.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/docstring_openapi_validations.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_openapi_validations.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/docstring_openapi_validations.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache
similarity index 96%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache
index 7e64549acd5f..8b3650b33a2c 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache
@@ -10,7 +10,7 @@
'_additional_properties_model_instances',
])
-{{> python-experimental/model_templates/method_init_shared }}
+{{> model_templates/method_init_shared }}
constant_args = {
'_check_type': _check_type,
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_normal.mustache
similarity index 92%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/method_init_normal.mustache
index 4fee1c8449ca..e670b4ffb4c3 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_normal.mustache
@@ -7,7 +7,7 @@
'_visited_composed_classes',
])
-{{> python-experimental/model_templates/method_init_shared }}
+{{> model_templates/method_init_shared }}
{{#isEnum}}
self.value = value
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_shared.mustache
similarity index 96%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/method_init_shared.mustache
index e500b11e70f3..f3497ef53be6 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_shared.mustache
@@ -19,7 +19,7 @@
{{name}} ({{{dataType}}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
{{/defaultValue}}
{{/requiredVars}}
-{{> python-experimental/model_templates/docstring_init_required_kwargs }}
+{{> model_templates/docstring_init_required_kwargs }}
{{#optionalVars}}
{{name}} ({{{dataType}}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501
{{/optionalVars}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_simple.mustache
similarity index 97%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/method_init_simple.mustache
index b71b80667c06..2340cf74ef26 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_simple.mustache
@@ -18,7 +18,7 @@
Keyword Args:
value ({{{dataType}}}):{{#description}} {{description}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{defaultValue}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
-{{> python-experimental/model_templates/docstring_init_required_kwargs }}
+{{> model_templates/docstring_init_required_kwargs }}
"""
if 'value' in kwargs:
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_set_attribute.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_set_attribute.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_setattr_getattr_composed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_setattr_getattr_composed.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_setattr_getattr_normal.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_normal.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_setattr_getattr_normal.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_normal.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_shared.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_shared.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_todict_tostr_eq_shared.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/methods_todict_tostr_eq_shared.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_tostr_eq_simple.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/methods_tostr_eq_simple.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/model_composed.mustache
similarity index 85%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/model_composed.mustache
index dd61b23c793c..76fe3a8f5074 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/model_composed.mustache
@@ -5,15 +5,15 @@ class {{classname}}(ModelComposed):
Do not edit the class manually.
Attributes:
-{{> python-experimental/model_templates/docstring_allowed }}
+{{> model_templates/docstring_allowed }}
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
-{{> python-experimental/model_templates/docstring_openapi_validations }}
+{{> model_templates/docstring_openapi_validations }}
"""
-{{> python-experimental/model_templates/classvars }}
+{{> model_templates/classvars }}
attribute_map = {
{{#requiredVars}}
@@ -24,7 +24,7 @@ class {{classname}}(ModelComposed):
{{/optionalVars}}
}
-{{> python-experimental/model_templates/method_init_composed }}
+{{> model_templates/method_init_composed }}
@cached_property
def _composed_schemas():
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/model_normal.mustache
similarity index 73%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/model_normal.mustache
index af130c66a749..9aada8f5a08b 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/model_normal.mustache
@@ -5,15 +5,15 @@ class {{classname}}(ModelNormal):
Do not edit the class manually.
Attributes:
-{{> python-experimental/model_templates/docstring_allowed }}
+{{> model_templates/docstring_allowed }}
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
-{{> python-experimental/model_templates/docstring_openapi_validations }}
+{{> model_templates/docstring_openapi_validations }}
"""
-{{> python-experimental/model_templates/classvars }}
+{{> model_templates/classvars }}
attribute_map = {
{{#requiredVars}}
@@ -26,4 +26,4 @@ class {{classname}}(ModelNormal):
_composed_schemas = {}
-{{> python-experimental/model_templates/method_init_normal}}
\ No newline at end of file
+{{> model_templates/method_init_normal}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/model_simple.mustache
similarity index 50%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/model_simple.mustache
index 0b7d1860ddfd..a4055af756be 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/model_simple.mustache
@@ -5,14 +5,14 @@ class {{classname}}(ModelSimple):
Do not edit the class manually.
Attributes:
-{{> python-experimental/model_templates/docstring_allowed }}
-{{> python-experimental/model_templates/docstring_openapi_validations }}
+{{> model_templates/docstring_allowed }}
+{{> model_templates/docstring_openapi_validations }}
"""
-{{> python-experimental/model_templates/classvars }}
+{{> model_templates/classvars }}
attribute_map = {}
_composed_schemas = None
-{{> python-experimental/model_templates/method_init_simple}}
\ No newline at end of file
+{{> model_templates/method_init_simple}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/validations.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/validations.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/validations.mustache
rename to modules/openapi-generator/src/main/resources/python/model_templates/validations.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/model_test.mustache b/modules/openapi-generator/src/main/resources/python/model_test.mustache
index cd55662e10f2..669cc12185f4 100644
--- a/modules/openapi-generator/src/main/resources/python/model_test.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_test.mustache
@@ -2,16 +2,17 @@
{{>partial_header}}
-from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
+import {{packageName}}
{{#models}}
{{#model}}
-import {{packageName}}
-from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501
-from {{packageName}}.rest import ApiException
+{{#imports}}
+{{{.}}}
+{{/imports}}
+from {{modelPackage}}.{{classFilename}} import {{classname}}
+
class Test{{classname}}(unittest.TestCase):
"""{{classname}} unit test stubs"""
@@ -22,31 +23,11 @@ class Test{{classname}}(unittest.TestCase):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test {{classname}}
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501
- if include_optional :
- return {{classname}}(
-{{#vars}}
- {{name}} = {{#example}}{{{.}}}{{/example}}{{^example}}None{{/example}}{{^-last}}, {{/-last}}
-{{/vars}}
- )
- else :
- return {{classname}}(
-{{#vars}}
-{{#required}}
- {{name}} = {{#example}}{{{.}}}{{/example}}{{^example}}None{{/example}},
-{{/required}}
-{{/vars}}
- )
-
def test{{classname}}(self):
"""Test {{classname}}"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = {{classname}}() # noqa: E501
+ pass
{{/model}}
{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/model_utils.mustache
similarity index 99%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache
rename to modules/openapi-generator/src/main/resources/python/model_utils.mustache
index 72a5cbe429a4..1523dbc2d76d 100644
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_utils.mustache
@@ -96,9 +96,9 @@ def composed_model_input_classes(cls):
class OpenApiModel(object):
"""The base class for all OpenAPIModels"""
-{{> python-experimental/model_templates/method_set_attribute }}
+{{> model_templates/method_set_attribute }}
-{{> python-experimental/model_templates/methods_shared }}
+{{> model_templates/methods_shared }}
def __new__(cls, *args, **kwargs):
# this function uses the discriminator to
@@ -218,18 +218,18 @@ class ModelSimple(OpenApiModel):
"""the parent class of models whose type != object in their
swagger/openapi"""
-{{> python-experimental/model_templates/methods_setattr_getattr_normal }}
+{{> model_templates/methods_setattr_getattr_normal }}
-{{> python-experimental/model_templates/methods_tostr_eq_simple }}
+{{> model_templates/methods_tostr_eq_simple }}
class ModelNormal(OpenApiModel):
"""the parent class of models whose type == object in their
swagger/openapi"""
-{{> python-experimental/model_templates/methods_setattr_getattr_normal }}
+{{> model_templates/methods_setattr_getattr_normal }}
-{{> python-experimental/model_templates/methods_todict_tostr_eq_shared}}
+{{> model_templates/methods_todict_tostr_eq_shared}}
class ModelComposed(OpenApiModel):
@@ -258,9 +258,9 @@ class ModelComposed(OpenApiModel):
which contain the value that the key is referring to.
"""
-{{> python-experimental/model_templates/methods_setattr_getattr_composed }}
+{{> model_templates/methods_setattr_getattr_composed }}
-{{> python-experimental/model_templates/methods_todict_tostr_eq_shared}}
+{{> model_templates/methods_todict_tostr_eq_shared}}
COERCION_INDEX_BY_TYPE = {
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache
deleted file mode 100644
index 8a9e6b91b952..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache
+++ /dev/null
@@ -1,9 +0,0 @@
-{{#apiInfo}}
-{{#apis}}
-{{#-first}}
-# do not import all apis into this module because that uses a lot of memory and stack frames
-# if you need the ability to import all apis from one package, import them with
-# from {{packageName}}.apis import {{classname}}
-{{/-first}}
-{{/apis}}
-{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache
deleted file mode 100644
index cfe32b784926..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache
+++ /dev/null
@@ -1,5 +0,0 @@
-# we can not import model classes here because that would create a circular
-# reference which would not work in python2
-# do not import all models into this module because that uses a lot of memory and stack frames
-# if you need the ability to import all models from one package, import them with
-# from {{packageName}.models import ModelA, ModelB
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache
deleted file mode 100644
index 0e76b3f29fb2..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache
+++ /dev/null
@@ -1,308 +0,0 @@
-# coding: utf-8
-
-{{>partial_header}}
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from {{packageName}}.api_client import ApiClient, Endpoint
-from {{packageName}}.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-{{#imports}}
-{{{import}}}
-{{/imports}}
-
-
-{{#operations}}
-class {{classname}}(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-{{#operation}}
-
- def __{{operationId}}(
- self,
-{{#requiredParams}}
-{{^defaultValue}}
- {{paramName}},
-{{/defaultValue}}
-{{/requiredParams}}
-{{#requiredParams}}
-{{#defaultValue}}
- {{paramName}}={{{defaultValue}}},
-{{/defaultValue}}
-{{/requiredParams}}
- **kwargs
- ):
- """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
-
-{{#notes}}
- {{{notes}}} # noqa: E501
-{{/notes}}
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True)
- >>> result = thread.get()
-
-{{#requiredParams}}
-{{#-last}}
- Args:
-{{/-last}}
-{{/requiredParams}}
-{{#requiredParams}}
-{{^defaultValue}}
- {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}}
-{{/defaultValue}}
-{{/requiredParams}}
-{{#requiredParams}}
-{{#defaultValue}}
- {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]
-{{/defaultValue}}
-{{/requiredParams}}
-
- Keyword Args:{{#optionalParams}}
- {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}}
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
-{{#requiredParams}}
- kwargs['{{paramName}}'] = \
- {{paramName}}
-{{/requiredParams}}
- return self.call_with_http_info(**kwargs)
-
- self.{{operationId}} = Endpoint(
- settings={
- 'response_type': {{#returnType}}({{{returnType}}},){{/returnType}}{{^returnType}}None{{/returnType}},
-{{#authMethods}}
-{{#-first}}
- 'auth': [
-{{/-first}}
- '{{name}}'{{^-last}},{{/-last}}
-{{#-last}}
- ],
-{{/-last}}
-{{/authMethods}}
-{{^authMethods}}
- 'auth': [],
-{{/authMethods}}
- 'endpoint_path': '{{{path}}}',
- 'operation_id': '{{operationId}}',
- 'http_method': '{{httpMethod}}',
-{{#servers}}
-{{#-first}}
- 'servers': [
-{{/-first}}
- {
- 'url': "{{{url}}}",
- 'description': "{{{description}}}{{^description}}No description provided{{/description}}",
- {{#variables}}
- {{#-first}}
- 'variables': {
- {{/-first}}
- '{{{name}}}': {
- 'description': "{{{description}}}{{^description}}No description provided{{/description}}",
- 'default_value': "{{{defaultValue}}}",
- {{#enumValues}}
- {{#-first}}
- 'enum_values': [
- {{/-first}}
- "{{{.}}}"{{^-last}},{{/-last}}
- {{#-last}}
- ]
- {{/-last}}
- {{/enumValues}}
- }{{^-last}},{{/-last}}
- {{#-last}}
- }
- {{/-last}}
- {{/variables}}
- },
-{{#-last}}
- ]
-{{/-last}}
-{{/servers}}
-{{^servers}}
- 'servers': None,
-{{/servers}}
- },
- params_map={
- 'all': [
-{{#allParams}}
- '{{paramName}}',
-{{/allParams}}
- ],
-{{#requiredParams}}
-{{#-first}}
- 'required': [
-{{/-first}}
- '{{paramName}}',
-{{#-last}}
- ],
-{{/-last}}
-{{/requiredParams}}
-{{^requiredParams}}
- 'required': [],
-{{/requiredParams}}
- 'nullable': [
-{{#allParams}}
-{{#isNullable}}
- '{{paramName}}',
-{{/isNullable}}
-{{/allParams}}
- ],
- 'enum': [
-{{#allParams}}
-{{#isEnum}}
- '{{paramName}}',
-{{/isEnum}}
-{{/allParams}}
- ],
- 'validation': [
-{{#allParams}}
-{{#hasValidation}}
- '{{paramName}}',
-{{/hasValidation}}
-{{/allParams}}
- ]
- },
- root_map={
- 'validations': {
-{{#allParams}}
-{{#hasValidation}}
- ('{{paramName}}',): {
-{{#maxLength}}
- 'max_length': {{maxLength}},{{/maxLength}}{{#minLength}}
- 'min_length': {{minLength}},{{/minLength}}{{#maxItems}}
- 'max_items': {{maxItems}},{{/maxItems}}{{#minItems}}
- 'min_items': {{minItems}},{{/minItems}}{{#maximum}}
- {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}}
- {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}}
- 'regex': {
- 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}}
- {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}}
- },{{/pattern}}
- },
-{{/hasValidation}}
-{{/allParams}}
- },
- 'allowed_values': {
-{{#allParams}}
-{{#isEnum}}
- ('{{paramName}}',): {
-{{#isNullable}}
- 'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}}
- "{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
- },
-{{/isEnum}}
-{{/allParams}}
- },
- 'openapi_types': {
-{{#allParams}}
- '{{paramName}}':
- ({{{dataType}}},),
-{{/allParams}}
- },
- 'attribute_map': {
-{{#allParams}}
-{{^isBodyParam}}
- '{{paramName}}': '{{baseName}}',
-{{/isBodyParam}}
-{{/allParams}}
- },
- 'location_map': {
-{{#allParams}}
- '{{paramName}}': '{{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isCookieParam}}cookie{{/isCookieParam}}{{#isBodyParam}}body{{/isBodyParam}}',
-{{/allParams}}
- },
- 'collection_format_map': {
-{{#allParams}}
-{{#collectionFormat}}
- '{{paramName}}': '{{collectionFormat}}',
-{{/collectionFormat}}
-{{/allParams}}
- }
- },
- headers_map={
-{{#hasProduces}}
- 'accept': [
-{{#produces}}
- '{{{mediaType}}}'{{^-last}},{{/-last}}
-{{/produces}}
- ],
-{{/hasProduces}}
-{{^hasProduces}}
- 'accept': [],
-{{/hasProduces}}
-{{#hasConsumes}}
- 'content_type': [
-{{#consumes}}
- '{{{mediaType}}}'{{^-last}},{{/-last}}
-{{/consumes}}
- ]
-{{/hasConsumes}}
-{{^hasConsumes}}
- 'content_type': [],
-{{/hasConsumes}}
- },
- api_client=api_client,
- callable=__{{operationId}}
- )
-{{/operation}}
-{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache
deleted file mode 100644
index fd3d0b8a200a..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache
+++ /dev/null
@@ -1,839 +0,0 @@
-# coding: utf-8
-{{>partial_header}}
-
-import json
-import atexit
-import mimetypes
-from multiprocessing.pool import ThreadPool
-import io
-import os
-import re
-import typing
-from urllib.parse import quote
-
-{{#tornado}}
-import tornado.gen
-{{/tornado}}
-
-from {{packageName}} import rest
-from {{packageName}}.configuration import Configuration
-from {{packageName}}.exceptions import ApiTypeError, ApiValueError, ApiException
-from {{packageName}}.model_utils import (
- ModelNormal,
- ModelSimple,
- ModelComposed,
- check_allowed_values,
- check_validations,
- date,
- datetime,
- deserialize_file,
- file_type,
- model_to_dict,
- none_type,
- validate_and_convert_types
-)
-
-
-class ApiClient(object):
- """Generic API client for OpenAPI client library builds.
-
- OpenAPI generic API client. This client handles the client-
- server communication, and is invariant across implementations. Specifics of
- the methods and models for each application are generated from the OpenAPI
- templates.
-
- NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
-
- :param configuration: .Configuration object for this client
- :param header_name: a header to pass when making calls to the API.
- :param header_value: a header value to pass when making calls to
- the API.
- :param cookie: a cookie to include in the header when making calls
- to the API
- :param pool_threads: The number of threads to use for async requests
- to the API. More threads means more concurrent API requests.
- """
-
- _pool = None
-
- def __init__(self, configuration=None, header_name=None, header_value=None,
- cookie=None, pool_threads=1):
- if configuration is None:
- configuration = Configuration()
- self.configuration = configuration
- self.pool_threads = pool_threads
-
- self.rest_client = rest.RESTClientObject(configuration)
- self.default_headers = {}
- if header_name is not None:
- self.default_headers[header_name] = header_value
- self.cookie = cookie
- # Set default User-Agent.
- self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}'
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, traceback):
- self.close()
-
- def close(self):
- if self._pool:
- self._pool.close()
- self._pool.join()
- self._pool = None
- if hasattr(atexit, 'unregister'):
- atexit.unregister(self.close)
-
- @property
- def pool(self):
- """Create thread pool on first request
- avoids instantiating unused threadpool for blocking clients.
- """
- if self._pool is None:
- atexit.register(self.close)
- self._pool = ThreadPool(self.pool_threads)
- return self._pool
-
- @property
- def user_agent(self):
- """User agent for this API client"""
- return self.default_headers['User-Agent']
-
- @user_agent.setter
- def user_agent(self, value):
- self.default_headers['User-Agent'] = value
-
- def set_default_header(self, header_name, header_value):
- self.default_headers[header_name] = header_value
-
- {{#tornado}}
- @tornado.gen.coroutine
- {{/tornado}}
- {{#asyncio}}async {{/asyncio}}def __call_api(
- self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None
- ):
-
- config = self.configuration
-
- # header parameters
- header_params = header_params or {}
- header_params.update(self.default_headers)
- if self.cookie:
- header_params['Cookie'] = self.cookie
- if header_params:
- header_params = self.sanitize_for_serialization(header_params)
- header_params = dict(self.parameters_to_tuples(header_params,
- collection_formats))
-
- # path parameters
- if path_params:
- path_params = self.sanitize_for_serialization(path_params)
- path_params = self.parameters_to_tuples(path_params,
- collection_formats)
- for k, v in path_params:
- # specified safe chars, encode everything
- resource_path = resource_path.replace(
- '{%s}' % k,
- quote(str(v), safe=config.safe_chars_for_path_param)
- )
-
- # query parameters
- if query_params:
- query_params = self.sanitize_for_serialization(query_params)
- query_params = self.parameters_to_tuples(query_params,
- collection_formats)
-
- # post parameters
- if post_params or files:
- post_params = post_params if post_params else []
- post_params = self.sanitize_for_serialization(post_params)
- post_params = self.parameters_to_tuples(post_params,
- collection_formats)
- post_params.extend(self.files_parameters(files))
-
- # body
- if body:
- body = self.sanitize_for_serialization(body)
-
- # auth setting
- self.update_params_for_auth(header_params, query_params,
- auth_settings, resource_path, method, body)
-
- # request url
- if _host is None:
- url = self.configuration.host + resource_path
- else:
- # use server/host defined in path or operation instead
- url = _host + resource_path
-
- try:
- # perform request and return response
- response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request(
- method, url, query_params=query_params, headers=header_params,
- post_params=post_params, body=body,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout)
- except ApiException as e:
- e.body = e.body.decode('utf-8')
- raise e
-
- content_type = response_data.getheader('content-type')
-
- self.last_response = response_data
-
- return_data = response_data
-
- if not _preload_content:
- {{^tornado}}
- return (return_data)
- {{/tornado}}
- {{#tornado}}
- raise tornado.gen.Return(return_data)
- {{/tornado}}
- return return_data
-
- if response_type not in ["file", "bytes"]:
- match = None
- if content_type is not None:
- match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
- encoding = match.group(1) if match else "utf-8"
- response_data.data = response_data.data.decode(encoding)
-
- # deserialize response data
- if response_type:
- return_data = self.deserialize(
- response_data,
- response_type,
- _check_type
- )
- else:
- return_data = None
-
-{{^tornado}}
- if _return_http_data_only:
- return (return_data)
- else:
- return (return_data, response_data.status,
- response_data.getheaders())
-{{/tornado}}
-{{#tornado}}
- if _return_http_data_only:
- raise tornado.gen.Return(return_data)
- else:
- raise tornado.gen.Return((return_data, response_data.status,
- response_data.getheaders()))
-{{/tornado}}
-
- @classmethod
- def sanitize_for_serialization(cls, obj):
- """Builds a JSON POST object.
- If obj is None, return None.
- If obj is str, int, long, float, bool, return directly.
- If obj is datetime.datetime, datetime.date
- convert to string in iso8601 format.
- If obj is list, sanitize each element in the list.
- If obj is dict, return the dict.
- If obj is OpenAPI model, return the properties dict.
- :param obj: The data to serialize.
- :return: The serialized form of data.
- """
- if isinstance(obj, (ModelNormal, ModelComposed)):
- return {
- key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()
- }
- elif isinstance(obj, (str, int, float, none_type, bool)):
- return obj
- elif isinstance(obj, (datetime, date)):
- return obj.isoformat()
- elif isinstance(obj, ModelSimple):
- return cls.sanitize_for_serialization(obj.value)
- elif isinstance(obj, (list, tuple)):
- return [cls.sanitize_for_serialization(item) for item in obj]
- if isinstance(obj, dict):
- return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
- raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))
-
- def deserialize(self, response, response_type, _check_type):
- """Deserializes response into an object.
-
- :param response: RESTResponse object to be deserialized.
- :param response_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param _check_type: boolean, whether to check the types of the data
- received from the server
- :type _check_type: bool
-
- :return: deserialized object.
- """
- # handle file downloading
- # save response body into a tmp file and return the instance
- if response_type == (file_type,):
- content_disposition = response.getheader("Content-Disposition")
- return deserialize_file(response.data, self.configuration,
- content_disposition=content_disposition)
-
- # fetch data from response object
- try:
- received_data = json.loads(response.data)
- except ValueError:
- received_data = response.data
-
- # store our data under the key of 'received_data' so users have some
- # context if they are deserializing a string and the data type is wrong
- deserialized_data = validate_and_convert_types(
- received_data,
- response_type,
- ['received_data'],
- True,
- _check_type,
- configuration=self.configuration
- )
- return deserialized_data
-
- def call_api(
- self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- async_req: typing.Optional[bool] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None
- ):
- """Makes the HTTP request (synchronous) and returns deserialized data.
-
- To make an async_req request, set the async_req parameter.
-
- :param resource_path: Path to method endpoint.
- :param method: Method to call.
- :param path_params: Path parameters in the url.
- :param query_params: Query parameters in the url.
- :param header_params: Header parameters to be
- placed in the request header.
- :param body: Request body.
- :param post_params dict: Request post form parameters,
- for `application/x-www-form-urlencoded`, `multipart/form-data`.
- :param auth_settings list: Auth Settings names for the request.
- :param response_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param files: key -> field name, value -> a list of open file
- objects for `multipart/form-data`.
- :type files: dict
- :param async_req bool: execute request asynchronously
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param collection_formats: dict of collection formats for path, query,
- header, and post parameters.
- :type collection_formats: dict, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _check_type: boolean describing if the data back from the server
- should have its type checked.
- :type _check_type: bool, optional
- :return:
- If async_req parameter is True,
- the request will be called asynchronously.
- The method will return the request thread.
- If parameter async_req is False or missing,
- then the method will return the response directly.
- """
- if not async_req:
- return self.__call_api(resource_path, method,
- path_params, query_params, header_params,
- body, post_params, files,
- response_type, auth_settings,
- _return_http_data_only, collection_formats,
- _preload_content, _request_timeout, _host,
- _check_type)
-
- return self.pool.apply_async(self.__call_api, (resource_path,
- method, path_params,
- query_params,
- header_params, body,
- post_params, files,
- response_type,
- auth_settings,
- _return_http_data_only,
- collection_formats,
- _preload_content,
- _request_timeout,
- _host, _check_type))
-
- def request(self, method, url, query_params=None, headers=None,
- post_params=None, body=None, _preload_content=True,
- _request_timeout=None):
- """Makes the HTTP request using RESTClient."""
- if method == "GET":
- return self.rest_client.GET(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "HEAD":
- return self.rest_client.HEAD(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "OPTIONS":
- return self.rest_client.OPTIONS(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "POST":
- return self.rest_client.POST(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PUT":
- return self.rest_client.PUT(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PATCH":
- return self.rest_client.PATCH(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "DELETE":
- return self.rest_client.DELETE(url,
- query_params=query_params,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- else:
- raise ApiValueError(
- "http method must be `GET`, `HEAD`, `OPTIONS`,"
- " `POST`, `PATCH`, `PUT` or `DELETE`."
- )
-
- def parameters_to_tuples(self, params, collection_formats):
- """Get parameters as list of tuples, formatting collections.
-
- :param params: Parameters as dict or list of two-tuples
- :param dict collection_formats: Parameter collection formats
- :return: Parameters as list of tuples, collections formatted
- """
- new_params = []
- if collection_formats is None:
- collection_formats = {}
- for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
- if k in collection_formats:
- collection_format = collection_formats[k]
- if collection_format == 'multi':
- new_params.extend((k, value) for value in v)
- else:
- if collection_format == 'ssv':
- delimiter = ' '
- elif collection_format == 'tsv':
- delimiter = '\t'
- elif collection_format == 'pipes':
- delimiter = '|'
- else: # csv is the default
- delimiter = ','
- new_params.append(
- (k, delimiter.join(str(value) for value in v)))
- else:
- new_params.append((k, v))
- return new_params
-
- def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
- """Builds form parameters.
-
- :param files: None or a dict with key=param_name and
- value is a list of open file objects
- :return: List of tuples of form parameters with file data
- """
- if files is None:
- return []
-
- params = []
- for param_name, file_instances in files.items():
- if file_instances is None:
- # if the file field is nullable, skip None values
- continue
- for file_instance in file_instances:
- if file_instance is None:
- # if the file field is nullable, skip None values
- continue
- if file_instance.closed is True:
- raise ApiValueError(
- "Cannot read a closed file. The passed in file_type "
- "for %s must be open." % param_name
- )
- filename = os.path.basename(file_instance.name)
- filedata = file_instance.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([param_name, tuple([filename, filedata, mimetype])]))
- file_instance.close()
-
- return params
-
- def select_header_accept(self, accepts):
- """Returns `Accept` based on an array of accepts provided.
-
- :param accepts: List of headers.
- :return: Accept (e.g. application/json).
- """
- if not accepts:
- return
-
- accepts = [x.lower() for x in accepts]
-
- if 'application/json' in accepts:
- return 'application/json'
- else:
- return ', '.join(accepts)
-
- def select_header_content_type(self, content_types):
- """Returns `Content-Type` based on an array of content_types provided.
-
- :param content_types: List of content-types.
- :return: Content-Type (e.g. application/json).
- """
- if not content_types:
- return 'application/json'
-
- content_types = [x.lower() for x in content_types]
-
- if 'application/json' in content_types or '*/*' in content_types:
- return 'application/json'
- else:
- return content_types[0]
-
- def update_params_for_auth(self, headers, querys, auth_settings,
- resource_path, method, body):
- """Updates header and query params based on authentication setting.
-
- :param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
- :param auth_settings: Authentication setting identifiers list.
- :param resource_path: A string representation of the HTTP request resource path.
- :param method: A string representation of the HTTP request method.
- :param body: A object representing the body of the HTTP request.
- The object type is the return value of _encoder.default().
- """
- if not auth_settings:
- return
-
- for auth in auth_settings:
- auth_setting = self.configuration.auth_settings().get(auth)
- if auth_setting:
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- if auth_setting['type'] != 'http-signature':
- headers[auth_setting['key']] = auth_setting['value']
-{{#hasHttpSignatureMethods}}
- else:
- # The HTTP signature scheme requires multiple HTTP headers
- # that are calculated dynamically.
- signing_info = self.configuration.signing_info
- auth_headers = signing_info.get_http_signature_headers(
- resource_path, method, headers, body, querys)
- headers.update(auth_headers)
-{{/hasHttpSignatureMethods}}
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
-
-
-class Endpoint(object):
- def __init__(self, settings=None, params_map=None, root_map=None,
- headers_map=None, api_client=None, callable=None):
- """Creates an endpoint
-
- Args:
- settings (dict): see below key value pairs
- 'response_type' (tuple/None): response type
- 'auth' (list): a list of auth type keys
- 'endpoint_path' (str): the endpoint path
- 'operation_id' (str): endpoint string identifier
- 'http_method' (str): POST/PUT/PATCH/GET etc
- 'servers' (list): list of str servers that this endpoint is at
- params_map (dict): see below key value pairs
- 'all' (list): list of str endpoint parameter names
- 'required' (list): list of required parameter names
- 'nullable' (list): list of nullable parameter names
- 'enum' (list): list of parameters with enum values
- 'validation' (list): list of parameters with validations
- root_map
- 'validations' (dict): the dict mapping endpoint parameter tuple
- paths to their validation dictionaries
- 'allowed_values' (dict): the dict mapping endpoint parameter
- tuple paths to their allowed_values (enum) dictionaries
- 'openapi_types' (dict): param_name to openapi type
- 'attribute_map' (dict): param_name to camelCase name
- 'location_map' (dict): param_name to 'body', 'file', 'form',
- 'header', 'path', 'query'
- collection_format_map (dict): param_name to `csv` etc.
- headers_map (dict): see below key value pairs
- 'accept' (list): list of Accept header strings
- 'content_type' (list): list of Content-Type header strings
- api_client (ApiClient) api client instance
- callable (function): the function which is invoked when the
- Endpoint is called
- """
- self.settings = settings
- self.params_map = params_map
- self.params_map['all'].extend([
- 'async_req',
- '_host_index',
- '_preload_content',
- '_request_timeout',
- '_return_http_data_only',
- '_check_input_type',
- '_check_return_type'
- ])
- self.params_map['nullable'].extend(['_request_timeout'])
- self.validations = root_map['validations']
- self.allowed_values = root_map['allowed_values']
- self.openapi_types = root_map['openapi_types']
- extra_types = {
- 'async_req': (bool,),
- '_host_index': (none_type, int),
- '_preload_content': (bool,),
- '_request_timeout': (none_type, int, (int,), [int]),
- '_return_http_data_only': (bool,),
- '_check_input_type': (bool,),
- '_check_return_type': (bool,)
- }
- self.openapi_types.update(extra_types)
- self.attribute_map = root_map['attribute_map']
- self.location_map = root_map['location_map']
- self.collection_format_map = root_map['collection_format_map']
- self.headers_map = headers_map
- self.api_client = api_client
- self.callable = callable
-
- def __validate_inputs(self, kwargs):
- for param in self.params_map['enum']:
- if param in kwargs:
- check_allowed_values(
- self.allowed_values,
- (param,),
- kwargs[param]
- )
-
- for param in self.params_map['validation']:
- if param in kwargs:
- check_validations(
- self.validations,
- (param,),
- kwargs[param],
- configuration=self.api_client.configuration
- )
-
- if kwargs['_check_input_type'] is False:
- return
-
- for key, value in kwargs.items():
- fixed_val = validate_and_convert_types(
- value,
- self.openapi_types[key],
- [key],
- False,
- kwargs['_check_input_type'],
- configuration=self.api_client.configuration
- )
- kwargs[key] = fixed_val
-
- def __gather_params(self, kwargs):
- params = {
- 'body': None,
- 'collection_format': {},
- 'file': {},
- 'form': [],
- 'header': {},
- 'path': {},
- 'query': []
- }
-
- for param_name, param_value in kwargs.items():
- param_location = self.location_map.get(param_name)
- if param_location is None:
- continue
- if param_location:
- if param_location == 'body':
- params['body'] = param_value
- continue
- base_name = self.attribute_map[param_name]
- if (param_location == 'form' and
- self.openapi_types[param_name] == (file_type,)):
- params['file'][param_name] = [param_value]
- elif (param_location == 'form' and
- self.openapi_types[param_name] == ([file_type],)):
- # param_value is already a list
- params['file'][param_name] = param_value
- elif param_location in {'form', 'query'}:
- param_value_full = (base_name, param_value)
- params[param_location].append(param_value_full)
- if param_location not in {'form', 'query'}:
- params[param_location][base_name] = param_value
- collection_format = self.collection_format_map.get(param_name)
- if collection_format:
- params['collection_format'][base_name] = collection_format
-
- return params
-
- def __call__(self, *args, **kwargs):
- """ This method is invoked when endpoints are called
- Example:
-{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
- api_instance = {{classname}}()
- api_instance.{{operationId}} # this is an instance of the class Endpoint
- api_instance.{{operationId}}() # this invokes api_instance.{{operationId}}.__call__()
- which then invokes the callable functions stored in that endpoint at
- api_instance.{{operationId}}.callable or self.callable in this class
-{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
- """
- return self.callable(self, *args, **kwargs)
-
- def call_with_http_info(self, **kwargs):
-
- try:
- index = self.api_client.configuration.server_operation_index.get(
- self.settings['operation_id'], self.api_client.configuration.server_index
- ) if kwargs['_host_index'] is None else kwargs['_host_index']
- server_variables = self.api_client.configuration.server_operation_variables.get(
- self.settings['operation_id'], self.api_client.configuration.server_variables
- )
- _host = self.api_client.configuration.get_host_from_settings(
- index, variables=server_variables, servers=self.settings['servers']
- )
- except IndexError:
- if self.settings['servers']:
- raise ApiValueError(
- "Invalid host index. Must be 0 <= index < %s" %
- len(self.settings['servers'])
- )
- _host = None
-
- for key, value in kwargs.items():
- if key not in self.params_map['all']:
- raise ApiTypeError(
- "Got an unexpected parameter '%s'"
- " to method `%s`" %
- (key, self.settings['operation_id'])
- )
- # only throw this nullable ApiValueError if _check_input_type
- # is False, if _check_input_type==True we catch this case
- # in self.__validate_inputs
- if (key not in self.params_map['nullable'] and value is None
- and kwargs['_check_input_type'] is False):
- raise ApiValueError(
- "Value may not be None for non-nullable parameter `%s`"
- " when calling `%s`" %
- (key, self.settings['operation_id'])
- )
-
- for key in self.params_map['required']:
- if key not in kwargs.keys():
- raise ApiValueError(
- "Missing the required parameter `%s` when calling "
- "`%s`" % (key, self.settings['operation_id'])
- )
-
- self.__validate_inputs(kwargs)
-
- params = self.__gather_params(kwargs)
-
- accept_headers_list = self.headers_map['accept']
- if accept_headers_list:
- params['header']['Accept'] = self.api_client.select_header_accept(
- accept_headers_list)
-
- content_type_headers_list = self.headers_map['content_type']
- if content_type_headers_list:
- header_list = self.api_client.select_header_content_type(
- content_type_headers_list)
- params['header']['Content-Type'] = header_list
-
- return self.api_client.call_api(
- self.settings['endpoint_path'], self.settings['http_method'],
- params['path'],
- params['query'],
- params['header'],
- body=params['body'],
- post_params=params['form'],
- files=params['file'],
- response_type=self.settings['response_type'],
- auth_settings=self.settings['auth'],
- async_req=kwargs['async_req'],
- _check_type=kwargs['_check_return_type'],
- _return_http_data_only=kwargs['_return_http_data_only'],
- _preload_content=kwargs['_preload_content'],
- _request_timeout=kwargs['_request_timeout'],
- _host=_host,
- collection_formats=params['collection_format'])
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache
deleted file mode 100644
index bf989ae43006..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache
+++ /dev/null
@@ -1,76 +0,0 @@
-```python
-import time
-import {{{packageName}}}
-from {{apiPackage}} import {{classVarName}}
-{{#imports}}
-{{{.}}}
-{{/imports}}
-from pprint import pprint
-{{> python_doc_auth_partial}}
-# Enter a context with an instance of the API client
-{{#hasAuthMethods}}
-with {{{packageName}}}.ApiClient(configuration) as api_client:
-{{/hasAuthMethods}}
-{{^hasAuthMethods}}
-with {{{packageName}}}.ApiClient() as api_client:
-{{/hasAuthMethods}}
- # Create an instance of the API class
- api_instance = {{classVarName}}.{{{classname}}}(api_client)
-{{#requiredParams}}
-{{^defaultValue}}
- {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}
-{{/defaultValue}}
-{{/requiredParams}}
-{{#optionalParams}}
- {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}
-{{/optionalParams}}
-{{#requiredParams}}
-{{#-last}}
-
- # example passing only required values which don't have defaults set
- try:
-{{#summary}}
- # {{{.}}}
-{{/summary}}
- {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
-{{#returnType}}
- pprint(api_response)
-{{/returnType}}
- except {{{packageName}}}.ApiException as e:
- print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
-{{/-last}}
-{{/requiredParams}}
-{{#optionalParams}}
-{{#-last}}
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
-{{#summary}}
- # {{{.}}}
-{{/summary}}
- {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{^-last}}, {{/-last}}{{/optionalParams}})
-{{#returnType}}
- pprint(api_response)
-{{/returnType}}
- except {{{packageName}}}.ApiException as e:
- print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
-{{/-last}}
-{{/optionalParams}}
-{{^requiredParams}}
-{{^optionalParams}}
-
- # example, this endpoint has no required or optional parameters
- try:
-{{#summary}}
- # {{{.}}}
-{{/summary}}
- {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}()
-{{#returnType}}
- pprint(api_response)
-{{/returnType}}
- except {{{packageName}}}.ApiException as e:
- print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
-{{/optionalParams}}
-{{/requiredParams}}
-```
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache
deleted file mode 100644
index 1fc47d90561d..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache
+++ /dev/null
@@ -1,59 +0,0 @@
-# coding: utf-8
-
-{{>partial_header}}
-
-import re # noqa: F401
-import sys # noqa: F401
-
-import nulltype # noqa: F401
-
-from {{packageName}}.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
-)
-{{#models}}
-{{#model}}
-{{#imports}}
-{{#-first}}
-
-def lazy_import():
-{{/-first}}
- {{{.}}}
-{{/imports}}
-
-
-{{^interfaces}}
-{{#isArray}}
-{{> python-experimental/model_templates/model_simple }}
-{{/isArray}}
-{{#isEnum}}
-{{> python-experimental/model_templates/model_simple }}
-{{/isEnum}}
-{{#isAlias}}
-{{> python-experimental/model_templates/model_simple }}
-{{/isAlias}}
-{{^isArray}}
-{{^isEnum}}
-{{^isAlias}}
-{{> python-experimental/model_templates/model_normal }}
-{{/isAlias}}
-{{/isEnum}}
-{{/isArray}}
-{{/interfaces}}
-{{#interfaces}}
-{{#-last}}
-{{> python-experimental/model_templates/model_composed }}
-{{/-last}}
-{{/interfaces}}
-{{/model}}
-{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache
deleted file mode 100644
index 7971d6c85f66..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache
+++ /dev/null
@@ -1,36 +0,0 @@
-{{#models}}{{#model}}# {{classname}}
-
-{{#description}}{{&description}}
-{{/description}}
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-{{#isEnum}}
-**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}{{#allowableValues}}{{#defaultValue}}, {{/defaultValue}} must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}}
-{{/isEnum}}
-{{#isAlias}}
-**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}
-{{/isAlias}}
-{{#isArray}}
-**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}}{{#arrayModelType}}[**{{dataType}}**]({{arrayModelType}}.md){{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}
-{{/isArray}}
-{{#requiredVars}}
-{{^defaultValue}}
-**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{#isReadOnly}}[readonly] {{/isReadOnly}}
-{{/defaultValue}}
-{{/requiredVars}}
-{{#requiredVars}}
-{{#defaultValue}}
-**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}defaults to {{{.}}}{{/defaultValue}}
-{{/defaultValue}}
-{{/requiredVars}}
-{{#optionalVars}}
-**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
-{{/optionalVars}}
-{{#additionalPropertiesType}}
-**any string name** | **{{additionalPropertiesType}}** | any string name can be used but the value must be the correct type | [optional]
-{{/additionalPropertiesType}}
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache
deleted file mode 100644
index 669cc12185f4..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache
+++ /dev/null
@@ -1,36 +0,0 @@
-# coding: utf-8
-
-{{>partial_header}}
-
-import sys
-import unittest
-
-import {{packageName}}
-{{#models}}
-{{#model}}
-{{#imports}}
-{{{.}}}
-{{/imports}}
-from {{modelPackage}}.{{classFilename}} import {{classname}}
-
-
-class Test{{classname}}(unittest.TestCase):
- """{{classname}} unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def test{{classname}}(self):
- """Test {{classname}}"""
- # FIXME: construct object with mandatory attributes with example values
- # model = {{classname}}() # noqa: E501
- pass
-
-{{/model}}
-{{/models}}
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache
deleted file mode 100644
index cc68f6484f18..000000000000
--- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache
+++ /dev/null
@@ -1,15 +0,0 @@
-{{#useNose}}
-coverage>=4.0.3
-nose>=1.3.7
-pluggy>=0.3.1
-py>=1.4.31
-randomize>=0.13
-{{/useNose}}
-{{^useNose}}
-pytest~=4.6.7 # needed for python 3.4
-pytest-cov>=2.8.1
-pytest-randomly==1.2.3 # needed for python 3.4
-{{/useNose}}
-{{#hasHttpSignatureMethods}}
-pycryptodome>=3.9.0
-{{/hasHttpSignatureMethods}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python/requirements.mustache b/modules/openapi-generator/src/main/resources/python/requirements.mustache
index eb358efd5bd3..2c2f00fcb27b 100644
--- a/modules/openapi-generator/src/main/resources/python/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python/requirements.mustache
@@ -1,6 +1,5 @@
+nulltype
certifi >= 14.05.14
-future; python_version<="2.7"
-six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache
index 391687862441..5fb2da0af28c 100644
--- a/modules/openapi-generator/src/main/resources/python/rest.mustache
+++ b/modules/openapi-generator/src/main/resources/python/rest.mustache
@@ -2,21 +2,17 @@
{{>partial_header}}
-from __future__ import absolute_import
-
import io
import json
import logging
import re
import ssl
+from urllib.parse import urlencode
import certifi
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import urlencode
import urllib3
-from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
+from {{packageName}}.exceptions import ApiException, ApiValueError
logger = logging.getLogger(__name__)
@@ -136,7 +132,7 @@ class RESTClientObject(object):
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
+ if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
@@ -216,18 +212,6 @@ class RESTClientObject(object):
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
- if r.status == 401:
- raise UnauthorizedException(http_resp=r)
-
- if r.status == 403:
- raise ForbiddenException(http_resp=r)
-
- if r.status == 404:
- raise NotFoundException(http_resp=r)
-
- if 500 <= r.status <= 599:
- raise ServiceException(http_resp=r)
-
raise ApiException(http_resp=r)
return r
diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache
index a14de4016fa3..632584a592a7 100644
--- a/modules/openapi-generator/src/main/resources/python/setup.mustache
+++ b/modules/openapi-generator/src/main/resources/python/setup.mustache
@@ -16,13 +16,22 @@ VERSION = "{{packageVersion}}"
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
+REQUIRES = [
+ "urllib3 >= 1.15",
+ "certifi",
+ "python-dateutil",
+ "nulltype",
{{#asyncio}}
-REQUIRES.append("aiohttp >= 3.0.0")
+ "aiohttp >= 3.0.0",
{{/asyncio}}
{{#tornado}}
-REQUIRES.append("tornado>=4.2,<5")
+ "tornado>=4.2,<5",
{{/tornado}}
+{{#hasHttpSignatureMethods}}
+ "pem>=19.3.0",
+ "pycryptodome>=3.9.0",
+{{/hasHttpSignatureMethods}}
+]
setup(
name=NAME,
@@ -32,6 +41,7 @@ setup(
author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}",
url="{{packageUrl}}",
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
+ python_requires=">=3.5",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/signing.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache
rename to modules/openapi-generator/src/main/resources/python/signing.mustache
diff --git a/modules/openapi-generator/src/main/resources/python/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/test-requirements.mustache
index 12021b47a1c2..cc68f6484f18 100644
--- a/modules/openapi-generator/src/main/resources/python/test-requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python/test-requirements.mustache
@@ -6,7 +6,10 @@ py>=1.4.31
randomize>=0.13
{{/useNose}}
{{^useNose}}
-pytest~=4.6.7 # needed for python 2.7+3.4
+pytest~=4.6.7 # needed for python 3.4
pytest-cov>=2.8.1
-pytest-randomly==1.2.3 # needed for python 2.7+3.4
-{{/useNose}}
\ No newline at end of file
+pytest-randomly==1.2.3 # needed for python 3.4
+{{/useNose}}
+{{#hasHttpSignatureMethods}}
+pycryptodome>=3.9.0
+{{/hasHttpSignatureMethods}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python/tox.mustache b/modules/openapi-generator/src/main/resources/python/tox.mustache
index fe989faf9302..4c771c472b8b 100644
--- a/modules/openapi-generator/src/main/resources/python/tox.mustache
+++ b/modules/openapi-generator/src/main/resources/python/tox.mustache
@@ -1,10 +1,5 @@
[tox]
-{{^asyncio}}
-envlist = py27, py3
-{{/asyncio}}
-{{#asyncio}}
envlist = py3
-{{/asyncio}}
[testenv]
deps=-r{toxinidir}/requirements.txt
diff --git a/modules/openapi-generator/src/main/resources/python/travis.mustache b/modules/openapi-generator/src/main/resources/python/travis.mustache
index 195488737d6b..3c255f64e991 100644
--- a/modules/openapi-generator/src/main/resources/python/travis.mustache
+++ b/modules/openapi-generator/src/main/resources/python/travis.mustache
@@ -1,10 +1,6 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- - "2.7"
- - "3.2"
- - "3.3"
- - "3.4"
- "3.5"
- "3.6"
- "3.7"
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
index 1d3ab8c22e95..02e645c5807a 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
@@ -232,7 +232,7 @@ public void testOriginalOpenApiDocumentVersion() {
Assert.assertEquals(version, new SemVer("2.0.0"));
// Test with OAS 3.0 document.
- location = "src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml";
+ location = "src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml";
openAPI = TestUtils.parseFlattenSpec(location);
version = ModelUtils.getOpenApiVersion(openAPI, location, null);
Assert.assertEquals(version, new SemVer("3.0.0"));
@@ -291,7 +291,7 @@ public void testAdditionalPropertiesV2Spec() {
@Test
public void testAdditionalPropertiesV3Spec() {
- OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml");
+ OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml");
DefaultCodegen codegen = new DefaultCodegen();
codegen.setDisallowAdditionalPropertiesIfNotPresent(false);
codegen.setOpenAPI(openAPI);
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java
index 551582d0f031..7beb3ec69c0d 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java
@@ -19,7 +19,7 @@
import com.google.common.collect.ImmutableMap;
import org.openapitools.codegen.CodegenConstants;
-import org.openapitools.codegen.languages.PythonClientCodegen;
+import org.openapitools.codegen.languages.PythonLegacyClientCodegen;
import java.util.Map;
@@ -39,7 +39,7 @@ public String getLanguage() {
@Override
public Map createOptions() {
ImmutableMap.Builder builder = new ImmutableMap.Builder();
- return builder.put(PythonClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE)
+ return builder.put(PythonLegacyClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE)
.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
.put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE)
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
@@ -47,8 +47,8 @@ public Map createOptions() {
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
.put(CodegenConstants.SOURCECODEONLY_GENERATION, "false")
.put(CodegenConstants.LIBRARY, "urllib3")
- .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE)
- .put(PythonClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT)
+ .put(PythonLegacyClientCodegen.USE_NOSE, USE_NOSE_VALUE)
+ .put(PythonLegacyClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT)
.build();
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java
deleted file mode 100644
index 565e6848f64b..000000000000
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
- * Copyright 2018 SmartBear Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openapitools.codegen.python;
-
-import io.swagger.v3.oas.models.OpenAPI;
-import io.swagger.v3.oas.models.Operation;
-import io.swagger.v3.oas.models.media.StringSchema;
-import org.openapitools.codegen.CodegenConstants;
-import org.openapitools.codegen.CodegenOperation;
-import org.openapitools.codegen.TestUtils;
-import org.openapitools.codegen.languages.PythonClientCodegen;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-public class PythonClientCodegenTest {
-
- @Test
- public void testInitialConfigValues() throws Exception {
- final PythonClientCodegen codegen = new PythonClientCodegen();
- codegen.processOpts();
-
- Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE);
- Assert.assertEquals(codegen.isHideGenerationTimestamp(), true);
- }
-
- @Test
- public void testSettersForConfigValues() throws Exception {
- final PythonClientCodegen codegen = new PythonClientCodegen();
- codegen.setHideGenerationTimestamp(false);
- codegen.processOpts();
-
- Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
- Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
- }
-
- @Test
- public void testAdditionalPropertiesPutForConfigValues() throws Exception {
- final PythonClientCodegen codegen = new PythonClientCodegen();
- codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false);
- codegen.processOpts();
-
- Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
- Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
- }
-
- @Test(description = "test enum null/nullable patterns")
- public void testEnumNull() {
- final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1997.yaml");
-
- StringSchema prop = (StringSchema) openAPI.getComponents().getSchemas().get("Type").getProperties().get("prop");
- ArrayList expected = new ArrayList<>(Arrays.asList("A", "B", "C"));
- assert prop.getNullable();
- assert prop.getEnum().equals(expected);
- }
-
- @Test(description = "test regex patterns")
- public void testRegularExpressionOpenAPISchemaVersion3() {
- final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1517.yaml");
- final PythonClientCodegen codegen = new PythonClientCodegen();
- codegen.setOpenAPI(openAPI);
- final String path = "/ping";
- final Operation p = openAPI.getPaths().get(path).getGet();
- final CodegenOperation op = codegen.fromOperation(path, "get", p, null);
- // pattern_no_forward_slashes '^pattern$'
- Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/");
- // pattern_two_slashes '/^pattern$/'
- Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/");
- // pattern_dont_escape_backslash '/^pattern\d{3}$/'
- Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/");
- // pattern_dont_escape_escaped_forward_slash '/^pattern\/\d{3}$/'
- Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern\\/\\d{3}$/");
- // pattern_escape_unescaped_forward_slash '^pattern/\d{3}$'
- Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/");
- // pattern_with_modifiers '/^pattern\d{3}$/i
- Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i");
- }
-
- @Test(description = "test single quotes escape")
- public void testSingleQuotes() {
- final PythonClientCodegen codegen = new PythonClientCodegen();
- StringSchema schema = new StringSchema();
- schema.setDefault("Text containing 'single' quote");
- String defaultValue = codegen.toDefaultValue(schema);
- Assert.assertEquals("'Text containing \'single\' quote'", defaultValue);
- }
-}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java
index e423c6e85842..8bec98892ef6 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java
@@ -19,7 +19,7 @@
import org.openapitools.codegen.AbstractOptionsTest;
import org.openapitools.codegen.CodegenConfig;
-import org.openapitools.codegen.languages.PythonClientCodegen;
+import org.openapitools.codegen.languages.PythonLegacyClientCodegen;
import org.openapitools.codegen.options.PythonClientOptionsProvider;
import org.testng.Assert;
@@ -29,7 +29,7 @@
import static org.mockito.Mockito.verify;
public class PythonClientOptionsTest extends AbstractOptionsTest {
- private PythonClientCodegen clientCodegen = mock(PythonClientCodegen.class, mockSettings);
+ private PythonLegacyClientCodegen clientCodegen = mock(PythonLegacyClientCodegen.class, mockSettings);
public PythonClientOptionsTest() {
super(new PythonClientOptionsProvider());
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java
similarity index 93%
rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java
rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java
index 931d9f189577..683d4aa4b024 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java
@@ -30,18 +30,18 @@
import java.util.List;
import org.openapitools.codegen.*;
-import org.openapitools.codegen.languages.PythonClientExperimentalCodegen;
+import org.openapitools.codegen.languages.PythonClientCodegen;
import org.openapitools.codegen.utils.ModelUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
@SuppressWarnings("static-method")
-public class PythonClientExperimentalTest {
+public class PythonClientTest {
@Test(description = "convert a python model with dots")
public void modelTest() {
final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json");
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
codegen.setOpenAPI(openAPI);
codegen.setOpenAPI(openAPI);
@@ -72,7 +72,7 @@ public void simpleModelTest() {
.addProperties("createdAt", new DateTimeSchema())
.addRequiredItem("id")
.addRequiredItem("name");
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", schema);
@@ -117,7 +117,7 @@ public void listPropertyTest() {
.addProperties("urls", new ArraySchema()
.items(new StringSchema()))
.addRequiredItem("id");
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -155,7 +155,7 @@ public void mapPropertyTest() {
.addProperties("translations", new MapSchema()
.additionalProperties(new StringSchema()))
.addRequiredItem("id");
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -178,7 +178,7 @@ public void mapPropertyTest() {
@Test(description = "convert a model with complex property")
public void complexPropertyTest() {
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPI();
final Schema model = new Schema()
.description("a sample model")
@@ -208,7 +208,7 @@ public void complexPropertyTest() {
@Test(description = "convert a model with complex list property")
public void complexListPropertyTest() {
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPI();
final Schema model = new Schema()
.description("a sample model")
@@ -241,7 +241,7 @@ public void complexListPropertyTest() {
@Test(description = "convert a model with complex map property")
public void complexMapPropertyTest() {
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPI();
final Schema model = new Schema()
.description("a sample model")
@@ -277,7 +277,7 @@ public void complexMapPropertyTest() {
// should not start with 'null'. need help from the community to investigate further
@Test(description = "convert an array model")
public void arrayModelTest() {
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPI();
final Schema model = new ArraySchema()
.items(new Schema().$ref("#/components/schemas/Children"))
@@ -304,7 +304,7 @@ public void arrayModelTest() {
// should not start with 'null'. need help from the community to investigate further
@Test(description = "convert a map model")
public void mapModelTest() {
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPI();
final Schema sample = new Schema()
.description("a map model")
@@ -327,8 +327,8 @@ public void mapModelTest() {
@Test(description = "parse date and date-time example value")
public void parseDateAndDateTimeExamplesTest() {
- final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml");
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml");
+ final DefaultCodegen codegen = new PythonClientCodegen();
Schema modelSchema = ModelUtils.getSchema(openAPI, "DateTimeTest");
String defaultValue = codegen.toDefaultValue(modelSchema);
@@ -337,7 +337,7 @@ public void parseDateAndDateTimeExamplesTest() {
@Test(description = "format imports of models containing special characters")
public void importSpecialModelNameTest() {
- final PythonClientExperimentalCodegen codegen = new PythonClientExperimentalCodegen();
+ final PythonClientCodegen codegen = new PythonClientCodegen();
String importValue = codegen.toModelImport("special.ModelName");
Assert.assertEquals(importValue, "from models.special_model_name import SpecialModelName");
@@ -345,7 +345,7 @@ public void importSpecialModelNameTest() {
@Test(description = "format imports of models containing special characters")
public void defaultSettingInPrimitiveModelWithValidations() {
- final PythonClientExperimentalCodegen codegen = new PythonClientExperimentalCodegen();
+ final PythonClientCodegen codegen = new PythonClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPI();
final Schema noDefault = new ArraySchema()
@@ -382,7 +382,7 @@ public void testObjectModelWithRefedAdditionalPropertiesIsGenerated() throws Exc
File output = Files.createTempDirectory("test").toFile();
final CodegenConfigurator configurator = new CodegenConfigurator()
- .setGeneratorName("python-experimental")
+ .setGeneratorName("python")
.setInputSpec("src/test/resources/3_0/issue_7372.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
@@ -400,7 +400,7 @@ public void testFreeFormSchemas() throws Exception {
File output = Files.createTempDirectory("test").toFile();
final CodegenConfigurator configurator = new CodegenConfigurator()
- .setGeneratorName("python-experimental")
+ .setGeneratorName("python")
.setInputSpec("src/test/resources/3_0/issue_7361.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
@@ -417,7 +417,7 @@ public void testFreeFormSchemas() throws Exception {
@Test(description = "tests ObjectWithValidations")
public void testObjectWithValidations() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7361.yaml");
- final DefaultCodegen codegen = new PythonClientExperimentalCodegen();
+ final DefaultCodegen codegen = new PythonClientCodegen();
codegen.setOpenAPI(openAPI);
String modelName = "FreeFormWithValidation";
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java
similarity index 75%
rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java
rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java
index 8aac0c1a30d4..15bd68e7f747 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java
@@ -23,17 +23,89 @@
import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.parser.util.SchemaTypeUtil;
import org.openapitools.codegen.*;
-import org.openapitools.codegen.languages.PythonClientCodegen;
+import org.openapitools.codegen.languages.PythonLegacyClientCodegen;
import org.testng.Assert;
import org.testng.annotations.Test;
-@SuppressWarnings("static-method")
-public class PythonTest {
+import java.util.ArrayList;
+import java.util.Arrays;
+
+public class PythonLegacyClientCodegenTest {
+
+ @Test
+ public void testInitialConfigValues() throws Exception {
+ final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen();
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), true);
+ }
+
+ @Test
+ public void testSettersForConfigValues() throws Exception {
+ final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen();
+ codegen.setHideGenerationTimestamp(false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ }
+
+ @Test
+ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
+ final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ }
+
+ @Test(description = "test enum null/nullable patterns")
+ public void testEnumNull() {
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1997.yaml");
+
+ StringSchema prop = (StringSchema) openAPI.getComponents().getSchemas().get("Type").getProperties().get("prop");
+ ArrayList expected = new ArrayList<>(Arrays.asList("A", "B", "C"));
+ assert prop.getNullable();
+ assert prop.getEnum().equals(expected);
+ }
+
+ @Test(description = "test regex patterns")
+ public void testRegularExpressionOpenAPISchemaVersion3() {
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1517.yaml");
+ final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen();
+ codegen.setOpenAPI(openAPI);
+ final String path = "/ping";
+ final Operation p = openAPI.getPaths().get(path).getGet();
+ final CodegenOperation op = codegen.fromOperation(path, "get", p, null);
+ // pattern_no_forward_slashes '^pattern$'
+ Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/");
+ // pattern_two_slashes '/^pattern$/'
+ Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/");
+ // pattern_dont_escape_backslash '/^pattern\d{3}$/'
+ Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/");
+ // pattern_dont_escape_escaped_forward_slash '/^pattern\/\d{3}$/'
+ Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern\\/\\d{3}$/");
+ // pattern_escape_unescaped_forward_slash '^pattern/\d{3}$'
+ Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/");
+ // pattern_with_modifiers '/^pattern\d{3}$/i
+ Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i");
+ }
+
+ @Test(description = "test single quotes escape")
+ public void testSingleQuotes() {
+ final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen();
+ StringSchema schema = new StringSchema();
+ schema.setDefault("Text containing 'single' quote");
+ String defaultValue = codegen.toDefaultValue(schema);
+ Assert.assertEquals("'Text containing \'single\' quote'", defaultValue);
+ }
@Test(description = "convert a python model with dots")
public void modelTest() {
final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json");
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
codegen.setOpenAPI(openAPI);
codegen.setOpenAPI(openAPI);
@@ -64,7 +136,7 @@ public void simpleModelTest() {
.addProperties("createdAt", new DateTimeSchema())
.addRequiredItem("id")
.addRequiredItem("name");
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", schema);
@@ -109,7 +181,7 @@ public void listPropertyTest() {
.addProperties("urls", new ArraySchema()
.items(new StringSchema()))
.addRequiredItem("id");
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -147,7 +219,7 @@ public void mapPropertyTest() {
.addProperties("translations", new MapSchema()
.additionalProperties(new StringSchema()))
.addRequiredItem("id");
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -173,7 +245,7 @@ public void complexPropertyTest() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("children", new Schema().$ref("#/definitions/Children"));
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -198,7 +270,7 @@ public void complexListPropertyTest() {
.description("a sample model")
.addProperties("children", new ArraySchema()
.items(new Schema().$ref("#/definitions/Children")));
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -225,7 +297,7 @@ public void complexMapPropertyTest() {
.description("a sample model")
.addProperties("children", new MapSchema()
.additionalProperties(new Schema().$ref("#/definitions/Children")));
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -255,7 +327,7 @@ public void arrayModelTest() {
//.description()
.items(new Schema().$ref("#/definitions/Children"))
.description("an array model");
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -275,7 +347,7 @@ public void mapModelTest() {
final Schema model = new Schema()
.description("a map model")
.additionalProperties(new Schema().$ref("#/definitions/Children"));
- final DefaultCodegen codegen = new PythonClientCodegen();
+ final DefaultCodegen codegen = new PythonLegacyClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
@@ -288,5 +360,4 @@ public void mapModelTest() {
Assert.assertEquals(cm.imports.size(), 1);
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
}
-
-}
\ No newline at end of file
+}
diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
similarity index 100%
rename from modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
rename to modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
diff --git a/pom.xml b/pom.xml
index 0368bef18444..95b98ce73455 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1203,11 +1203,11 @@
samples/client/petstore/javascript-flowtyped
samples/client/petstore/python
- samples/client/petstore/python-experimental
+ samples/client/petstore/python-legacy
samples/client/petstore/python-asyncio
samples/client/petstore/python-tornado
samples/openapi3/client/petstore/python
- samples/openapi3/client/petstore/python-experimental
+ samples/openapi3/client/petstore/python-legacy
samples/openapi3/client/petstore/typescript/builds/default
samples/openapi3/client/petstore/typescript/tests/default
samples/openapi3/client/petstore/typescript/builds/jquery
@@ -1232,6 +1232,8 @@
samples/client/petstore/typescript-angular-v4.3/npm -->
samples/client/petstore/typescript-angular-v6-provided-in-root
samples/client/petstore/typescript-angular-v7-provided-in-root
+ samples/client/petstore/kotlin-threetenbp/
+ samples/client/petstore/kotlin-string/
@@ -1244,6 +1246,12 @@
+ samples/server/petstore/kotlin-springboot
+ samples/server/petstore/jaxrs/jersey2
+ samples/server/petstore/jaxrs/jersey2-useTags
+ samples/server/petstore/spring-mvc
+ samples/server/petstore/spring-mvc-j8-async
+ samples/server/petstore/spring-mvc-j8-localdatetime
samples/server/petstore/jaxrs-jersey
samples/server/petstore/jaxrs-spec
@@ -1295,7 +1303,6 @@
samples/server/petstore/java-vertx-web
samples/server/petstore/scala-finch
- samples/server/petstore/kotlin-springboot
@@ -1371,17 +1378,10 @@
samples/client/petstore/kotlin-nonpublic/
samples/client/petstore/kotlin-nullable/
samples/client/petstore/kotlin-okhttp3/
- samples/client/petstore/kotlin-threetenbp/
- samples/client/petstore/kotlin-string/
samples/client/petstore/kotlin-moshi-codegen/
samples/client/petstore/kotlin-json-request-string/
- samples/server/petstore/jaxrs/jersey2
- samples/server/petstore/jaxrs/jersey2-useTags
- samples/server/petstore/spring-mvc
- samples/server/petstore/spring-mvc-j8-async
- samples/server/petstore/spring-mvc-j8-localdatetime
diff --git a/samples/client/petstore/kotlin-string/pom.xml b/samples/client/petstore/kotlin-string/pom.xml
index a8d5f88f257b..51365b8eae1c 100644
--- a/samples/client/petstore/kotlin-string/pom.xml
+++ b/samples/client/petstore/kotlin-string/pom.xml
@@ -27,13 +27,26 @@
1.2.1
- bundle-test
+ bundle-install
integration-test
exec
gradle
+
+ wrapper
+
+
+
+
+ bundle-test
+ integration-test
+
+ exec
+
+
+ ./gradlew
test
diff --git a/samples/client/petstore/kotlin-threetenbp/pom.xml b/samples/client/petstore/kotlin-threetenbp/pom.xml
index 7a670388889a..6875e7432946 100644
--- a/samples/client/petstore/kotlin-threetenbp/pom.xml
+++ b/samples/client/petstore/kotlin-threetenbp/pom.xml
@@ -27,13 +27,26 @@
1.2.1
- bundle-test
+ bundle-install
integration-test
exec
gradle
+
+ wrapper
+
+
+
+
+ bundle-test
+ integration-test
+
+ exec
+
+
+ ./gradlew
test
diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md
index 1cfb40e579e7..8f9d03589bc7 100644
--- a/samples/client/petstore/python-asyncio/README.md
+++ b/samples/client/petstore/python-asyncio/README.md
@@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientCodegen
+- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen
## Requirements.
diff --git a/samples/client/petstore/python-experimental/.gitlab-ci.yml b/samples/client/petstore/python-experimental/.gitlab-ci.yml
deleted file mode 100644
index 611e425676ee..000000000000
--- a/samples/client/petstore/python-experimental/.gitlab-ci.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-# ref: https://docs.gitlab.com/ee/ci/README.html
-
-stages:
- - test
-
-.tests:
- stage: test
- script:
- - pip install -r requirements.txt
- - pip install -r test-requirements.txt
- - pytest --cov=petstore_api
-
-test-3.5:
- extends: .tests
- image: python:3.5-alpine
-test-3.6:
- extends: .tests
- image: python:3.6-alpine
-test-3.7:
- extends: .tests
- image: python:3.7-alpine
-test-3.8:
- extends: .tests
- image: python:3.8-alpine
diff --git a/samples/client/petstore/python-experimental/.openapi-generator/FILES b/samples/client/petstore/python-experimental/.openapi-generator/FILES
deleted file mode 100644
index a5adeaaddc68..000000000000
--- a/samples/client/petstore/python-experimental/.openapi-generator/FILES
+++ /dev/null
@@ -1,159 +0,0 @@
-.gitignore
-.gitlab-ci.yml
-.travis.yml
-README.md
-docs/AdditionalPropertiesAnyType.md
-docs/AdditionalPropertiesArray.md
-docs/AdditionalPropertiesBoolean.md
-docs/AdditionalPropertiesClass.md
-docs/AdditionalPropertiesInteger.md
-docs/AdditionalPropertiesNumber.md
-docs/AdditionalPropertiesObject.md
-docs/AdditionalPropertiesString.md
-docs/Animal.md
-docs/AnimalFarm.md
-docs/AnotherFakeApi.md
-docs/ApiResponse.md
-docs/ArrayOfArrayOfNumberOnly.md
-docs/ArrayOfNumberOnly.md
-docs/ArrayTest.md
-docs/Capitalization.md
-docs/Cat.md
-docs/CatAllOf.md
-docs/Category.md
-docs/Child.md
-docs/ChildAllOf.md
-docs/ChildCat.md
-docs/ChildCatAllOf.md
-docs/ChildDog.md
-docs/ChildDogAllOf.md
-docs/ChildLizard.md
-docs/ChildLizardAllOf.md
-docs/ClassModel.md
-docs/Client.md
-docs/Dog.md
-docs/DogAllOf.md
-docs/EnumArrays.md
-docs/EnumClass.md
-docs/EnumTest.md
-docs/FakeApi.md
-docs/FakeClassnameTags123Api.md
-docs/File.md
-docs/FileSchemaTestClass.md
-docs/FormatTest.md
-docs/Grandparent.md
-docs/GrandparentAnimal.md
-docs/HasOnlyReadOnly.md
-docs/List.md
-docs/MapTest.md
-docs/MixedPropertiesAndAdditionalPropertiesClass.md
-docs/Model200Response.md
-docs/ModelReturn.md
-docs/Name.md
-docs/NumberOnly.md
-docs/NumberWithValidations.md
-docs/ObjectModelWithRefProps.md
-docs/Order.md
-docs/Parent.md
-docs/ParentAllOf.md
-docs/ParentPet.md
-docs/Pet.md
-docs/PetApi.md
-docs/Player.md
-docs/ReadOnlyFirst.md
-docs/SpecialModelName.md
-docs/StoreApi.md
-docs/StringBooleanMap.md
-docs/StringEnum.md
-docs/Tag.md
-docs/TypeHolderDefault.md
-docs/TypeHolderExample.md
-docs/User.md
-docs/UserApi.md
-docs/XmlItem.md
-git_push.sh
-petstore_api/__init__.py
-petstore_api/api/__init__.py
-petstore_api/api/another_fake_api.py
-petstore_api/api/fake_api.py
-petstore_api/api/fake_classname_tags_123_api.py
-petstore_api/api/pet_api.py
-petstore_api/api/store_api.py
-petstore_api/api/user_api.py
-petstore_api/api_client.py
-petstore_api/apis/__init__.py
-petstore_api/configuration.py
-petstore_api/exceptions.py
-petstore_api/model/__init__.py
-petstore_api/model/additional_properties_any_type.py
-petstore_api/model/additional_properties_array.py
-petstore_api/model/additional_properties_boolean.py
-petstore_api/model/additional_properties_class.py
-petstore_api/model/additional_properties_integer.py
-petstore_api/model/additional_properties_number.py
-petstore_api/model/additional_properties_object.py
-petstore_api/model/additional_properties_string.py
-petstore_api/model/animal.py
-petstore_api/model/animal_farm.py
-petstore_api/model/api_response.py
-petstore_api/model/array_of_array_of_number_only.py
-petstore_api/model/array_of_number_only.py
-petstore_api/model/array_test.py
-petstore_api/model/capitalization.py
-petstore_api/model/cat.py
-petstore_api/model/cat_all_of.py
-petstore_api/model/category.py
-petstore_api/model/child.py
-petstore_api/model/child_all_of.py
-petstore_api/model/child_cat.py
-petstore_api/model/child_cat_all_of.py
-petstore_api/model/child_dog.py
-petstore_api/model/child_dog_all_of.py
-petstore_api/model/child_lizard.py
-petstore_api/model/child_lizard_all_of.py
-petstore_api/model/class_model.py
-petstore_api/model/client.py
-petstore_api/model/dog.py
-petstore_api/model/dog_all_of.py
-petstore_api/model/enum_arrays.py
-petstore_api/model/enum_class.py
-petstore_api/model/enum_test.py
-petstore_api/model/file.py
-petstore_api/model/file_schema_test_class.py
-petstore_api/model/format_test.py
-petstore_api/model/grandparent.py
-petstore_api/model/grandparent_animal.py
-petstore_api/model/has_only_read_only.py
-petstore_api/model/list.py
-petstore_api/model/map_test.py
-petstore_api/model/mixed_properties_and_additional_properties_class.py
-petstore_api/model/model200_response.py
-petstore_api/model/model_return.py
-petstore_api/model/name.py
-petstore_api/model/number_only.py
-petstore_api/model/number_with_validations.py
-petstore_api/model/object_model_with_ref_props.py
-petstore_api/model/order.py
-petstore_api/model/parent.py
-petstore_api/model/parent_all_of.py
-petstore_api/model/parent_pet.py
-petstore_api/model/pet.py
-petstore_api/model/player.py
-petstore_api/model/read_only_first.py
-petstore_api/model/special_model_name.py
-petstore_api/model/string_boolean_map.py
-petstore_api/model/string_enum.py
-petstore_api/model/tag.py
-petstore_api/model/type_holder_default.py
-petstore_api/model/type_holder_example.py
-petstore_api/model/user.py
-petstore_api/model/xml_item.py
-petstore_api/model_utils.py
-petstore_api/models/__init__.py
-petstore_api/rest.py
-requirements.txt
-setup.cfg
-setup.py
-test-requirements.txt
-test/__init__.py
-tox.ini
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md
deleted file mode 100644
index 4a9d1dd133ce..000000000000
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# AdditionalPropertiesClass
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**map_string** | **{str: (str,)}** | | [optional]
-**map_number** | **{str: (float,)}** | | [optional]
-**map_integer** | **{str: (int,)}** | | [optional]
-**map_boolean** | **{str: (bool,)}** | | [optional]
-**map_array_integer** | **{str: ([int],)}** | | [optional]
-**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str],)}** | | [optional]
-**map_map_string** | **{str: ({str: (str,)},)}** | | [optional]
-**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)}** | | [optional]
-**anytype_1** | **bool, date, datetime, dict, float, int, list, str** | | [optional]
-**anytype_2** | **bool, date, datetime, dict, float, int, list, str** | | [optional]
-**anytype_3** | **bool, date, datetime, dict, float, int, list, str** | | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md
deleted file mode 100644
index 3fcf2c9299df..000000000000
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# AdditionalPropertiesObject
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **str** | | [optional]
-**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str,)}** | any string name can be used but the value must be the correct type | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/docs/Cat.md b/samples/client/petstore/python-experimental/docs/Cat.md
deleted file mode 100644
index b2662bc06c1d..000000000000
--- a/samples/client/petstore/python-experimental/docs/Cat.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Cat
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**class_name** | **str** | |
-**declawed** | **bool** | | [optional]
-**color** | **str** | | [optional] if omitted the server will use the default value of "red"
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/docs/Dog.md b/samples/client/petstore/python-experimental/docs/Dog.md
deleted file mode 100644
index ca679f81b41c..000000000000
--- a/samples/client/petstore/python-experimental/docs/Dog.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Dog
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**class_name** | **str** | |
-**breed** | **str** | | [optional]
-**color** | **str** | | [optional] if omitted the server will use the default value of "red"
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/docs/EnumClass.md b/samples/client/petstore/python-experimental/docs/EnumClass.md
deleted file mode 100644
index 6dda7fd8a77f..000000000000
--- a/samples/client/petstore/python-experimental/docs/EnumClass.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# EnumClass
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/docs/MapTest.md b/samples/client/petstore/python-experimental/docs/MapTest.md
deleted file mode 100644
index ad561b7220bf..000000000000
--- a/samples/client/petstore/python-experimental/docs/MapTest.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# MapTest
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional]
-**map_of_enum_string** | **{str: (str,)}** | | [optional]
-**direct_map** | **{str: (bool,)}** | | [optional]
-**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md
deleted file mode 100644
index 42322d2f4c37..000000000000
--- a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# TypeHolderDefault
-
-a model to test optional properties with server defaults
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**array_item** | **[int]** | |
-**string_item** | **str** | | defaults to "what"
-**number_item** | **float** | | defaults to 1.234
-**integer_item** | **int** | | defaults to -2
-**bool_item** | **bool** | | defaults to True
-**date_item** | **date** | | [optional]
-**datetime_item** | **datetime** | | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/client/petstore/python-experimental/petstore_api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/__init__.py
deleted file mode 100644
index 50dbde60cc5a..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/__init__.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-__version__ = "1.0.0"
-
-# import ApiClient
-from petstore_api.api_client import ApiClient
-
-# import Configuration
-from petstore_api.configuration import Configuration
-
-# import exceptions
-from petstore_api.exceptions import OpenApiException
-from petstore_api.exceptions import ApiAttributeError
-from petstore_api.exceptions import ApiTypeError
-from petstore_api.exceptions import ApiValueError
-from petstore_api.exceptions import ApiKeyError
-from petstore_api.exceptions import ApiException
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/api/__init__.py
deleted file mode 100644
index 840e9f0cd908..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# do not import all apis into this module because that uses a lot of memory and stack frames
-# if you need the ability to import all apis from one package, import them with
-# from petstore_api.apis import AnotherFakeApi
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py
deleted file mode 100644
index 29cc147fd32d..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.client import Client
-
-
-class AnotherFakeApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __call_123_test_special_tags(
- self,
- body,
- **kwargs
- ):
- """To test special tags # noqa: E501
-
- To test special tags and operation ID starting with number # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.call_123_test_special_tags(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (Client): client model
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Client
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.call_123_test_special_tags = Endpoint(
- settings={
- 'response_type': (Client,),
- 'auth': [],
- 'endpoint_path': '/another-fake/dummy',
- 'operation_id': 'call_123_test_special_tags',
- 'http_method': 'PATCH',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (Client,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__call_123_test_special_tags
- )
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py
deleted file mode 100644
index 316c8136ce2a..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py
+++ /dev/null
@@ -1,2225 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.animal_farm import AnimalFarm
-from petstore_api.model.client import Client
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
-from petstore_api.model.number_with_validations import NumberWithValidations
-from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
-from petstore_api.model.string_enum import StringEnum
-from petstore_api.model.user import User
-from petstore_api.model.xml_item import XmlItem
-
-
-class FakeApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __array_model(
- self,
- **kwargs
- ):
- """array_model # noqa: E501
-
- Test serialization of ArrayModel # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.array_model(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (AnimalFarm): Input model. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- AnimalFarm
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.array_model = Endpoint(
- settings={
- 'response_type': (AnimalFarm,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/arraymodel',
- 'operation_id': 'array_model',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (AnimalFarm,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- '*/*'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__array_model
- )
-
- def __boolean(
- self,
- **kwargs
- ):
- """boolean # noqa: E501
-
- 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_req=True
-
- >>> thread = api.boolean(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (bool): Input boolean as post body. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- bool
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.boolean = Endpoint(
- settings={
- 'response_type': (bool,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/boolean',
- 'operation_id': 'boolean',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (bool,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- '*/*'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__boolean
- )
-
- def __create_xml_item(
- self,
- xml_item,
- **kwargs
- ):
- """creates an XmlItem # noqa: E501
-
- this route creates an XmlItem # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.create_xml_item(xml_item, async_req=True)
- >>> result = thread.get()
-
- Args:
- xml_item (XmlItem): XmlItem Body
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['xml_item'] = \
- xml_item
- return self.call_with_http_info(**kwargs)
-
- self.create_xml_item = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/create_xml_item',
- 'operation_id': 'create_xml_item',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'xml_item',
- ],
- 'required': [
- 'xml_item',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'xml_item':
- (XmlItem,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'xml_item': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/xml',
- 'application/xml; charset=utf-8',
- 'application/xml; charset=utf-16',
- 'text/xml',
- 'text/xml; charset=utf-8',
- 'text/xml; charset=utf-16'
- ]
- },
- api_client=api_client,
- callable=__create_xml_item
- )
-
- def __number_with_validations(
- self,
- **kwargs
- ):
- """number_with_validations # noqa: E501
-
- 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_req=True
-
- >>> thread = api.number_with_validations(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (NumberWithValidations): Input number as post body. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- NumberWithValidations
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.number_with_validations = Endpoint(
- settings={
- 'response_type': (NumberWithValidations,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/number',
- 'operation_id': 'number_with_validations',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (NumberWithValidations,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- '*/*'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__number_with_validations
- )
-
- def __object_model_with_ref_props(
- self,
- **kwargs
- ):
- """object_model_with_ref_props # noqa: E501
-
- Test serialization of object with $refed properties # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.object_model_with_ref_props(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (ObjectModelWithRefProps): Input model. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ObjectModelWithRefProps
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.object_model_with_ref_props = Endpoint(
- settings={
- 'response_type': (ObjectModelWithRefProps,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/object_model_with_ref_props',
- 'operation_id': 'object_model_with_ref_props',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (ObjectModelWithRefProps,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- '*/*'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__object_model_with_ref_props
- )
-
- def __string(
- self,
- **kwargs
- ):
- """string # noqa: E501
-
- 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_req=True
-
- >>> thread = api.string(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (str): Input string as post body. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- str
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.string = Endpoint(
- settings={
- 'response_type': (str,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/string',
- 'operation_id': 'string',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (str,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- '*/*'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__string
- )
-
- def __string_enum(
- self,
- **kwargs
- ):
- """string_enum # noqa: E501
-
- Test serialization of outer enum # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.string_enum(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (StringEnum): Input enum. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- StringEnum
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.string_enum = Endpoint(
- settings={
- 'response_type': (StringEnum,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/enum',
- 'operation_id': 'string_enum',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (StringEnum,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- '*/*'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__string_enum
- )
-
- def __test_body_with_file_schema(
- self,
- body,
- **kwargs
- ):
- """test_body_with_file_schema # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_body_with_file_schema(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (FileSchemaTestClass):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.test_body_with_file_schema = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/body-with-file-schema',
- 'operation_id': 'test_body_with_file_schema',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (FileSchemaTestClass,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_body_with_file_schema
- )
-
- def __test_body_with_query_params(
- self,
- query,
- body,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.test_body_with_query_params(query, body, async_req=True)
- >>> result = thread.get()
-
- Args:
- query (str):
- body (User):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['query'] = \
- query
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.test_body_with_query_params = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/body-with-query-params',
- 'operation_id': 'test_body_with_query_params',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'query',
- 'body',
- ],
- 'required': [
- 'query',
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'query':
- (str,),
- 'body':
- (User,),
- },
- 'attribute_map': {
- 'query': 'query',
- },
- 'location_map': {
- 'query': 'query',
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_body_with_query_params
- )
-
- def __test_client_model(
- self,
- body,
- **kwargs
- ):
- """To test \"client\" model # noqa: E501
-
- To test \"client\" model # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_client_model(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (Client): client model
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Client
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.test_client_model = Endpoint(
- settings={
- 'response_type': (Client,),
- 'auth': [],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_client_model',
- 'http_method': 'PATCH',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (Client,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_client_model
- )
-
- def __test_endpoint_enums_length_one(
- self,
- query_integer=3,
- query_string="brillig",
- path_string="hello",
- path_integer=34,
- header_number=1.234,
- **kwargs
- ):
- """test_endpoint_enums_length_one # noqa: E501
-
- This route has required values with enums of 1 # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True)
- >>> result = thread.get()
-
- Args:
- query_integer (int): defaults to 3, must be one of [3]
- query_string (str): defaults to "brillig", must be one of ["brillig"]
- path_string (str): defaults to "hello", must be one of ["hello"]
- path_integer (int): defaults to 34, must be one of [34]
- header_number (float): defaults to 1.234, must be one of [1.234]
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['query_integer'] = \
- query_integer
- kwargs['query_string'] = \
- query_string
- kwargs['path_string'] = \
- path_string
- kwargs['path_integer'] = \
- path_integer
- kwargs['header_number'] = \
- header_number
- return self.call_with_http_info(**kwargs)
-
- self.test_endpoint_enums_length_one = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/enums-of-length-one/{path_string}/{path_integer}',
- 'operation_id': 'test_endpoint_enums_length_one',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'query_integer',
- 'query_string',
- 'path_string',
- 'path_integer',
- 'header_number',
- ],
- 'required': [
- 'query_integer',
- 'query_string',
- 'path_string',
- 'path_integer',
- 'header_number',
- ],
- 'nullable': [
- ],
- 'enum': [
- 'query_integer',
- 'query_string',
- 'path_string',
- 'path_integer',
- 'header_number',
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- ('query_integer',): {
-
- "3": 3
- },
- ('query_string',): {
-
- "BRILLIG": "brillig"
- },
- ('path_string',): {
-
- "HELLO": "hello"
- },
- ('path_integer',): {
-
- "34": 34
- },
- ('header_number',): {
-
- "1.234": 1.234
- },
- },
- 'openapi_types': {
- 'query_integer':
- (int,),
- 'query_string':
- (str,),
- 'path_string':
- (str,),
- 'path_integer':
- (int,),
- 'header_number':
- (float,),
- },
- 'attribute_map': {
- 'query_integer': 'query_integer',
- 'query_string': 'query_string',
- 'path_string': 'path_string',
- 'path_integer': 'path_integer',
- 'header_number': 'header_number',
- },
- 'location_map': {
- 'query_integer': 'query',
- 'query_string': 'query',
- 'path_string': 'path',
- 'path_integer': 'path',
- 'header_number': 'header',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__test_endpoint_enums_length_one
- )
-
- def __test_endpoint_parameters(
- self,
- number,
- double,
- pattern_without_delimiter,
- byte,
- **kwargs
- ):
- """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
- >>> result = thread.get()
-
- Args:
- number (float): None
- double (float): None
- pattern_without_delimiter (str): None
- byte (str): None
-
- Keyword Args:
- integer (int): None. [optional]
- int32 (int): None. [optional]
- int64 (int): None. [optional]
- float (float): None. [optional]
- string (str): None. [optional]
- binary (file_type): None. [optional]
- date (date): None. [optional]
- date_time (datetime): None. [optional]
- password (str): None. [optional]
- param_callback (str): None. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['number'] = \
- number
- kwargs['double'] = \
- double
- kwargs['pattern_without_delimiter'] = \
- pattern_without_delimiter
- kwargs['byte'] = \
- byte
- return self.call_with_http_info(**kwargs)
-
- self.test_endpoint_parameters = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'http_basic_test'
- ],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_endpoint_parameters',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'byte',
- 'integer',
- 'int32',
- 'int64',
- 'float',
- 'string',
- 'binary',
- 'date',
- 'date_time',
- 'password',
- 'param_callback',
- ],
- 'required': [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'byte',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'integer',
- 'int32',
- 'float',
- 'string',
- 'password',
- ]
- },
- root_map={
- 'validations': {
- ('number',): {
-
- 'inclusive_maximum': 543.2,
- 'inclusive_minimum': 32.1,
- },
- ('double',): {
-
- 'inclusive_maximum': 123.4,
- 'inclusive_minimum': 67.8,
- },
- ('pattern_without_delimiter',): {
-
- 'regex': {
- 'pattern': r'^[A-Z].*', # noqa: E501
- },
- },
- ('integer',): {
-
- 'inclusive_maximum': 100,
- 'inclusive_minimum': 10,
- },
- ('int32',): {
-
- 'inclusive_maximum': 200,
- 'inclusive_minimum': 20,
- },
- ('float',): {
-
- 'inclusive_maximum': 987.6,
- },
- ('string',): {
-
- 'regex': {
- 'pattern': r'[a-z]', # noqa: E501
- 'flags': (re.IGNORECASE)
- },
- },
- ('password',): {
- 'max_length': 64,
- 'min_length': 10,
- },
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'number':
- (float,),
- 'double':
- (float,),
- 'pattern_without_delimiter':
- (str,),
- 'byte':
- (str,),
- 'integer':
- (int,),
- 'int32':
- (int,),
- 'int64':
- (int,),
- 'float':
- (float,),
- 'string':
- (str,),
- 'binary':
- (file_type,),
- 'date':
- (date,),
- 'date_time':
- (datetime,),
- 'password':
- (str,),
- 'param_callback':
- (str,),
- },
- 'attribute_map': {
- 'number': 'number',
- 'double': 'double',
- 'pattern_without_delimiter': 'pattern_without_delimiter',
- 'byte': 'byte',
- 'integer': 'integer',
- 'int32': 'int32',
- 'int64': 'int64',
- 'float': 'float',
- 'string': 'string',
- 'binary': 'binary',
- 'date': 'date',
- 'date_time': 'dateTime',
- 'password': 'password',
- 'param_callback': 'callback',
- },
- 'location_map': {
- 'number': 'form',
- 'double': 'form',
- 'pattern_without_delimiter': 'form',
- 'byte': 'form',
- 'integer': 'form',
- 'int32': 'form',
- 'int64': 'form',
- 'float': 'form',
- 'string': 'form',
- 'binary': 'form',
- 'date': 'form',
- 'date_time': 'form',
- 'password': 'form',
- 'param_callback': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__test_endpoint_parameters
- )
-
- def __test_enum_parameters(
- self,
- **kwargs
- ):
- """To test enum parameters # noqa: E501
-
- To test enum parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_enum_parameters(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- enum_header_string_array ([str]): Header parameter enum test (string array). [optional]
- enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
- enum_query_string_array ([str]): Query parameter enum test (string array). [optional]
- enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
- enum_query_integer (int): Query parameter enum test (double). [optional]
- enum_query_double (float): Query parameter enum test (double). [optional]
- enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$"
- enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.test_enum_parameters = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_enum_parameters',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- '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',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- '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',
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- ('enum_header_string_array',): {
-
- ">": ">",
- "$": "$"
- },
- ('enum_header_string',): {
-
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- },
- ('enum_query_string_array',): {
-
- ">": ">",
- "$": "$"
- },
- ('enum_query_string',): {
-
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- },
- ('enum_query_integer',): {
-
- "1": 1,
- "-2": -2
- },
- ('enum_query_double',): {
-
- "1.1": 1.1,
- "-1.2": -1.2
- },
- ('enum_form_string_array',): {
-
- ">": ">",
- "$": "$"
- },
- ('enum_form_string',): {
-
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- },
- },
- 'openapi_types': {
- 'enum_header_string_array':
- ([str],),
- 'enum_header_string':
- (str,),
- 'enum_query_string_array':
- ([str],),
- 'enum_query_string':
- (str,),
- 'enum_query_integer':
- (int,),
- 'enum_query_double':
- (float,),
- 'enum_form_string_array':
- ([str],),
- 'enum_form_string':
- (str,),
- },
- 'attribute_map': {
- 'enum_header_string_array': 'enum_header_string_array',
- 'enum_header_string': 'enum_header_string',
- 'enum_query_string_array': 'enum_query_string_array',
- 'enum_query_string': 'enum_query_string',
- 'enum_query_integer': 'enum_query_integer',
- 'enum_query_double': 'enum_query_double',
- 'enum_form_string_array': 'enum_form_string_array',
- 'enum_form_string': 'enum_form_string',
- },
- 'location_map': {
- 'enum_header_string_array': 'header',
- 'enum_header_string': 'header',
- 'enum_query_string_array': 'query',
- 'enum_query_string': 'query',
- 'enum_query_integer': 'query',
- 'enum_query_double': 'query',
- 'enum_form_string_array': 'form',
- 'enum_form_string': 'form',
- },
- 'collection_format_map': {
- 'enum_header_string_array': 'csv',
- 'enum_query_string_array': 'csv',
- 'enum_form_string_array': 'csv',
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__test_enum_parameters
- )
-
- def __test_group_parameters(
- self,
- required_string_group,
- required_boolean_group,
- required_int64_group,
- **kwargs
- ):
- """Fake endpoint to test group parameters (optional) # noqa: E501
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
- >>> result = thread.get()
-
- Args:
- required_string_group (int): Required String in group parameters
- required_boolean_group (bool): Required Boolean in group parameters
- required_int64_group (int): Required Integer in group parameters
-
- Keyword Args:
- string_group (int): String in group parameters. [optional]
- boolean_group (bool): Boolean in group parameters. [optional]
- int64_group (int): Integer in group parameters. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['required_string_group'] = \
- required_string_group
- kwargs['required_boolean_group'] = \
- required_boolean_group
- kwargs['required_int64_group'] = \
- required_int64_group
- return self.call_with_http_info(**kwargs)
-
- self.test_group_parameters = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_group_parameters',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'required_string_group',
- 'required_boolean_group',
- 'required_int64_group',
- 'string_group',
- 'boolean_group',
- 'int64_group',
- ],
- 'required': [
- 'required_string_group',
- 'required_boolean_group',
- 'required_int64_group',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'required_string_group':
- (int,),
- 'required_boolean_group':
- (bool,),
- 'required_int64_group':
- (int,),
- 'string_group':
- (int,),
- 'boolean_group':
- (bool,),
- 'int64_group':
- (int,),
- },
- 'attribute_map': {
- 'required_string_group': 'required_string_group',
- 'required_boolean_group': 'required_boolean_group',
- 'required_int64_group': 'required_int64_group',
- 'string_group': 'string_group',
- 'boolean_group': 'boolean_group',
- 'int64_group': 'int64_group',
- },
- 'location_map': {
- 'required_string_group': 'query',
- 'required_boolean_group': 'header',
- 'required_int64_group': 'query',
- 'string_group': 'query',
- 'boolean_group': 'header',
- 'int64_group': 'query',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__test_group_parameters
- )
-
- def __test_inline_additional_properties(
- self,
- param,
- **kwargs
- ):
- """test inline additionalProperties # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_inline_additional_properties(param, async_req=True)
- >>> result = thread.get()
-
- Args:
- param ({str: (str,)}): request body
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['param'] = \
- param
- return self.call_with_http_info(**kwargs)
-
- self.test_inline_additional_properties = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/inline-additionalProperties',
- 'operation_id': 'test_inline_additional_properties',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'param',
- ],
- 'required': [
- 'param',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'param':
- ({str: (str,)},),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'param': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_inline_additional_properties
- )
-
- def __test_json_form_data(
- self,
- param,
- param2,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.test_json_form_data(param, param2, async_req=True)
- >>> result = thread.get()
-
- Args:
- param (str): field1
- param2 (str): field2
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['param'] = \
- param
- kwargs['param2'] = \
- param2
- return self.call_with_http_info(**kwargs)
-
- self.test_json_form_data = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/jsonFormData',
- 'operation_id': 'test_json_form_data',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'param',
- 'param2',
- ],
- 'required': [
- 'param',
- 'param2',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'param':
- (str,),
- 'param2':
- (str,),
- },
- 'attribute_map': {
- 'param': 'param',
- 'param2': 'param2',
- },
- 'location_map': {
- 'param': 'form',
- 'param2': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__test_json_form_data
- )
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py
deleted file mode 100644
index 634f9f13103a..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.client import Client
-
-
-class FakeClassnameTags123Api(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __test_classname(
- self,
- body,
- **kwargs
- ):
- """To test class name in snake case # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_classname(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (Client): client model
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Client
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.test_classname = Endpoint(
- settings={
- 'response_type': (Client,),
- 'auth': [
- 'api_key_query'
- ],
- 'endpoint_path': '/fake_classname_test',
- 'operation_id': 'test_classname',
- 'http_method': 'PATCH',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (Client,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_classname
- )
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py
deleted file mode 100644
index 66611a73f3ca..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py
+++ /dev/null
@@ -1,1172 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.api_response import ApiResponse
-from petstore_api.model.pet import Pet
-
-
-class PetApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __add_pet(
- self,
- body,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.add_pet(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (Pet): Pet object that needs to be added to the store
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.add_pet = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet',
- 'operation_id': 'add_pet',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (Pet,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json',
- 'application/xml'
- ]
- },
- api_client=api_client,
- callable=__add_pet
- )
-
- def __delete_pet(
- self,
- pet_id,
- **kwargs
- ):
- """Deletes a pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.delete_pet(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): Pet id to delete
-
- Keyword Args:
- api_key (str): [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.delete_pet = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/{petId}',
- 'operation_id': 'delete_pet',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'api_key',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'api_key':
- (str,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'api_key': 'api_key',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'api_key': 'header',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__delete_pet
- )
-
- def __find_pets_by_status(
- self,
- status,
- **kwargs
- ):
- """Finds Pets by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_status(status, async_req=True)
- >>> result = thread.get()
-
- Args:
- status ([str]): Status values that need to be considered for filter
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- [Pet]
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['status'] = \
- status
- return self.call_with_http_info(**kwargs)
-
- self.find_pets_by_status = Endpoint(
- settings={
- 'response_type': ([Pet],),
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/findByStatus',
- 'operation_id': 'find_pets_by_status',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'status',
- ],
- 'required': [
- 'status',
- ],
- 'nullable': [
- ],
- 'enum': [
- 'status',
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- ('status',): {
-
- "AVAILABLE": "available",
- "PENDING": "pending",
- "SOLD": "sold"
- },
- },
- 'openapi_types': {
- 'status':
- ([str],),
- },
- 'attribute_map': {
- 'status': 'status',
- },
- 'location_map': {
- 'status': 'query',
- },
- 'collection_format_map': {
- 'status': 'csv',
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__find_pets_by_status
- )
-
- def __find_pets_by_tags(
- self,
- tags,
- **kwargs
- ):
- """Finds Pets by tags # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_tags(tags, async_req=True)
- >>> result = thread.get()
-
- Args:
- tags ([str]): Tags to filter by
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- [Pet]
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['tags'] = \
- tags
- return self.call_with_http_info(**kwargs)
-
- self.find_pets_by_tags = Endpoint(
- settings={
- 'response_type': ([Pet],),
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/findByTags',
- 'operation_id': 'find_pets_by_tags',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'tags',
- ],
- 'required': [
- 'tags',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'tags':
- ([str],),
- },
- 'attribute_map': {
- 'tags': 'tags',
- },
- 'location_map': {
- 'tags': 'query',
- },
- 'collection_format_map': {
- 'tags': 'csv',
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__find_pets_by_tags
- )
-
- def __get_pet_by_id(
- self,
- pet_id,
- **kwargs
- ):
- """Find pet by ID # noqa: E501
-
- Returns a single pet # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.get_pet_by_id(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): ID of pet to return
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Pet
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.get_pet_by_id = Endpoint(
- settings={
- 'response_type': (Pet,),
- 'auth': [
- 'api_key'
- ],
- 'endpoint_path': '/pet/{petId}',
- 'operation_id': 'get_pet_by_id',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- },
- 'location_map': {
- 'pet_id': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_pet_by_id
- )
-
- def __update_pet(
- self,
- body,
- **kwargs
- ):
- """Update an existing pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.update_pet(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (Pet): Pet object that needs to be added to the store
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.update_pet = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet',
- 'operation_id': 'update_pet',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (Pet,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json',
- 'application/xml'
- ]
- },
- api_client=api_client,
- callable=__update_pet
- )
-
- def __update_pet_with_form(
- self,
- pet_id,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.update_pet_with_form(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): ID of pet that needs to be updated
-
- Keyword Args:
- name (str): Updated name of the pet. [optional]
- status (str): Updated status of the pet. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.update_pet_with_form = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/{petId}',
- 'operation_id': 'update_pet_with_form',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'name',
- 'status',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'name':
- (str,),
- 'status':
- (str,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'name': 'name',
- 'status': 'status',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'name': 'form',
- 'status': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__update_pet_with_form
- )
-
- def __upload_file(
- self,
- pet_id,
- **kwargs
- ):
- """uploads an image # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.upload_file(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): ID of pet to update
-
- Keyword Args:
- additional_metadata (str): Additional data to pass to server. [optional]
- file (file_type): file to upload. [optional]
- files ([file_type]): files to upload. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ApiResponse
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.upload_file = Endpoint(
- settings={
- 'response_type': (ApiResponse,),
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/{petId}/uploadImage',
- 'operation_id': 'upload_file',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'additional_metadata',
- 'file',
- 'files',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'additional_metadata':
- (str,),
- 'file':
- (file_type,),
- 'files':
- ([file_type],),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'additional_metadata': 'additionalMetadata',
- 'file': 'file',
- 'files': 'files',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'additional_metadata': 'form',
- 'file': 'form',
- 'files': 'form',
- },
- 'collection_format_map': {
- 'files': 'csv',
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'multipart/form-data'
- ]
- },
- api_client=api_client,
- callable=__upload_file
- )
-
- def __upload_file_with_required_file(
- self,
- pet_id,
- required_file,
- **kwargs
- ):
- """uploads an image (required) # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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()
-
- Args:
- pet_id (int): ID of pet to update
- required_file (file_type): file to upload
-
- Keyword Args:
- additional_metadata (str): Additional data to pass to server. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ApiResponse
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- kwargs['required_file'] = \
- required_file
- return self.call_with_http_info(**kwargs)
-
- self.upload_file_with_required_file = Endpoint(
- settings={
- 'response_type': (ApiResponse,),
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile',
- 'operation_id': 'upload_file_with_required_file',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'required_file',
- 'additional_metadata',
- ],
- 'required': [
- 'pet_id',
- 'required_file',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'required_file':
- (file_type,),
- 'additional_metadata':
- (str,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'required_file': 'requiredFile',
- 'additional_metadata': 'additionalMetadata',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'required_file': 'form',
- 'additional_metadata': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'multipart/form-data'
- ]
- },
- api_client=api_client,
- callable=__upload_file_with_required_file
- )
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py
deleted file mode 100644
index 7e6b6cba1c8c..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py
+++ /dev/null
@@ -1,501 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.order import Order
-
-
-class StoreApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __delete_order(
- self,
- order_id,
- **kwargs
- ):
- """Delete purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_order(order_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- order_id (str): ID of the order that needs to be deleted
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['order_id'] = \
- order_id
- return self.call_with_http_info(**kwargs)
-
- self.delete_order = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/store/order/{order_id}',
- 'operation_id': 'delete_order',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'order_id',
- ],
- 'required': [
- 'order_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'order_id':
- (str,),
- },
- 'attribute_map': {
- 'order_id': 'order_id',
- },
- 'location_map': {
- 'order_id': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__delete_order
- )
-
- def __get_inventory(
- self,
- **kwargs
- ):
- """Returns pet inventories by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_inventory(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- {str: (int,)}
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.get_inventory = Endpoint(
- settings={
- 'response_type': ({str: (int,)},),
- 'auth': [
- 'api_key'
- ],
- 'endpoint_path': '/store/inventory',
- 'operation_id': 'get_inventory',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- },
- 'attribute_map': {
- },
- 'location_map': {
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_inventory
- )
-
- def __get_order_by_id(
- self,
- order_id,
- **kwargs
- ):
- """Find purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_order_by_id(order_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- order_id (int): ID of pet that needs to be fetched
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Order
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['order_id'] = \
- order_id
- return self.call_with_http_info(**kwargs)
-
- self.get_order_by_id = Endpoint(
- settings={
- 'response_type': (Order,),
- 'auth': [],
- 'endpoint_path': '/store/order/{order_id}',
- 'operation_id': 'get_order_by_id',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'order_id',
- ],
- 'required': [
- 'order_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- 'order_id',
- ]
- },
- root_map={
- 'validations': {
- ('order_id',): {
-
- 'inclusive_maximum': 5,
- 'inclusive_minimum': 1,
- },
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'order_id':
- (int,),
- },
- 'attribute_map': {
- 'order_id': 'order_id',
- },
- 'location_map': {
- 'order_id': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_order_by_id
- )
-
- def __place_order(
- self,
- body,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.place_order(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (Order): order placed for purchasing the pet
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Order
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.place_order = Endpoint(
- settings={
- 'response_type': (Order,),
- 'auth': [],
- 'endpoint_path': '/store/order',
- 'operation_id': 'place_order',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (Order,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__place_order
- )
diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py
deleted file mode 100644
index 92dae02b424f..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py
+++ /dev/null
@@ -1,964 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.user import User
-
-
-class UserApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __create_user(
- self,
- body,
- **kwargs
- ):
- """Create user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.create_user(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body (User): Created user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.create_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user',
- 'operation_id': 'create_user',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (User,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__create_user
- )
-
- def __create_users_with_array_input(
- self,
- body,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.create_users_with_array_input(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body ([User]): List of user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.create_users_with_array_input = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/createWithArray',
- 'operation_id': 'create_users_with_array_input',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- ([User],),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__create_users_with_array_input
- )
-
- def __create_users_with_list_input(
- self,
- body,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.create_users_with_list_input(body, async_req=True)
- >>> result = thread.get()
-
- Args:
- body ([User]): List of user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.create_users_with_list_input = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/createWithList',
- 'operation_id': 'create_users_with_list_input',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- ([User],),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__create_users_with_list_input
- )
-
- def __delete_user(
- self,
- username,
- **kwargs
- ):
- """Delete user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_user(username, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): The name that needs to be deleted
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- return self.call_with_http_info(**kwargs)
-
- self.delete_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/{username}',
- 'operation_id': 'delete_user',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- ],
- 'required': [
- 'username',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- },
- 'attribute_map': {
- 'username': 'username',
- },
- 'location_map': {
- 'username': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__delete_user
- )
-
- def __get_user_by_name(
- self,
- username,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.get_user_by_name(username, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): The name that needs to be fetched. Use user1 for testing.
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- User
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- return self.call_with_http_info(**kwargs)
-
- self.get_user_by_name = Endpoint(
- settings={
- 'response_type': (User,),
- 'auth': [],
- 'endpoint_path': '/user/{username}',
- 'operation_id': 'get_user_by_name',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- ],
- 'required': [
- 'username',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- },
- 'attribute_map': {
- 'username': 'username',
- },
- 'location_map': {
- 'username': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_user_by_name
- )
-
- def __login_user(
- self,
- username,
- password,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.login_user(username, password, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): The user name for login
- password (str): The password for login in clear text
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- str
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- kwargs['password'] = \
- password
- return self.call_with_http_info(**kwargs)
-
- self.login_user = Endpoint(
- settings={
- 'response_type': (str,),
- 'auth': [],
- 'endpoint_path': '/user/login',
- 'operation_id': 'login_user',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- 'password',
- ],
- 'required': [
- 'username',
- 'password',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- 'password':
- (str,),
- },
- 'attribute_map': {
- 'username': 'username',
- 'password': 'password',
- },
- 'location_map': {
- 'username': 'query',
- 'password': 'query',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__login_user
- )
-
- def __logout_user(
- self,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.logout_user(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.logout_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/logout',
- 'operation_id': 'logout_user',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- },
- 'attribute_map': {
- },
- 'location_map': {
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__logout_user
- )
-
- def __update_user(
- self,
- username,
- body,
- **kwargs
- ):
- """Updated user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.update_user(username, body, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): name that need to be deleted
- body (User): Updated user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- kwargs['body'] = \
- body
- return self.call_with_http_info(**kwargs)
-
- self.update_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/{username}',
- 'operation_id': 'update_user',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- 'body',
- ],
- 'required': [
- 'username',
- 'body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- 'body':
- (User,),
- },
- 'attribute_map': {
- 'username': 'username',
- },
- 'location_map': {
- 'username': 'path',
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__update_user
- )
diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py
deleted file mode 100644
index 11aa326965b8..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/api_client.py
+++ /dev/null
@@ -1,818 +0,0 @@
-# coding: utf-8
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import json
-import atexit
-import mimetypes
-from multiprocessing.pool import ThreadPool
-import io
-import os
-import re
-import typing
-from urllib.parse import quote
-
-
-from petstore_api import rest
-from petstore_api.configuration import Configuration
-from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException
-from petstore_api.model_utils import (
- ModelNormal,
- ModelSimple,
- ModelComposed,
- check_allowed_values,
- check_validations,
- date,
- datetime,
- deserialize_file,
- file_type,
- model_to_dict,
- none_type,
- validate_and_convert_types
-)
-
-
-class ApiClient(object):
- """Generic API client for OpenAPI client library builds.
-
- OpenAPI generic API client. This client handles the client-
- server communication, and is invariant across implementations. Specifics of
- the methods and models for each application are generated from the OpenAPI
- templates.
-
- NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
-
- :param configuration: .Configuration object for this client
- :param header_name: a header to pass when making calls to the API.
- :param header_value: a header value to pass when making calls to
- the API.
- :param cookie: a cookie to include in the header when making calls
- to the API
- :param pool_threads: The number of threads to use for async requests
- to the API. More threads means more concurrent API requests.
- """
-
- _pool = None
-
- def __init__(self, configuration=None, header_name=None, header_value=None,
- cookie=None, pool_threads=1):
- if configuration is None:
- configuration = Configuration()
- self.configuration = configuration
- self.pool_threads = pool_threads
-
- self.rest_client = rest.RESTClientObject(configuration)
- self.default_headers = {}
- if header_name is not None:
- self.default_headers[header_name] = header_value
- self.cookie = cookie
- # Set default User-Agent.
- self.user_agent = 'OpenAPI-Generator/1.0.0/python'
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, traceback):
- self.close()
-
- def close(self):
- if self._pool:
- self._pool.close()
- self._pool.join()
- self._pool = None
- if hasattr(atexit, 'unregister'):
- atexit.unregister(self.close)
-
- @property
- def pool(self):
- """Create thread pool on first request
- avoids instantiating unused threadpool for blocking clients.
- """
- if self._pool is None:
- atexit.register(self.close)
- self._pool = ThreadPool(self.pool_threads)
- return self._pool
-
- @property
- def user_agent(self):
- """User agent for this API client"""
- return self.default_headers['User-Agent']
-
- @user_agent.setter
- def user_agent(self, value):
- self.default_headers['User-Agent'] = value
-
- def set_default_header(self, header_name, header_value):
- self.default_headers[header_name] = header_value
-
- def __call_api(
- self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None
- ):
-
- config = self.configuration
-
- # header parameters
- header_params = header_params or {}
- header_params.update(self.default_headers)
- if self.cookie:
- header_params['Cookie'] = self.cookie
- if header_params:
- header_params = self.sanitize_for_serialization(header_params)
- header_params = dict(self.parameters_to_tuples(header_params,
- collection_formats))
-
- # path parameters
- if path_params:
- path_params = self.sanitize_for_serialization(path_params)
- path_params = self.parameters_to_tuples(path_params,
- collection_formats)
- for k, v in path_params:
- # specified safe chars, encode everything
- resource_path = resource_path.replace(
- '{%s}' % k,
- quote(str(v), safe=config.safe_chars_for_path_param)
- )
-
- # query parameters
- if query_params:
- query_params = self.sanitize_for_serialization(query_params)
- query_params = self.parameters_to_tuples(query_params,
- collection_formats)
-
- # post parameters
- if post_params or files:
- post_params = post_params if post_params else []
- post_params = self.sanitize_for_serialization(post_params)
- post_params = self.parameters_to_tuples(post_params,
- collection_formats)
- post_params.extend(self.files_parameters(files))
-
- # body
- if body:
- body = self.sanitize_for_serialization(body)
-
- # auth setting
- self.update_params_for_auth(header_params, query_params,
- auth_settings, resource_path, method, body)
-
- # request url
- if _host is None:
- url = self.configuration.host + resource_path
- else:
- # use server/host defined in path or operation instead
- url = _host + resource_path
-
- try:
- # perform request and return response
- response_data = self.request(
- method, url, query_params=query_params, headers=header_params,
- post_params=post_params, body=body,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout)
- except ApiException as e:
- e.body = e.body.decode('utf-8')
- raise e
-
- content_type = response_data.getheader('content-type')
-
- self.last_response = response_data
-
- return_data = response_data
-
- if not _preload_content:
- return (return_data)
- return return_data
-
- if response_type not in ["file", "bytes"]:
- match = None
- if content_type is not None:
- match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
- encoding = match.group(1) if match else "utf-8"
- response_data.data = response_data.data.decode(encoding)
-
- # deserialize response data
- if response_type:
- return_data = self.deserialize(
- response_data,
- response_type,
- _check_type
- )
- else:
- return_data = None
-
- if _return_http_data_only:
- return (return_data)
- else:
- return (return_data, response_data.status,
- response_data.getheaders())
-
- @classmethod
- def sanitize_for_serialization(cls, obj):
- """Builds a JSON POST object.
- If obj is None, return None.
- If obj is str, int, long, float, bool, return directly.
- If obj is datetime.datetime, datetime.date
- convert to string in iso8601 format.
- If obj is list, sanitize each element in the list.
- If obj is dict, return the dict.
- If obj is OpenAPI model, return the properties dict.
- :param obj: The data to serialize.
- :return: The serialized form of data.
- """
- if isinstance(obj, (ModelNormal, ModelComposed)):
- return {
- key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()
- }
- elif isinstance(obj, (str, int, float, none_type, bool)):
- return obj
- elif isinstance(obj, (datetime, date)):
- return obj.isoformat()
- elif isinstance(obj, ModelSimple):
- return cls.sanitize_for_serialization(obj.value)
- elif isinstance(obj, (list, tuple)):
- return [cls.sanitize_for_serialization(item) for item in obj]
- if isinstance(obj, dict):
- return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
- raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))
-
- def deserialize(self, response, response_type, _check_type):
- """Deserializes response into an object.
-
- :param response: RESTResponse object to be deserialized.
- :param response_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param _check_type: boolean, whether to check the types of the data
- received from the server
- :type _check_type: bool
-
- :return: deserialized object.
- """
- # handle file downloading
- # save response body into a tmp file and return the instance
- if response_type == (file_type,):
- content_disposition = response.getheader("Content-Disposition")
- return deserialize_file(response.data, self.configuration,
- content_disposition=content_disposition)
-
- # fetch data from response object
- try:
- received_data = json.loads(response.data)
- except ValueError:
- received_data = response.data
-
- # store our data under the key of 'received_data' so users have some
- # context if they are deserializing a string and the data type is wrong
- deserialized_data = validate_and_convert_types(
- received_data,
- response_type,
- ['received_data'],
- True,
- _check_type,
- configuration=self.configuration
- )
- return deserialized_data
-
- def call_api(
- self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- async_req: typing.Optional[bool] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None
- ):
- """Makes the HTTP request (synchronous) and returns deserialized data.
-
- To make an async_req request, set the async_req parameter.
-
- :param resource_path: Path to method endpoint.
- :param method: Method to call.
- :param path_params: Path parameters in the url.
- :param query_params: Query parameters in the url.
- :param header_params: Header parameters to be
- placed in the request header.
- :param body: Request body.
- :param post_params dict: Request post form parameters,
- for `application/x-www-form-urlencoded`, `multipart/form-data`.
- :param auth_settings list: Auth Settings names for the request.
- :param response_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param files: key -> field name, value -> a list of open file
- objects for `multipart/form-data`.
- :type files: dict
- :param async_req bool: execute request asynchronously
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param collection_formats: dict of collection formats for path, query,
- header, and post parameters.
- :type collection_formats: dict, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _check_type: boolean describing if the data back from the server
- should have its type checked.
- :type _check_type: bool, optional
- :return:
- If async_req parameter is True,
- the request will be called asynchronously.
- The method will return the request thread.
- If parameter async_req is False or missing,
- then the method will return the response directly.
- """
- if not async_req:
- return self.__call_api(resource_path, method,
- path_params, query_params, header_params,
- body, post_params, files,
- response_type, auth_settings,
- _return_http_data_only, collection_formats,
- _preload_content, _request_timeout, _host,
- _check_type)
-
- return self.pool.apply_async(self.__call_api, (resource_path,
- method, path_params,
- query_params,
- header_params, body,
- post_params, files,
- response_type,
- auth_settings,
- _return_http_data_only,
- collection_formats,
- _preload_content,
- _request_timeout,
- _host, _check_type))
-
- def request(self, method, url, query_params=None, headers=None,
- post_params=None, body=None, _preload_content=True,
- _request_timeout=None):
- """Makes the HTTP request using RESTClient."""
- if method == "GET":
- return self.rest_client.GET(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "HEAD":
- return self.rest_client.HEAD(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "OPTIONS":
- return self.rest_client.OPTIONS(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "POST":
- return self.rest_client.POST(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PUT":
- return self.rest_client.PUT(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PATCH":
- return self.rest_client.PATCH(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "DELETE":
- return self.rest_client.DELETE(url,
- query_params=query_params,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- else:
- raise ApiValueError(
- "http method must be `GET`, `HEAD`, `OPTIONS`,"
- " `POST`, `PATCH`, `PUT` or `DELETE`."
- )
-
- def parameters_to_tuples(self, params, collection_formats):
- """Get parameters as list of tuples, formatting collections.
-
- :param params: Parameters as dict or list of two-tuples
- :param dict collection_formats: Parameter collection formats
- :return: Parameters as list of tuples, collections formatted
- """
- new_params = []
- if collection_formats is None:
- collection_formats = {}
- for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
- if k in collection_formats:
- collection_format = collection_formats[k]
- if collection_format == 'multi':
- new_params.extend((k, value) for value in v)
- else:
- if collection_format == 'ssv':
- delimiter = ' '
- elif collection_format == 'tsv':
- delimiter = '\t'
- elif collection_format == 'pipes':
- delimiter = '|'
- else: # csv is the default
- delimiter = ','
- new_params.append(
- (k, delimiter.join(str(value) for value in v)))
- else:
- new_params.append((k, v))
- return new_params
-
- def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
- """Builds form parameters.
-
- :param files: None or a dict with key=param_name and
- value is a list of open file objects
- :return: List of tuples of form parameters with file data
- """
- if files is None:
- return []
-
- params = []
- for param_name, file_instances in files.items():
- if file_instances is None:
- # if the file field is nullable, skip None values
- continue
- for file_instance in file_instances:
- if file_instance is None:
- # if the file field is nullable, skip None values
- continue
- if file_instance.closed is True:
- raise ApiValueError(
- "Cannot read a closed file. The passed in file_type "
- "for %s must be open." % param_name
- )
- filename = os.path.basename(file_instance.name)
- filedata = file_instance.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([param_name, tuple([filename, filedata, mimetype])]))
- file_instance.close()
-
- return params
-
- def select_header_accept(self, accepts):
- """Returns `Accept` based on an array of accepts provided.
-
- :param accepts: List of headers.
- :return: Accept (e.g. application/json).
- """
- if not accepts:
- return
-
- accepts = [x.lower() for x in accepts]
-
- if 'application/json' in accepts:
- return 'application/json'
- else:
- return ', '.join(accepts)
-
- def select_header_content_type(self, content_types):
- """Returns `Content-Type` based on an array of content_types provided.
-
- :param content_types: List of content-types.
- :return: Content-Type (e.g. application/json).
- """
- if not content_types:
- return 'application/json'
-
- content_types = [x.lower() for x in content_types]
-
- if 'application/json' in content_types or '*/*' in content_types:
- return 'application/json'
- else:
- return content_types[0]
-
- def update_params_for_auth(self, headers, querys, auth_settings,
- resource_path, method, body):
- """Updates header and query params based on authentication setting.
-
- :param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
- :param auth_settings: Authentication setting identifiers list.
- :param resource_path: A string representation of the HTTP request resource path.
- :param method: A string representation of the HTTP request method.
- :param body: A object representing the body of the HTTP request.
- The object type is the return value of _encoder.default().
- """
- if not auth_settings:
- return
-
- for auth in auth_settings:
- auth_setting = self.configuration.auth_settings().get(auth)
- if auth_setting:
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- if auth_setting['type'] != 'http-signature':
- headers[auth_setting['key']] = auth_setting['value']
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
-
-
-class Endpoint(object):
- def __init__(self, settings=None, params_map=None, root_map=None,
- headers_map=None, api_client=None, callable=None):
- """Creates an endpoint
-
- Args:
- settings (dict): see below key value pairs
- 'response_type' (tuple/None): response type
- 'auth' (list): a list of auth type keys
- 'endpoint_path' (str): the endpoint path
- 'operation_id' (str): endpoint string identifier
- 'http_method' (str): POST/PUT/PATCH/GET etc
- 'servers' (list): list of str servers that this endpoint is at
- params_map (dict): see below key value pairs
- 'all' (list): list of str endpoint parameter names
- 'required' (list): list of required parameter names
- 'nullable' (list): list of nullable parameter names
- 'enum' (list): list of parameters with enum values
- 'validation' (list): list of parameters with validations
- root_map
- 'validations' (dict): the dict mapping endpoint parameter tuple
- paths to their validation dictionaries
- 'allowed_values' (dict): the dict mapping endpoint parameter
- tuple paths to their allowed_values (enum) dictionaries
- 'openapi_types' (dict): param_name to openapi type
- 'attribute_map' (dict): param_name to camelCase name
- 'location_map' (dict): param_name to 'body', 'file', 'form',
- 'header', 'path', 'query'
- collection_format_map (dict): param_name to `csv` etc.
- headers_map (dict): see below key value pairs
- 'accept' (list): list of Accept header strings
- 'content_type' (list): list of Content-Type header strings
- api_client (ApiClient) api client instance
- callable (function): the function which is invoked when the
- Endpoint is called
- """
- self.settings = settings
- self.params_map = params_map
- self.params_map['all'].extend([
- 'async_req',
- '_host_index',
- '_preload_content',
- '_request_timeout',
- '_return_http_data_only',
- '_check_input_type',
- '_check_return_type'
- ])
- self.params_map['nullable'].extend(['_request_timeout'])
- self.validations = root_map['validations']
- self.allowed_values = root_map['allowed_values']
- self.openapi_types = root_map['openapi_types']
- extra_types = {
- 'async_req': (bool,),
- '_host_index': (none_type, int),
- '_preload_content': (bool,),
- '_request_timeout': (none_type, int, (int,), [int]),
- '_return_http_data_only': (bool,),
- '_check_input_type': (bool,),
- '_check_return_type': (bool,)
- }
- self.openapi_types.update(extra_types)
- self.attribute_map = root_map['attribute_map']
- self.location_map = root_map['location_map']
- self.collection_format_map = root_map['collection_format_map']
- self.headers_map = headers_map
- self.api_client = api_client
- self.callable = callable
-
- def __validate_inputs(self, kwargs):
- for param in self.params_map['enum']:
- if param in kwargs:
- check_allowed_values(
- self.allowed_values,
- (param,),
- kwargs[param]
- )
-
- for param in self.params_map['validation']:
- if param in kwargs:
- check_validations(
- self.validations,
- (param,),
- kwargs[param],
- configuration=self.api_client.configuration
- )
-
- if kwargs['_check_input_type'] is False:
- return
-
- for key, value in kwargs.items():
- fixed_val = validate_and_convert_types(
- value,
- self.openapi_types[key],
- [key],
- False,
- kwargs['_check_input_type'],
- configuration=self.api_client.configuration
- )
- kwargs[key] = fixed_val
-
- def __gather_params(self, kwargs):
- params = {
- 'body': None,
- 'collection_format': {},
- 'file': {},
- 'form': [],
- 'header': {},
- 'path': {},
- 'query': []
- }
-
- for param_name, param_value in kwargs.items():
- param_location = self.location_map.get(param_name)
- if param_location is None:
- continue
- if param_location:
- if param_location == 'body':
- params['body'] = param_value
- continue
- base_name = self.attribute_map[param_name]
- if (param_location == 'form' and
- self.openapi_types[param_name] == (file_type,)):
- params['file'][param_name] = [param_value]
- elif (param_location == 'form' and
- self.openapi_types[param_name] == ([file_type],)):
- # param_value is already a list
- params['file'][param_name] = param_value
- elif param_location in {'form', 'query'}:
- param_value_full = (base_name, param_value)
- params[param_location].append(param_value_full)
- if param_location not in {'form', 'query'}:
- params[param_location][base_name] = param_value
- collection_format = self.collection_format_map.get(param_name)
- if collection_format:
- params['collection_format'][base_name] = collection_format
-
- return params
-
- def __call__(self, *args, **kwargs):
- """ This method is invoked when endpoints are called
- Example:
-
- api_instance = AnotherFakeApi()
- api_instance.call_123_test_special_tags # this is an instance of the class Endpoint
- api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__()
- which then invokes the callable functions stored in that endpoint at
- api_instance.call_123_test_special_tags.callable or self.callable in this class
-
- """
- return self.callable(self, *args, **kwargs)
-
- def call_with_http_info(self, **kwargs):
-
- try:
- index = self.api_client.configuration.server_operation_index.get(
- self.settings['operation_id'], self.api_client.configuration.server_index
- ) if kwargs['_host_index'] is None else kwargs['_host_index']
- server_variables = self.api_client.configuration.server_operation_variables.get(
- self.settings['operation_id'], self.api_client.configuration.server_variables
- )
- _host = self.api_client.configuration.get_host_from_settings(
- index, variables=server_variables, servers=self.settings['servers']
- )
- except IndexError:
- if self.settings['servers']:
- raise ApiValueError(
- "Invalid host index. Must be 0 <= index < %s" %
- len(self.settings['servers'])
- )
- _host = None
-
- for key, value in kwargs.items():
- if key not in self.params_map['all']:
- raise ApiTypeError(
- "Got an unexpected parameter '%s'"
- " to method `%s`" %
- (key, self.settings['operation_id'])
- )
- # only throw this nullable ApiValueError if _check_input_type
- # is False, if _check_input_type==True we catch this case
- # in self.__validate_inputs
- if (key not in self.params_map['nullable'] and value is None
- and kwargs['_check_input_type'] is False):
- raise ApiValueError(
- "Value may not be None for non-nullable parameter `%s`"
- " when calling `%s`" %
- (key, self.settings['operation_id'])
- )
-
- for key in self.params_map['required']:
- if key not in kwargs.keys():
- raise ApiValueError(
- "Missing the required parameter `%s` when calling "
- "`%s`" % (key, self.settings['operation_id'])
- )
-
- self.__validate_inputs(kwargs)
-
- params = self.__gather_params(kwargs)
-
- accept_headers_list = self.headers_map['accept']
- if accept_headers_list:
- params['header']['Accept'] = self.api_client.select_header_accept(
- accept_headers_list)
-
- content_type_headers_list = self.headers_map['content_type']
- if content_type_headers_list:
- header_list = self.api_client.select_header_content_type(
- content_type_headers_list)
- params['header']['Content-Type'] = header_list
-
- return self.api_client.call_api(
- self.settings['endpoint_path'], self.settings['http_method'],
- params['path'],
- params['query'],
- params['header'],
- body=params['body'],
- post_params=params['form'],
- files=params['file'],
- response_type=self.settings['response_type'],
- auth_settings=self.settings['auth'],
- async_req=kwargs['async_req'],
- _check_type=kwargs['_check_return_type'],
- _return_http_data_only=kwargs['_return_http_data_only'],
- _preload_content=kwargs['_preload_content'],
- _request_timeout=kwargs['_request_timeout'],
- _host=_host,
- collection_formats=params['collection_format'])
diff --git a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py
deleted file mode 100644
index fcd25ce643ca..000000000000
--- a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-
-# import all models into this package
-# if you have many models here with many references from one model to another this may
-# raise a RecursionError
-# to avoid this, import only the models that you directly need like:
-# from from petstore_api.model.pet import Pet
-# or import this package, but before doing it, use:
-# import sys
-# sys.setrecursionlimit(n)
-
-from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType
-from petstore_api.model.additional_properties_array import AdditionalPropertiesArray
-from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean
-from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
-from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger
-from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber
-from petstore_api.model.additional_properties_object import AdditionalPropertiesObject
-from petstore_api.model.additional_properties_string import AdditionalPropertiesString
-from petstore_api.model.animal import Animal
-from petstore_api.model.animal_farm import AnimalFarm
-from petstore_api.model.api_response import ApiResponse
-from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
-from petstore_api.model.array_test import ArrayTest
-from petstore_api.model.capitalization import Capitalization
-from petstore_api.model.cat import Cat
-from petstore_api.model.cat_all_of import CatAllOf
-from petstore_api.model.category import Category
-from petstore_api.model.child import Child
-from petstore_api.model.child_all_of import ChildAllOf
-from petstore_api.model.child_cat import ChildCat
-from petstore_api.model.child_cat_all_of import ChildCatAllOf
-from petstore_api.model.child_dog import ChildDog
-from petstore_api.model.child_dog_all_of import ChildDogAllOf
-from petstore_api.model.child_lizard import ChildLizard
-from petstore_api.model.child_lizard_all_of import ChildLizardAllOf
-from petstore_api.model.class_model import ClassModel
-from petstore_api.model.client import Client
-from petstore_api.model.dog import Dog
-from petstore_api.model.dog_all_of import DogAllOf
-from petstore_api.model.enum_arrays import EnumArrays
-from petstore_api.model.enum_class import EnumClass
-from petstore_api.model.enum_test import EnumTest
-from petstore_api.model.file import File
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
-from petstore_api.model.format_test import FormatTest
-from petstore_api.model.grandparent import Grandparent
-from petstore_api.model.grandparent_animal import GrandparentAnimal
-from petstore_api.model.has_only_read_only import HasOnlyReadOnly
-from petstore_api.model.list import List
-from petstore_api.model.map_test import MapTest
-from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-from petstore_api.model.model200_response import Model200Response
-from petstore_api.model.model_return import ModelReturn
-from petstore_api.model.name import Name
-from petstore_api.model.number_only import NumberOnly
-from petstore_api.model.number_with_validations import NumberWithValidations
-from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
-from petstore_api.model.order import Order
-from petstore_api.model.parent import Parent
-from petstore_api.model.parent_all_of import ParentAllOf
-from petstore_api.model.parent_pet import ParentPet
-from petstore_api.model.pet import Pet
-from petstore_api.model.player import Player
-from petstore_api.model.read_only_first import ReadOnlyFirst
-from petstore_api.model.special_model_name import SpecialModelName
-from petstore_api.model.string_boolean_map import StringBooleanMap
-from petstore_api.model.string_enum import StringEnum
-from petstore_api.model.tag import Tag
-from petstore_api.model.type_holder_default import TypeHolderDefault
-from petstore_api.model.type_holder_example import TypeHolderExample
-from petstore_api.model.user import User
-from petstore_api.model.xml_item import XmlItem
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py
deleted file mode 100644
index f63ca82f6c22..000000000000
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_array import AdditionalPropertiesArray
-
-
-class TestAdditionalPropertiesArray(unittest.TestCase):
- """AdditionalPropertiesArray unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesArray(self):
- """Test AdditionalPropertiesArray"""
- # can make model without additional properties
- model = AdditionalPropertiesArray()
-
- # can make one with additional properties
- import datetime
- some_val = []
- model = AdditionalPropertiesArray(some_key=some_val)
- assert model['some_key'] == some_val
- some_val = [True, datetime.date(1970,1,1), datetime.datetime(1970,1,1), {}, 3.1, 1, [], 'hello']
- model = AdditionalPropertiesArray(some_key=some_val)
- assert model['some_key'] == some_val
-
- # type checking works on additional properties
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- model = AdditionalPropertiesArray(some_key='some string')
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py
deleted file mode 100644
index e5a13891c098..000000000000
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean
-
-
-class TestAdditionalPropertiesBoolean(unittest.TestCase):
- """AdditionalPropertiesBoolean unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesBoolean(self):
- """Test AdditionalPropertiesBoolean"""
- # can make model without additional properties
- model = AdditionalPropertiesBoolean()
-
- # can make one with additional properties
- model = AdditionalPropertiesBoolean(some_key=True)
- assert model['some_key'] == True
-
- # type checking works on additional properties
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- model = AdditionalPropertiesBoolean(some_key='True')
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py
deleted file mode 100644
index 0e08b8f87706..000000000000
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger
-
-
-class TestAdditionalPropertiesInteger(unittest.TestCase):
- """AdditionalPropertiesInteger unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesInteger(self):
- """Test AdditionalPropertiesInteger"""
- # can make model without additional properties
- model = AdditionalPropertiesInteger()
-
- # can make one with additional properties
- model = AdditionalPropertiesInteger(some_key=3)
- assert model['some_key'] == 3
-
- # type checking works on additional properties
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- model = AdditionalPropertiesInteger(some_key=11.3)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py
deleted file mode 100644
index 90f4429e989f..000000000000
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber
-
-
-class TestAdditionalPropertiesNumber(unittest.TestCase):
- """AdditionalPropertiesNumber unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesNumber(self):
- """Test AdditionalPropertiesNumber"""
- # can make model without additional properties
- model = AdditionalPropertiesNumber()
-
- # can make one with additional properties
- model = AdditionalPropertiesNumber(some_key=11.3)
- assert model['some_key'] == 11.3
-
- # type checking works on additional properties
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- model = AdditionalPropertiesNumber(some_key=10)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py
deleted file mode 100644
index ded4a8e8a124..000000000000
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_object import AdditionalPropertiesObject
-
-
-class TestAdditionalPropertiesObject(unittest.TestCase):
- """AdditionalPropertiesObject unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesObject(self):
- """Test AdditionalPropertiesObject"""
- # can make model without additional properties
- model = AdditionalPropertiesObject()
-
- # can make one with additional properties
- some_val = {}
- model = AdditionalPropertiesObject(some_key=some_val)
- assert model['some_key'] == some_val
- import datetime
- some_val = {'a': True, 'b': datetime.date(1970,1,1), 'c': datetime.datetime(1970,1,1), 'd': {}, 'e': 3.1, 'f': 1, 'g': [], 'h': 'hello'}
- model = AdditionalPropertiesObject(some_key=some_val)
- assert model['some_key'] == some_val
-
- # type checking works on additional properties
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- model = AdditionalPropertiesObject(some_key='some string')
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py
deleted file mode 100644
index cff2c31921fe..000000000000
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_string import AdditionalPropertiesString
-
-
-class TestAdditionalPropertiesString(unittest.TestCase):
- """AdditionalPropertiesString unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesString(self):
- """Test AdditionalPropertiesString"""
- # can make model without additional properties
- model = AdditionalPropertiesString()
-
- # can make one with additional properties
- model = AdditionalPropertiesString(some_key='some_val')
- assert model['some_key'] == 'some_val'
-
- # type checking works on additional properties
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- model = AdditionalPropertiesString(some_key=True)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_animal.py b/samples/client/petstore/python-experimental/test/test_animal.py
deleted file mode 100644
index 958f303f13e3..000000000000
--- a/samples/client/petstore/python-experimental/test/test_animal.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import cat
-except ImportError:
- cat = sys.modules[
- 'petstore_api.model.cat']
-try:
- from petstore_api.model import dog
-except ImportError:
- dog = sys.modules[
- 'petstore_api.model.dog']
-from petstore_api.model.animal import Animal
-
-
-class TestAnimal(unittest.TestCase):
- """Animal unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAnimal(self):
- """Test Animal"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Animal() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-experimental/test/test_array_test.py
deleted file mode 100644
index 2426b27b7e46..000000000000
--- a/samples/client/petstore/python-experimental/test/test_array_test.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import read_only_first
-except ImportError:
- read_only_first = sys.modules[
- 'petstore_api.model.read_only_first']
-from petstore_api.model.array_test import ArrayTest
-
-
-class TestArrayTest(unittest.TestCase):
- """ArrayTest unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testArrayTest(self):
- """Test ArrayTest"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ArrayTest() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_cat.py b/samples/client/petstore/python-experimental/test/test_cat.py
deleted file mode 100644
index 64b525aaf118..000000000000
--- a/samples/client/petstore/python-experimental/test/test_cat.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import animal
-except ImportError:
- animal = sys.modules[
- 'petstore_api.model.animal']
-try:
- from petstore_api.model import cat_all_of
-except ImportError:
- cat_all_of = sys.modules[
- 'petstore_api.model.cat_all_of']
-from petstore_api.model.cat import Cat
-
-
-class TestCat(unittest.TestCase):
- """Cat unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testCat(self):
- """Test Cat"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Cat() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_category.py b/samples/client/petstore/python-experimental/test/test_category.py
deleted file mode 100644
index 59b64e5924a8..000000000000
--- a/samples/client/petstore/python-experimental/test/test_category.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.category import Category
-
-
-class TestCategory(unittest.TestCase):
- """Category unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testCategory(self):
- """Test Category"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Category() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_dog.py b/samples/client/petstore/python-experimental/test/test_dog.py
deleted file mode 100644
index 0b95c0a4c83a..000000000000
--- a/samples/client/petstore/python-experimental/test/test_dog.py
+++ /dev/null
@@ -1,151 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import animal
-except ImportError:
- animal = sys.modules[
- 'petstore_api.model.animal']
-try:
- from petstore_api.model import dog_all_of
-except ImportError:
- dog_all_of = sys.modules[
- 'petstore_api.model.dog_all_of']
-from petstore_api.model.dog import Dog
-
-
-class TestDog(unittest.TestCase):
- """Dog unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testDog(self):
- """Test Dog"""
-
- # make an instance of dog, a composed schema model
- class_name = 'Dog'
- color = 'white'
- breed = 'Jack Russel Terrier'
- dog = Dog(
- class_name=class_name,
- color=color,
- breed=breed
- )
-
- # check its properties
- self.assertEqual(dog.class_name, class_name)
- self.assertEqual(dog.color, color)
- self.assertEqual(dog.breed, breed)
- # access them with keys
- self.assertEqual(dog['class_name'], class_name)
- self.assertEqual(dog['color'], color)
- self.assertEqual(dog['breed'], breed)
- # access them with getattr
- self.assertEqual(getattr(dog, 'class_name'), class_name)
- self.assertEqual(getattr(dog, 'color'), color)
- self.assertEqual(getattr(dog, 'breed'), breed)
-
- # check the model's to_dict result
- self.assertEqual(
- dog.to_dict(),
- {
- 'class_name': class_name,
- 'color': color,
- 'breed': breed,
- }
- )
-
- # setting a value that doesn't exist raises an exception
- # with a key
- with self.assertRaises(AttributeError):
- dog['invalid_variable'] = 'some value'
- # with setattr
- with self.assertRaises(AttributeError):
- setattr(dog, 'invalid_variable', 'some value')
-
- # getting a value that doesn't exist raises an exception
- # with a key
- with self.assertRaises(AttributeError):
- invalid_variable = dog['invalid_variable']
- # with getattr
- self.assertEqual(getattr(dog, 'invalid_variable', 'some value'), 'some value')
-
- with self.assertRaises(AttributeError):
- invalid_variable = getattr(dog, 'invalid_variable')
-
- # make sure that the ModelComposed class properties are correct
- # model.composed_schemas() stores the anyOf/allOf/oneOf info
- self.assertEqual(
- dog._composed_schemas,
- {
- 'anyOf': [],
- 'allOf': [
- animal.Animal,
- dog_all_of.DogAllOf,
- ],
- 'oneOf': [],
- }
- )
- # model._composed_instances is a list of the instances that were
- # made from the anyOf/allOf/OneOf classes in model._composed_schemas()
- for composed_instance in dog._composed_instances:
- if composed_instance.__class__ == animal.Animal:
- animal_instance = composed_instance
- elif composed_instance.__class__ == dog_all_of.DogAllOf:
- dog_allof_instance = composed_instance
- self.assertEqual(
- dog._composed_instances,
- [animal_instance, dog_allof_instance]
- )
- # model._var_name_to_model_instances maps the variable name to the
- # model instances which store that variable
- self.assertEqual(
- dog._var_name_to_model_instances,
- {
- 'breed': [dog, dog_allof_instance],
- 'class_name': [dog, animal_instance],
- 'color': [dog, animal_instance]
- }
- )
- # model._additional_properties_model_instances stores a list of
- # models which have the property additional_properties_type != None
- self.assertEqual(
- dog._additional_properties_model_instances, []
- )
-
- # if we modify one of the properties owned by multiple
- # model_instances we get an exception when we try to access that
- # property because the retrieved values are not all the same
- dog_allof_instance.breed = 'Golden Retriever'
- with self.assertRaises(petstore_api.ApiValueError):
- breed = dog.breed
-
- # including extra parameters raises an exception
- with self.assertRaises(petstore_api.ApiValueError):
- dog = Dog(
- class_name=class_name,
- color=color,
- breed=breed,
- unknown_property='some value'
- )
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-experimental/test/test_enum_arrays.py
deleted file mode 100644
index 64ad5fd7dc08..000000000000
--- a/samples/client/petstore/python-experimental/test/test_enum_arrays.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.enum_arrays import EnumArrays
-
-
-class TestEnumArrays(unittest.TestCase):
- """EnumArrays unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def test_enumarrays_init(self):
- #
- # Check various combinations of valid values.
- #
- fish_or_crab = EnumArrays(just_symbol=">=")
- self.assertEqual(fish_or_crab.just_symbol, ">=")
- # if optional property is unset we raise an exception
- with self.assertRaises(petstore_api.ApiAttributeError) as exc:
- self.assertEqual(fish_or_crab.array_enum, None)
-
- fish_or_crab = EnumArrays(just_symbol="$", array_enum=["fish"])
- self.assertEqual(fish_or_crab.just_symbol, "$")
- self.assertEqual(fish_or_crab.array_enum, ["fish"])
-
- fish_or_crab = EnumArrays(just_symbol=">=", array_enum=["fish"])
- self.assertEqual(fish_or_crab.just_symbol, ">=")
- self.assertEqual(fish_or_crab.array_enum, ["fish"])
-
- fish_or_crab = EnumArrays(just_symbol="$", array_enum=["crab"])
- self.assertEqual(fish_or_crab.just_symbol, "$")
- self.assertEqual(fish_or_crab.array_enum, ["crab"])
-
-
- #
- # Check if setting invalid values fails
- #
- with self.assertRaises(petstore_api.ApiValueError) as exc:
- fish_or_crab = EnumArrays(just_symbol="<=")
-
- with self.assertRaises(petstore_api.ApiValueError) as exc:
- fish_or_crab = EnumArrays(just_symbol="$", array_enum=["dog"])
-
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- fish_or_crab = EnumArrays(just_symbol=["$"], array_enum=["crab"])
-
-
- def test_enumarrays_setter(self):
-
- #
- # Check various combinations of valid values
- #
- fish_or_crab = EnumArrays()
-
- fish_or_crab.just_symbol = ">="
- self.assertEqual(fish_or_crab.just_symbol, ">=")
-
- fish_or_crab.just_symbol = "$"
- self.assertEqual(fish_or_crab.just_symbol, "$")
-
- fish_or_crab.array_enum = []
- self.assertEqual(fish_or_crab.array_enum, [])
-
- fish_or_crab.array_enum = ["fish"]
- self.assertEqual(fish_or_crab.array_enum, ["fish"])
-
- fish_or_crab.array_enum = ["fish", "fish", "fish"]
- self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"])
-
- fish_or_crab.array_enum = ["crab"]
- self.assertEqual(fish_or_crab.array_enum, ["crab"])
-
- fish_or_crab.array_enum = ["crab", "fish"]
- self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"])
-
- fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"]
- self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"])
-
- #
- # Check if setting invalid values fails
- #
- fish_or_crab = EnumArrays()
- with self.assertRaises(petstore_api.ApiValueError) as exc:
- fish_or_crab.just_symbol = "!="
-
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- fish_or_crab.just_symbol = ["fish"]
-
- with self.assertRaises(petstore_api.ApiValueError) as exc:
- fish_or_crab.array_enum = ["cat"]
-
- with self.assertRaises(petstore_api.ApiValueError) as exc:
- fish_or_crab.array_enum = ["fish", "crab", "dog"]
-
- with self.assertRaises(petstore_api.ApiTypeError) as exc:
- fish_or_crab.array_enum = "fish"
-
-
- def test_todict(self):
- #
- # Check if dictionary serialization works
- #
- dollar_fish_crab_dict = {
- 'just_symbol': "$",
- 'array_enum': ["fish", "crab"]
- }
-
- dollar_fish_crab = EnumArrays(
- just_symbol="$", array_enum=["fish", "crab"])
-
- self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict())
-
- #
- # Sanity check for different arrays
- #
- dollar_crab_fish_dict = {
- 'just_symbol': "$",
- 'array_enum': ["crab", "fish"]
- }
-
- dollar_fish_crab = EnumArrays(
- just_symbol="$", array_enum=["fish", "crab"])
-
- self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict())
-
-
- def test_equals(self):
- #
- # Check if object comparison works
- #
- fish1 = EnumArrays(just_symbol="$", array_enum=["fish"])
- fish2 = EnumArrays(just_symbol="$", array_enum=["fish"])
- self.assertEqual(fish1, fish2)
-
- fish = EnumArrays(just_symbol="$", array_enum=["fish"])
- crab = EnumArrays(just_symbol="$", array_enum=["crab"])
- self.assertNotEqual(fish, crab)
-
- dollar = EnumArrays(just_symbol="$")
- greater = EnumArrays(just_symbol=">=")
- self.assertNotEqual(dollar, greater)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_enum_class.py b/samples/client/petstore/python-experimental/test/test_enum_class.py
deleted file mode 100644
index f910231c9d02..000000000000
--- a/samples/client/petstore/python-experimental/test/test_enum_class.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.enum_class import EnumClass
-
-
-class TestEnumClass(unittest.TestCase):
- """EnumClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testEnumClass(self):
- """Test EnumClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = EnumClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py
deleted file mode 100644
index 34d207f3c71d..000000000000
--- a/samples/client/petstore/python-experimental/test/test_fake_api.py
+++ /dev/null
@@ -1,197 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-
-import unittest
-
-import petstore_api
-from petstore_api.api.fake_api import FakeApi # noqa: E501
-
-
-class TestFakeApi(unittest.TestCase):
- """FakeApi unit test stubs"""
-
- def setUp(self):
- self.api = FakeApi() # noqa: E501
-
- def tearDown(self):
- pass
-
- def test_create_xml_item(self):
- """Test case for create_xml_item
-
- creates an XmlItem # noqa: E501
- """
- pass
-
- def test_boolean(self):
- """Test case for boolean
-
- """
- endpoint = self.api.boolean
- assert endpoint.openapi_types['body'] == (bool,)
- assert endpoint.settings['response_type'] == (bool,)
-
- def test_string(self):
- """Test case for string
-
- """
- endpoint = self.api.string
- assert endpoint.openapi_types['body'] == (str,)
- assert endpoint.settings['response_type'] == (str,)
-
- def test_object_model_with_ref_props(self):
- """Test case for object_model_with_ref_props
-
- """
- from petstore_api.model import object_model_with_ref_props
- endpoint = self.api.object_model_with_ref_props
- assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,)
- assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,)
-
- def test_string_enum(self):
- """Test case for string_enum
-
- """
- from petstore_api.model import string_enum
- endpoint = self.api.string_enum
- assert endpoint.openapi_types['body'] == (string_enum.StringEnum,)
- assert endpoint.settings['response_type'] == (string_enum.StringEnum,)
-
- def test_array_model(self):
- """Test case for array_model
-
- """
- from petstore_api.model import animal_farm
- endpoint = self.api.array_model
- assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,)
- assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,)
-
- def test_number_with_validations(self):
- """Test case for number_with_validations
-
- """
- from petstore_api.model import number_with_validations
- endpoint = self.api.number_with_validations
- assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,)
- assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,)
-
- def test_test_body_with_file_schema(self):
- """Test case for test_body_with_file_schema
-
- """
- pass
-
- def test_test_body_with_query_params(self):
- """Test case for test_body_with_query_params
-
- """
- pass
-
- def test_test_client_model(self):
- """Test case for test_client_model
-
- To test \"client\" model # noqa: E501
- """
- pass
-
- def test_test_endpoint_enums_length_one(self):
- """Test case for test_endpoint_enums_length_one
-
- """
- # when we omit the required enums of length one, they are still set
- endpoint = self.api.test_endpoint_enums_length_one
- import six
- if six.PY3:
- from unittest.mock import patch
- else:
- from mock import patch
- with patch.object(endpoint, 'call_with_http_info') as call_with_http_info:
- endpoint()
- call_with_http_info.assert_called_with(
- _check_input_type=True,
- _check_return_type=True,
- _host_index=None,
- _preload_content=True,
- _request_timeout=None,
- _return_http_data_only=True,
- async_req=False,
- header_number=1.234,
- path_integer=34,
- path_string='hello',
- query_integer=3,
- query_string='brillig'
- )
-
- def test_test_endpoint_parameters(self):
- """Test case for test_endpoint_parameters
-
- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
- """
- # check that we can access the endpoint's validations
- endpoint = self.api.test_endpoint_parameters
- assert endpoint.validations[('number',)] == {
- 'inclusive_maximum': 543.2,
- 'inclusive_minimum': 32.1,
- }
- # make sure that an exception is thrown on an invalid value
- keyword_args = dict(
- number=544, # invalid
- double=100,
- pattern_without_delimiter="abc",
- byte='sample string'
- )
- with self.assertRaises(petstore_api.ApiValueError):
- self.api.test_endpoint_parameters(**keyword_args)
-
- def test_test_enum_parameters(self):
- """Test case for test_enum_parameters
-
- To test enum parameters # noqa: E501
- """
- # check that we can access the endpoint's allowed_values
- endpoint = self.api.test_enum_parameters
- assert endpoint.allowed_values[('enum_query_string',)] == {
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- }
- # make sure that an exception is thrown on an invalid value
- keyword_args = dict(enum_query_string="bad value")
- with self.assertRaises(petstore_api.ApiValueError):
- self.api.test_enum_parameters(**keyword_args)
-
- def test_test_group_parameters(self):
- """Test case for test_group_parameters
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- """
- pass
-
- def test_test_inline_additional_properties(self):
- """Test case for test_inline_additional_properties
-
- test inline additionalProperties # noqa: E501
- """
- pass
-
- def test_test_json_form_data(self):
- """Test case for test_json_form_data
-
- test json serialization of form data # noqa: E501
- """
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_file.py b/samples/client/petstore/python-experimental/test/test_file.py
deleted file mode 100644
index 8d60f64e01cc..000000000000
--- a/samples/client/petstore/python-experimental/test/test_file.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.file import File
-
-
-class TestFile(unittest.TestCase):
- """File unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testFile(self):
- """Test File"""
- # FIXME: construct object with mandatory attributes with example values
- # model = File() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py
deleted file mode 100644
index 9a4f6d38dfef..000000000000
--- a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import file
-except ImportError:
- file = sys.modules[
- 'petstore_api.model.file']
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
-
-
-class TestFileSchemaTestClass(unittest.TestCase):
- """FileSchemaTestClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testFileSchemaTestClass(self):
- """Test FileSchemaTestClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = FileSchemaTestClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py
deleted file mode 100644
index ca37b005fd96..000000000000
--- a/samples/client/petstore/python-experimental/test/test_format_test.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.format_test import FormatTest
-
-
-class TestFormatTest(unittest.TestCase):
- """FormatTest unit test stubs"""
-
- def setUp(self):
- import datetime
- self.required_named_args = dict(
- number=40.1,
- byte='what',
- date=datetime.date(2019, 3, 23),
- password='rainbowtable'
- )
-
- def test_integer(self):
- var_name = 'integer'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
- for key, adder in key_adder_pairs:
- # value outside the bounds throws an error
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = validations[key] + adder
- FormatTest(**keyword_args)
-
- # value inside the bounds works
- keyword_args[var_name] = validations[key]
- assert (getattr(FormatTest(**keyword_args), var_name) ==
- validations[key])
-
- def test_int32(self):
- var_name = 'int32'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
- for key, adder in key_adder_pairs:
- # value outside the bounds throws an error
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = validations[key] + adder
- FormatTest(**keyword_args)
-
- # value inside the bounds works
- keyword_args[var_name] = validations[key]
- assert (getattr(FormatTest(**keyword_args), var_name) ==
- validations[key])
-
- def test_number(self):
- var_name = 'number'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
- for key, adder in key_adder_pairs:
- # value outside the bounds throws an error
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = validations[key] + adder
- FormatTest(**keyword_args)
-
- # value inside the bounds works
- keyword_args[var_name] = validations[key]
- assert (getattr(FormatTest(**keyword_args), var_name) ==
- validations[key])
-
- def test_float(self):
- var_name = 'float'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
- for key, adder in key_adder_pairs:
- # value outside the bounds throws an error
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = validations[key] + adder
- FormatTest(**keyword_args)
-
- # value inside the bounds works
- keyword_args[var_name] = validations[key]
- assert (getattr(FormatTest(**keyword_args), var_name) ==
- validations[key])
-
- def test_double(self):
- var_name = 'double'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
- for key, adder in key_adder_pairs:
- # value outside the bounds throws an error
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = validations[key] + adder
- FormatTest(**keyword_args)
-
- # value inside the bounds works
- keyword_args[var_name] = validations[key]
- assert (getattr(FormatTest(**keyword_args), var_name) ==
- validations[key])
-
- def test_password(self):
- var_name = 'password'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- key_adder_pairs = [('max_length', 1), ('min_length', -1)]
- for key, adder in key_adder_pairs:
- # value outside the bounds throws an error
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = 'a'*(validations[key] + adder)
- FormatTest(**keyword_args)
-
- # value inside the bounds works
- keyword_args[var_name] = 'a'*validations[key]
- assert (getattr(FormatTest(**keyword_args), var_name) ==
- 'a'*validations[key])
-
- def test_string(self):
- var_name = 'string'
- validations = FormatTest.validations[(var_name,)]
- keyword_args = {}
- keyword_args.update(self.required_named_args)
- values_invalid = ['abc3', '1', '.', ' ', 'مرحبا', '']
- for value_invalid in values_invalid:
- # invalid values throw exceptions
- with self.assertRaises(petstore_api.ApiValueError):
- keyword_args[var_name] = value_invalid
- FormatTest(**keyword_args)
-
- # valid value works
- value_valid = 'abcdz'
- keyword_args[var_name] = value_valid
- assert getattr(FormatTest(**keyword_args), var_name) == value_valid
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_map_test.py b/samples/client/petstore/python-experimental/test/test_map_test.py
deleted file mode 100644
index 3feda0f688df..000000000000
--- a/samples/client/petstore/python-experimental/test/test_map_test.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import string_boolean_map
-except ImportError:
- string_boolean_map = sys.modules[
- 'petstore_api.model.string_boolean_map']
-from petstore_api.model.map_test import MapTest
-
-
-class TestMapTest(unittest.TestCase):
- """MapTest unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def test_maptest_init(self):
- #
- # Test MapTest construction with valid values
- #
- up_or_low_dict = {
- 'UPPER': "UP",
- 'lower': "low"
- }
- map_enum_test = MapTest(map_of_enum_string=up_or_low_dict)
-
- self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
-
- map_of_map_of_strings = {
- 'valueDict': up_or_low_dict
- }
- map_enum_test = MapTest(map_map_of_string=map_of_map_of_strings)
-
- self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
-
- #
- # Make sure that the init fails for invalid enum values
- #
- black_or_white_dict = {
- 'black': "UP",
- 'white': "low"
- }
- with self.assertRaises(petstore_api.ApiValueError):
- MapTest(map_of_enum_string=black_or_white_dict)
-
- def test_maptest_setter(self):
- #
- # Check with some valid values
- #
- map_enum_test = MapTest()
- up_or_low_dict = {
- 'UPPER': "UP",
- 'lower': "low"
- }
- map_enum_test.map_of_enum_string = up_or_low_dict
- self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
-
- #
- # Check if the setter fails for invalid enum values
- #
- map_enum_test = MapTest()
- black_or_white_dict = {
- 'black': "UP",
- 'white': "low"
- }
- with self.assertRaises(petstore_api.ApiValueError):
- map_enum_test.map_of_enum_string = black_or_white_dict
-
- def test_todict(self):
- #
- # Check dictionary serialization
- #
- map_enum_test = MapTest()
- up_or_low_dict = {
- 'UPPER': "UP",
- 'lower': "low"
- }
- map_of_map_of_strings = {
- 'valueDict': up_or_low_dict
- }
- indirect_map = string_boolean_map.StringBooleanMap(**{
- 'option1': True
- })
- direct_map = {
- 'option2': False
- }
- map_enum_test.map_of_enum_string = up_or_low_dict
- map_enum_test.map_map_of_string = map_of_map_of_strings
- map_enum_test.indirect_map = indirect_map
- map_enum_test.direct_map = direct_map
-
- self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
- self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
- self.assertEqual(map_enum_test.indirect_map, indirect_map)
- self.assertEqual(map_enum_test.direct_map, direct_map)
-
- expected_dict = {
- 'map_of_enum_string': up_or_low_dict,
- 'map_map_of_string': map_of_map_of_strings,
- 'indirect_map': indirect_map.to_dict(),
- 'direct_map': direct_map
- }
-
- self.assertEqual(map_enum_test.to_dict(), expected_dict)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py
deleted file mode 100644
index 4dcb5ad4268c..000000000000
--- a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import animal
-except ImportError:
- animal = sys.modules[
- 'petstore_api.model.animal']
-from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-
-
-class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
- """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testMixedPropertiesAndAdditionalPropertiesClass(self):
- """Test MixedPropertiesAndAdditionalPropertiesClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-experimental/test/test_order.py
deleted file mode 100644
index ee6988e28ccd..000000000000
--- a/samples/client/petstore/python-experimental/test/test_order.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.order import Order
-
-
-class TestOrder(unittest.TestCase):
- """Order unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testOrder(self):
- """Test Order"""
- order = Order()
- order.status = "placed"
- self.assertEqual("placed", order.status)
- with self.assertRaises(petstore_api.ApiValueError):
- order.status = "invalid"
-
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_pet.py b/samples/client/petstore/python-experimental/test/test_pet.py
deleted file mode 100644
index b072cff5e9ad..000000000000
--- a/samples/client/petstore/python-experimental/test/test_pet.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-import sys
-import unittest
-
-import petstore_api
-try:
- from petstore_api.model import category
-except ImportError:
- category = sys.modules[
- 'petstore_api.model.category']
-try:
- from petstore_api.models import tag
-except ImportError:
- tag = sys.modules[
- 'petstore_api.model.tag']
-from petstore_api.model.pet import Pet
-
-
-class TestPet(unittest.TestCase):
- """Pet unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def test_to_str(self):
- pet = Pet(name="test name", photo_urls=["string"])
- pet.id = 1
- pet.status = "available"
- cate = category.Category()
- cate.id = 1
- cate.name = "dog"
- pet.category = cate
- tag1 = tag.Tag()
- tag1.id = 1
- pet.tags = [tag1]
-
- data = ("{'category': {'id': 1, 'name': 'dog'},\n"
- " 'id': 1,\n"
- " 'name': 'test name',\n"
- " 'photo_urls': ['string'],\n"
- " 'status': 'available',\n"
- " 'tags': [{'id': 1}]}")
- self.assertEqual(data, pet.to_str())
-
- def test_equal(self):
- pet1 = Pet(name="test name", photo_urls=["string"])
- pet1.id = 1
- pet1.status = "available"
- cate1 = category.Category()
- cate1.id = 1
- cate1.name = "dog"
- tag1 = tag.Tag()
- tag1.id = 1
- pet1.tags = [tag1]
-
- pet2 = Pet(name="test name", photo_urls=["string"])
- pet2.id = 1
- pet2.status = "available"
- cate2 = category.Category()
- cate2.id = 1
- cate2.name = "dog"
- tag2 = tag.Tag()
- tag2.id = 1
- pet2.tags = [tag2]
-
- self.assertTrue(pet1 == pet2)
-
- # reset pet1 tags to empty array so that object comparison returns false
- pet1.tags = []
- self.assertFalse(pet1 == pet2)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py
deleted file mode 100644
index e9ef8951fa2d..000000000000
--- a/samples/client/petstore/python-experimental/tests/test_deserialization.py
+++ /dev/null
@@ -1,441 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-
-"""
-Run the tests.
-$ pip install nose (optional)
-$ cd OpenAPIPetstore-python
-$ nosetests -v
-"""
-from collections import namedtuple
-import json
-import os
-import time
-import unittest
-import datetime
-
-import six
-
-import petstore_api
-
-from petstore_api.exceptions import (
- ApiTypeError,
- ApiKeyError,
- ApiValueError,
-)
-from petstore_api.model import (
- enum_test,
- pet,
- animal,
- dog,
- parent_pet,
- child_lizard,
- category,
- string_enum,
- number_with_validations,
- string_boolean_map,
-)
-from petstore_api.model_utils import (
- file_type,
- model_to_dict,
-)
-
-from petstore_api.rest import RESTResponse
-
-MockResponse = namedtuple('MockResponse', 'data')
-
-class DeserializationTests(unittest.TestCase):
-
- def setUp(self):
- self.api_client = petstore_api.ApiClient()
- self.deserialize = self.api_client.deserialize
-
- def test_enum_test(self):
- """ deserialize dict(str, Enum_Test) """
- data = {
- 'enum_test': {
- "enum_string": "UPPER",
- "enum_string_required": "lower",
- "enum_integer": 1,
- "enum_number": 1.1,
- "stringEnum": "placed"
- }
- }
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response,
- ({str: (enum_test.EnumTest,)},), True)
- self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(
- isinstance(deserialized['enum_test'], enum_test.EnumTest))
- value = (
- string_enum.StringEnum.allowed_values[('value',)]["PLACED"])
- string_enum_val = string_enum.StringEnum(value)
- sample_instance = enum_test.EnumTest(
- enum_string="UPPER",
- enum_string_required="lower",
- enum_integer=1,
- enum_number=1.1,
- string_enum=string_enum_val
- )
- self.assertEqual(deserialized['enum_test'], sample_instance)
-
- def test_deserialize_dict_str_pet(self):
- """ deserialize dict(str, Pet) """
- data = {
- 'pet': {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
- },
- "name": "doggie",
- "photoUrls": [
- "string"
- ],
- "tags": [
- {
- "id": 0,
- "fullName": "string"
- }
- ],
- "status": "available"
- }
- }
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response,
- ({str: (pet.Pet,)},), True)
- self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(isinstance(deserialized['pet'], pet.Pet))
-
- def test_deserialize_dict_str_dog(self):
- """ deserialize dict(str, Dog), use discriminator"""
- data = {
- 'dog': {
- "className": "Dog",
- "color": "white",
- "breed": "Jack Russel Terrier"
- }
- }
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response,
- ({str: (animal.Animal,)},), True)
- self.assertTrue(isinstance(deserialized, dict))
- dog_inst = deserialized['dog']
- self.assertTrue(isinstance(dog_inst, dog.Dog))
- self.assertEqual(dog_inst.class_name, "Dog")
- self.assertEqual(dog_inst.color, "white")
- self.assertEqual(dog_inst.breed, "Jack Russel Terrier")
-
- def test_deserialize_lizard(self):
- """ deserialize ChildLizard, use discriminator"""
- data = {
- "pet_type": "ChildLizard",
- "lovesRocks": True
- }
- response = MockResponse(data=json.dumps(data))
-
- lizard = self.deserialize(response,
- (parent_pet.ParentPet,), True)
- self.assertTrue(isinstance(lizard, child_lizard.ChildLizard))
- self.assertEqual(lizard.pet_type, "ChildLizard")
- self.assertEqual(lizard.loves_rocks, True)
-
- def test_deserialize_dict_str_int(self):
- """ deserialize dict(str, int) """
- data = {
- 'integer': 1
- }
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response, ({str: (int,)},), True)
- self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(isinstance(deserialized['integer'], int))
-
- def test_deserialize_str(self):
- """ deserialize str """
- data = "test str"
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response, (str,), True)
- self.assertTrue(isinstance(deserialized, str))
-
- def test_deserialize_date(self):
- """ deserialize date """
- data = "1997-07-16"
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response, (datetime.date,), True)
- self.assertTrue(isinstance(deserialized, datetime.date))
-
- def test_deserialize_datetime(self):
- """ deserialize datetime """
- data = "1997-07-16T19:20:30.45+01:00"
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response, (datetime.datetime,), True)
- self.assertTrue(isinstance(deserialized, datetime.datetime))
-
- def test_deserialize_pet(self):
- """ deserialize pet """
- data = {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
- },
- "name": "doggie",
- "photoUrls": [
- "string"
- ],
- "tags": [
- {
- "id": 0,
- "fullName": "string"
- }
- ],
- "status": "available"
- }
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response, (pet.Pet,), True)
- self.assertTrue(isinstance(deserialized, pet.Pet))
- self.assertEqual(deserialized.id, 0)
- self.assertEqual(deserialized.name, "doggie")
- self.assertTrue(isinstance(deserialized.category, category.Category))
- self.assertEqual(deserialized.category.name, "string")
- self.assertTrue(isinstance(deserialized.tags, list))
- self.assertEqual(deserialized.tags[0].full_name, "string")
-
- def test_deserialize_list_of_pet(self):
- """ deserialize list[Pet] """
- data = [
- {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
- },
- "name": "doggie0",
- "photoUrls": [
- "string"
- ],
- "tags": [
- {
- "id": 0,
- "fullName": "string"
- }
- ],
- "status": "available"
- },
- {
- "id": 1,
- "category": {
- "id": 0,
- "name": "string"
- },
- "name": "doggie1",
- "photoUrls": [
- "string"
- ],
- "tags": [
- {
- "id": 0,
- "fullName": "string"
- }
- ],
- "status": "available"
- }]
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response,
- ([pet.Pet],), True)
- self.assertTrue(isinstance(deserialized, list))
- self.assertTrue(isinstance(deserialized[0], pet.Pet))
- self.assertEqual(deserialized[0].id, 0)
- self.assertEqual(deserialized[1].id, 1)
- self.assertEqual(deserialized[0].name, "doggie0")
- self.assertEqual(deserialized[1].name, "doggie1")
-
- def test_deserialize_nested_dict(self):
- """ deserialize dict(str, dict(str, int)) """
- data = {
- "foo": {
- "bar": 1
- }
- }
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response,
- ({str: ({str: (int,)},)},), True)
- self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(isinstance(deserialized["foo"], dict))
- self.assertTrue(isinstance(deserialized["foo"]["bar"], int))
-
- def test_deserialize_nested_list(self):
- """ deserialize list[list[str]] """
- data = [["foo"]]
- response = MockResponse(data=json.dumps(data))
-
- deserialized = self.deserialize(response, ([[str]],), True)
- self.assertTrue(isinstance(deserialized, list))
- self.assertTrue(isinstance(deserialized[0], list))
- self.assertTrue(isinstance(deserialized[0][0], str))
-
- def test_deserialize_none(self):
- """ deserialize None """
- response = MockResponse(data=json.dumps(None))
-
- error_msg = (
- "Invalid type for variable 'received_data'. Required value type is "
- "datetime and passed type was NoneType at ['received_data']"
- )
- with self.assertRaises(ApiTypeError) as exc:
- deserialized = self.deserialize(response, (datetime.datetime,), True)
- self.assertEqual(str(exc.exception), error_msg)
-
- def test_deserialize_OuterEnum(self):
- """ deserialize OuterEnum """
- # make sure that an exception is thrown on an invalid value
- with self.assertRaises(ApiValueError):
- self.deserialize(
- MockResponse(data=json.dumps("test str")),
- (string_enum.StringEnum,),
- True
- )
-
- # valid value works
- placed_str = (
- string_enum.StringEnum.allowed_values[('value',)]["PLACED"]
- )
- response = MockResponse(data=json.dumps(placed_str))
- deserialized = self.deserialize(response,
- (string_enum.StringEnum,), True)
- self.assertTrue(isinstance(deserialized, string_enum.StringEnum))
- self.assertTrue(deserialized.value == placed_str)
-
- def test_deserialize_NumberWithValidations(self):
- """ deserialize NumberWithValidations """
- # make sure that an exception is thrown on an invalid type value
- with self.assertRaises(ApiTypeError):
- deserialized = self.deserialize(
- MockResponse(data=json.dumps("test str")),
- (number_with_validations.NumberWithValidations,),
- True
- )
-
- # make sure that an exception is thrown on an invalid value
- with self.assertRaises(ApiValueError):
- deserialized = self.deserialize(
- MockResponse(data=json.dumps(21.0)),
- (number_with_validations.NumberWithValidations,),
- True
- )
-
- # valid value works
- number_val = 11.0
- response = MockResponse(data=json.dumps(number_val))
- number = self.deserialize(response,
- (number_with_validations.NumberWithValidations,), True)
- self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations))
- self.assertTrue(number.value == number_val)
-
- def test_deserialize_file(self):
- """Ensures that file deserialization works"""
- response_types_mixed = (file_type,)
-
- # sample from http://www.jtricks.com/download-text
- HTTPResponse = namedtuple(
- 'urllib3_response_HTTPResponse',
- ['status', 'reason', 'data', 'getheaders', 'getheader']
- )
- headers = {'Content-Disposition': 'attachment; filename=content.txt'}
- def get_headers():
- return headers
- def get_header(name, default=None):
- return headers.get(name, default)
- file_data = (
- "You are reading text file that was supposed to be downloaded\r\n"
- "to your hard disk. If your browser offered to save you the file,"
- "\r\nthen it handled the Content-Disposition header correctly."
- )
- http_response = HTTPResponse(
- status=200,
- reason='OK',
- data=file_data,
- getheaders=get_headers,
- getheader=get_header
- )
- # response which is deserialized to a file
- mock_response = RESTResponse(http_response)
- file_path = None
- try:
- file_object = self.deserialize(
- mock_response, response_types_mixed, True)
- self.assertTrue(isinstance(file_object, file_type))
- file_path = file_object.name
- self.assertFalse(file_object.closed)
- file_object.close()
- if six.PY3:
- file_data = file_data.encode('utf-8')
- with open(file_path, 'rb') as other_file_object:
- self.assertEqual(other_file_object.read(), file_data)
- finally:
- os.unlink(file_path)
-
- def test_deserialize_binary_to_str(self):
- """Ensures that bytes deserialization works"""
- response_types_mixed = (str,)
-
- # sample from http://www.jtricks.com/download-text
- HTTPResponse = namedtuple(
- 'urllib3_response_HTTPResponse',
- ['status', 'reason', 'data', 'getheaders', 'getheader']
- )
- headers = {}
- def get_headers():
- return headers
- def get_header(name, default=None):
- return headers.get(name, default)
- data = "str"
-
- http_response = HTTPResponse(
- status=200,
- reason='OK',
- data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data),
- getheaders=get_headers,
- getheader=get_header
- )
-
- mock_response = RESTResponse(http_response)
-
- result = self.deserialize(mock_response, response_types_mixed, True)
- self.assertEqual(isinstance(result, str), True)
- self.assertEqual(result, data)
-
- def test_deserialize_string_boolean_map(self):
- """
- Ensures that string boolean (additional properties)
- deserialization works
- """
- # make sure that an exception is thrown on an invalid type
- with self.assertRaises(ApiTypeError):
- deserialized = self.deserialize(
- MockResponse(data=json.dumps("test str")),
- (string_boolean_map.StringBooleanMap,),
- True
- )
-
- # valid value works
- item_val = {'some_key': True}
- response = MockResponse(data=json.dumps(item_val))
- model = string_boolean_map.StringBooleanMap(**item_val)
- deserialized = self.deserialize(response,
- (string_boolean_map.StringBooleanMap,), True)
- self.assertTrue(isinstance(deserialized, string_boolean_map.StringBooleanMap))
- self.assertTrue(deserialized['some_key'] == True)
- self.assertTrue(deserialized == model)
-
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitignore b/samples/client/petstore/python-legacy/.gitignore
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitignore
rename to samples/client/petstore/python-legacy/.gitignore
diff --git a/samples/client/petstore/python-legacy/.gitlab-ci.yml b/samples/client/petstore/python-legacy/.gitlab-ci.yml
new file mode 100644
index 000000000000..142ce3712ed0
--- /dev/null
+++ b/samples/client/petstore/python-legacy/.gitlab-ci.yml
@@ -0,0 +1,33 @@
+# ref: https://docs.gitlab.com/ee/ci/README.html
+
+stages:
+ - test
+
+.nosetest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov=petstore_api
+
+nosetest-2.7:
+ extends: .nosetest
+ image: python:2.7-alpine
+nosetest-3.3:
+ extends: .nosetest
+ image: python:3.3-alpine
+nosetest-3.4:
+ extends: .nosetest
+ image: python:3.4-alpine
+nosetest-3.5:
+ extends: .nosetest
+ image: python:3.5-alpine
+nosetest-3.6:
+ extends: .nosetest
+ image: python:3.6-alpine
+nosetest-3.7:
+ extends: .nosetest
+ image: python:3.7-alpine
+nosetest-3.8:
+ extends: .nosetest
+ image: python:3.8-alpine
diff --git a/samples/client/petstore/python-experimental/.openapi-generator-ignore b/samples/client/petstore/python-legacy/.openapi-generator-ignore
similarity index 100%
rename from samples/client/petstore/python-experimental/.openapi-generator-ignore
rename to samples/client/petstore/python-legacy/.openapi-generator-ignore
diff --git a/samples/client/petstore/python-legacy/.openapi-generator/FILES b/samples/client/petstore/python-legacy/.openapi-generator/FILES
new file mode 100644
index 000000000000..4beeb0e176e3
--- /dev/null
+++ b/samples/client/petstore/python-legacy/.openapi-generator/FILES
@@ -0,0 +1,126 @@
+.gitignore
+.gitlab-ci.yml
+.travis.yml
+README.md
+docs/AdditionalPropertiesAnyType.md
+docs/AdditionalPropertiesArray.md
+docs/AdditionalPropertiesBoolean.md
+docs/AdditionalPropertiesClass.md
+docs/AdditionalPropertiesInteger.md
+docs/AdditionalPropertiesNumber.md
+docs/AdditionalPropertiesObject.md
+docs/AdditionalPropertiesString.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/ApiResponse.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/BigCat.md
+docs/BigCatAllOf.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ClassModel.md
+docs/Client.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/File.md
+docs/FileSchemaTestClass.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/List.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NumberOnly.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/Pet.md
+docs/PetApi.md
+docs/ReadOnlyFirst.md
+docs/SpecialModelName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/TypeHolderDefault.md
+docs/TypeHolderExample.md
+docs/User.md
+docs/UserApi.md
+docs/XmlItem.md
+git_push.sh
+petstore_api/__init__.py
+petstore_api/api/__init__.py
+petstore_api/api/another_fake_api.py
+petstore_api/api/fake_api.py
+petstore_api/api/fake_classname_tags_123_api.py
+petstore_api/api/pet_api.py
+petstore_api/api/store_api.py
+petstore_api/api/user_api.py
+petstore_api/api_client.py
+petstore_api/configuration.py
+petstore_api/exceptions.py
+petstore_api/models/__init__.py
+petstore_api/models/additional_properties_any_type.py
+petstore_api/models/additional_properties_array.py
+petstore_api/models/additional_properties_boolean.py
+petstore_api/models/additional_properties_class.py
+petstore_api/models/additional_properties_integer.py
+petstore_api/models/additional_properties_number.py
+petstore_api/models/additional_properties_object.py
+petstore_api/models/additional_properties_string.py
+petstore_api/models/animal.py
+petstore_api/models/api_response.py
+petstore_api/models/array_of_array_of_number_only.py
+petstore_api/models/array_of_number_only.py
+petstore_api/models/array_test.py
+petstore_api/models/big_cat.py
+petstore_api/models/big_cat_all_of.py
+petstore_api/models/capitalization.py
+petstore_api/models/cat.py
+petstore_api/models/cat_all_of.py
+petstore_api/models/category.py
+petstore_api/models/class_model.py
+petstore_api/models/client.py
+petstore_api/models/dog.py
+petstore_api/models/dog_all_of.py
+petstore_api/models/enum_arrays.py
+petstore_api/models/enum_class.py
+petstore_api/models/enum_test.py
+petstore_api/models/file.py
+petstore_api/models/file_schema_test_class.py
+petstore_api/models/format_test.py
+petstore_api/models/has_only_read_only.py
+petstore_api/models/list.py
+petstore_api/models/map_test.py
+petstore_api/models/mixed_properties_and_additional_properties_class.py
+petstore_api/models/model200_response.py
+petstore_api/models/model_return.py
+petstore_api/models/name.py
+petstore_api/models/number_only.py
+petstore_api/models/order.py
+petstore_api/models/outer_composite.py
+petstore_api/models/outer_enum.py
+petstore_api/models/pet.py
+petstore_api/models/read_only_first.py
+petstore_api/models/special_model_name.py
+petstore_api/models/tag.py
+petstore_api/models/type_holder_default.py
+petstore_api/models/type_holder_example.py
+petstore_api/models/user.py
+petstore_api/models/xml_item.py
+petstore_api/rest.py
+requirements.txt
+setup.cfg
+setup.py
+test-requirements.txt
+test/__init__.py
+tox.ini
diff --git a/samples/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION
similarity index 100%
rename from samples/client/petstore/python-experimental/.openapi-generator/VERSION
rename to samples/client/petstore/python-legacy/.openapi-generator/VERSION
diff --git a/samples/client/petstore/python-experimental/.travis.yml b/samples/client/petstore/python-legacy/.travis.yml
similarity index 88%
rename from samples/client/petstore/python-experimental/.travis.yml
rename to samples/client/petstore/python-legacy/.travis.yml
index f931f0f74b96..fcd7e31c7ccf 100644
--- a/samples/client/petstore/python-experimental/.travis.yml
+++ b/samples/client/petstore/python-legacy/.travis.yml
@@ -1,6 +1,10 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
+ - "2.7"
+ - "3.2"
+ - "3.3"
+ - "3.4"
- "3.5"
- "3.6"
- "3.7"
diff --git a/samples/client/petstore/python-experimental/Makefile b/samples/client/petstore/python-legacy/Makefile
similarity index 78%
rename from samples/client/petstore/python-experimental/Makefile
rename to samples/client/petstore/python-legacy/Makefile
index a6bbba4a434f..ba5c5e73c63c 100644
--- a/samples/client/petstore/python-experimental/Makefile
+++ b/samples/client/petstore/python-legacy/Makefile
@@ -3,7 +3,7 @@
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
-VENV=venv
+VENV=.venv
clean:
rm -rf $(REQUIREMENTS_OUT)
@@ -15,4 +15,7 @@ clean:
find . -name "__pycache__" -delete
test: clean
- bash ./test_python.sh
+ bash ./test_python2.sh
+
+test-all: clean
+ bash ./test_python2_and_3.sh
diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-legacy/README.md
similarity index 77%
rename from samples/client/petstore/python-experimental/README.md
rename to samples/client/petstore/python-legacy/README.md
index f2d9ac0fdad5..8f9d03589bc7 100644
--- a/samples/client/petstore/python-experimental/README.md
+++ b/samples/client/petstore/python-legacy/README.md
@@ -5,11 +5,11 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen
+- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen
## Requirements.
-Python >= 3.5
+Python 2.7 and 3.4+
## Installation & Usage
### pip install
@@ -45,12 +45,13 @@ import petstore_api
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
+from __future__ import print_function
import time
import petstore_api
+from petstore_api.rest import ApiException
from pprint import pprint
-from petstore_api.api import another_fake_api
-from petstore_api.model.client import Client
+
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
@@ -62,17 +63,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = another_fake_api.AnotherFakeApi(api_client)
- body = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ body = petstore_api.Client() # Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+
```
## Documentation for API Endpoints
@@ -82,22 +82,20 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
-*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
-*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean |
*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
-*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
-*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
-*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
-*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
+*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
-*FakeApi* | [**test_endpoint_enums_length_one**](docs/FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} |
*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
@@ -133,23 +131,16 @@ Class | Method | HTTP request | Description
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
- [AdditionalPropertiesString](docs/AdditionalPropertiesString.md)
- [Animal](docs/Animal.md)
- - [AnimalFarm](docs/AnimalFarm.md)
- [ApiResponse](docs/ApiResponse.md)
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
+ - [BigCat](docs/BigCat.md)
+ - [BigCatAllOf](docs/BigCatAllOf.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [CatAllOf](docs/CatAllOf.md)
- [Category](docs/Category.md)
- - [Child](docs/Child.md)
- - [ChildAllOf](docs/ChildAllOf.md)
- - [ChildCat](docs/ChildCat.md)
- - [ChildCatAllOf](docs/ChildCatAllOf.md)
- - [ChildDog](docs/ChildDog.md)
- - [ChildDogAllOf](docs/ChildDogAllOf.md)
- - [ChildLizard](docs/ChildLizard.md)
- - [ChildLizardAllOf](docs/ChildLizardAllOf.md)
- [ClassModel](docs/ClassModel.md)
- [Client](docs/Client.md)
- [Dog](docs/Dog.md)
@@ -160,8 +151,6 @@ Class | Method | HTTP request | Description
- [File](docs/File.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [FormatTest](docs/FormatTest.md)
- - [Grandparent](docs/Grandparent.md)
- - [GrandparentAnimal](docs/GrandparentAnimal.md)
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [List](docs/List.md)
- [MapTest](docs/MapTest.md)
@@ -170,18 +159,12 @@ Class | Method | HTTP request | Description
- [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md)
- [NumberOnly](docs/NumberOnly.md)
- - [NumberWithValidations](docs/NumberWithValidations.md)
- - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md)
- [Order](docs/Order.md)
- - [Parent](docs/Parent.md)
- - [ParentAllOf](docs/ParentAllOf.md)
- - [ParentPet](docs/ParentPet.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
- [Pet](docs/Pet.md)
- - [Player](docs/Player.md)
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [SpecialModelName](docs/SpecialModelName.md)
- - [StringBooleanMap](docs/StringBooleanMap.md)
- - [StringEnum](docs/StringEnum.md)
- [Tag](docs/Tag.md)
- [TypeHolderDefault](docs/TypeHolderDefault.md)
- [TypeHolderExample](docs/TypeHolderExample.md)
@@ -226,22 +209,3 @@ Class | Method | HTTP request | Description
-## Notes for Large OpenAPI documents
-If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a
-RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
-
-Solution 1:
-Use specific imports for apis and models like:
-- `from petstore_api.api.default_api import DefaultApi`
-- `from petstore_api.model.pet import Pet`
-
-Solution 1:
-Before importing the package, adjust the maximum recursion limit as shown below:
-```
-import sys
-sys.setrecursionlimit(1500)
-import petstore_api
-from petstore_api.apis import *
-from petstore_api.models import *
-```
-
diff --git a/samples/client/petstore/python-experimental/dev-requirements.txt b/samples/client/petstore/python-legacy/dev-requirements.txt
similarity index 100%
rename from samples/client/petstore/python-experimental/dev-requirements.txt
rename to samples/client/petstore/python-legacy/dev-requirements.txt
diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md
new file mode 100644
index 000000000000..9843d35ab906
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md
@@ -0,0 +1,10 @@
+# AdditionalPropertiesAnyType
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md
new file mode 100644
index 000000000000..cfe09d91c726
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md
@@ -0,0 +1,10 @@
+# AdditionalPropertiesArray
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md
similarity index 75%
rename from samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md
rename to samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md
index f2567f064cfd..74f009554a7f 100644
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md
@@ -4,7 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
-**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
new file mode 100644
index 000000000000..eb3e0524de1a
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,20 @@
+# AdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_string** | **dict(str, str)** | | [optional]
+**map_number** | **dict(str, float)** | | [optional]
+**map_integer** | **dict(str, int)** | | [optional]
+**map_boolean** | **dict(str, bool)** | | [optional]
+**map_array_integer** | **dict(str, list[int])** | | [optional]
+**map_array_anytype** | **dict(str, list[object])** | | [optional]
+**map_map_string** | **dict(str, dict(str, str))** | | [optional]
+**map_map_anytype** | **dict(str, dict(str, object))** | | [optional]
+**anytype_1** | **object** | | [optional]
+**anytype_2** | **object** | | [optional]
+**anytype_3** | **object** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md
similarity index 75%
rename from samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md
rename to samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md
index fe0ba709c8ef..a3e58fd1b0bd 100644
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md
@@ -4,7 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
-**any string name** | **int** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md
new file mode 100644
index 000000000000..37eafe1ff031
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md
@@ -0,0 +1,10 @@
+# AdditionalPropertiesNumber
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md
new file mode 100644
index 000000000000..7f4d6713c758
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md
@@ -0,0 +1,10 @@
+# AdditionalPropertiesObject
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md
similarity index 75%
rename from samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md
rename to samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md
index bbe0b1cbbbb9..9317cfeee80b 100644
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md
@@ -4,7 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
-**any string name** | **str** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/Animal.md b/samples/client/petstore/python-legacy/docs/Animal.md
similarity index 76%
rename from samples/client/petstore/python-experimental/docs/Animal.md
rename to samples/client/petstore/python-legacy/docs/Animal.md
index 698dc711aeb9..7ed4ba541fa3 100644
--- a/samples/client/petstore/python-experimental/docs/Animal.md
+++ b/samples/client/petstore/python-legacy/docs/Animal.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
-**color** | **str** | | [optional] if omitted the server will use the default value of "red"
+**color** | **str** | | [optional] [default to 'red']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-legacy/docs/AnotherFakeApi.md
similarity index 81%
rename from samples/client/petstore/python-experimental/docs/AnotherFakeApi.md
rename to samples/client/petstore/python-legacy/docs/AnotherFakeApi.md
index 7bc6fba30a60..047c4ae6444b 100644
--- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md
+++ b/samples/client/petstore/python-legacy/docs/AnotherFakeApi.md
@@ -17,10 +17,10 @@ To test special tags and operation ID starting with number
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import another_fake_api
-from petstore_api.model.client import Client
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -32,17 +32,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = another_fake_api.AnotherFakeApi(api_client)
- body = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ body = petstore_api.Client() # Client | client model
- # example passing only required values which don't have defaults set
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
```
@@ -50,7 +47,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Client**](Client.md)| client model |
+ **body** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/ApiResponse.md b/samples/client/petstore/python-legacy/docs/ApiResponse.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ApiResponse.md
rename to samples/client/petstore/python-legacy/docs/ApiResponse.md
diff --git a/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md
similarity index 82%
rename from samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md
rename to samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md
index 1a68df0090bb..aa3988ab1679 100644
--- a/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md
+++ b/samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_array_number** | **[[float]]** | | [optional]
+**array_array_number** | **list[list[float]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md
similarity index 85%
rename from samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md
rename to samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md
index b8a760f56dc2..2c3de967aec6 100644
--- a/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md
+++ b/samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_number** | **[float]** | | [optional]
+**array_number** | **list[float]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/ArrayTest.md b/samples/client/petstore/python-legacy/docs/ArrayTest.md
similarity index 59%
rename from samples/client/petstore/python-experimental/docs/ArrayTest.md
rename to samples/client/petstore/python-legacy/docs/ArrayTest.md
index b94f23fd2271..6ab0d1378065 100644
--- a/samples/client/petstore/python-experimental/docs/ArrayTest.md
+++ b/samples/client/petstore/python-legacy/docs/ArrayTest.md
@@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_of_string** | **[str]** | | [optional]
-**array_array_of_integer** | **[[int]]** | | [optional]
-**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional]
+**array_of_string** | **list[str]** | | [optional]
+**array_array_of_integer** | **list[list[int]]** | | [optional]
+**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/BigCat.md b/samples/client/petstore/python-legacy/docs/BigCat.md
similarity index 100%
rename from samples/client/petstore/python/docs/BigCat.md
rename to samples/client/petstore/python-legacy/docs/BigCat.md
diff --git a/samples/client/petstore/python/docs/BigCatAllOf.md b/samples/client/petstore/python-legacy/docs/BigCatAllOf.md
similarity index 100%
rename from samples/client/petstore/python/docs/BigCatAllOf.md
rename to samples/client/petstore/python-legacy/docs/BigCatAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/Capitalization.md b/samples/client/petstore/python-legacy/docs/Capitalization.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Capitalization.md
rename to samples/client/petstore/python-legacy/docs/Capitalization.md
diff --git a/samples/client/petstore/python-legacy/docs/Cat.md b/samples/client/petstore/python-legacy/docs/Cat.md
new file mode 100644
index 000000000000..8d30565d014e
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/Cat.md
@@ -0,0 +1,10 @@
+# Cat
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-experimental/docs/CatAllOf.md b/samples/client/petstore/python-legacy/docs/CatAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/CatAllOf.md
rename to samples/client/petstore/python-legacy/docs/CatAllOf.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/client/petstore/python-legacy/docs/Category.md
similarity index 86%
rename from samples/openapi3/client/petstore/python-experimental/docs/Category.md
rename to samples/client/petstore/python-legacy/docs/Category.md
index 287225d66fd7..7e5c1e316499 100644
--- a/samples/openapi3/client/petstore/python-experimental/docs/Category.md
+++ b/samples/client/petstore/python-legacy/docs/Category.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | | defaults to "default-name"
**id** | **int** | | [optional]
+**name** | **str** | | [default to 'default-name']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/ClassModel.md b/samples/client/petstore/python-legacy/docs/ClassModel.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ClassModel.md
rename to samples/client/petstore/python-legacy/docs/ClassModel.md
diff --git a/samples/client/petstore/python-experimental/docs/Client.md b/samples/client/petstore/python-legacy/docs/Client.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Client.md
rename to samples/client/petstore/python-legacy/docs/Client.md
diff --git a/samples/client/petstore/python-legacy/docs/Dog.md b/samples/client/petstore/python-legacy/docs/Dog.md
new file mode 100644
index 000000000000..f727487975c4
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/Dog.md
@@ -0,0 +1,10 @@
+# Dog
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-experimental/docs/DogAllOf.md b/samples/client/petstore/python-legacy/docs/DogAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/DogAllOf.md
rename to samples/client/petstore/python-legacy/docs/DogAllOf.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/client/petstore/python-legacy/docs/EnumArrays.md
similarity index 87%
rename from samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md
rename to samples/client/petstore/python-legacy/docs/EnumArrays.md
index e0b5582e9d5b..e15a5f1fd049 100644
--- a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md
+++ b/samples/client/petstore/python-legacy/docs/EnumArrays.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**just_symbol** | **str** | | [optional]
-**array_enum** | **[str]** | | [optional]
+**array_enum** | **list[str]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-legacy/docs/EnumClass.md b/samples/client/petstore/python-legacy/docs/EnumClass.md
new file mode 100644
index 000000000000..67f017becd0c
--- /dev/null
+++ b/samples/client/petstore/python-legacy/docs/EnumClass.md
@@ -0,0 +1,9 @@
+# EnumClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/petstore/python-experimental/docs/EnumTest.md b/samples/client/petstore/python-legacy/docs/EnumTest.md
similarity index 87%
rename from samples/client/petstore/python-experimental/docs/EnumTest.md
rename to samples/client/petstore/python-legacy/docs/EnumTest.md
index 22dd3d5f48d8..c4c1630250ff 100644
--- a/samples/client/petstore/python-experimental/docs/EnumTest.md
+++ b/samples/client/petstore/python-legacy/docs/EnumTest.md
@@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**enum_string_required** | **str** | |
**enum_string** | **str** | | [optional]
+**enum_string_required** | **str** | |
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
-**string_enum** | [**StringEnum**](StringEnum.md) | | [optional]
+**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-legacy/docs/FakeApi.md
similarity index 57%
rename from samples/client/petstore/python-experimental/docs/FakeApi.md
rename to samples/client/petstore/python-legacy/docs/FakeApi.md
index b098d80fdd33..68a36b5f7525 100644
--- a/samples/client/petstore/python-experimental/docs/FakeApi.md
+++ b/samples/client/petstore/python-legacy/docs/FakeApi.md
@@ -4,151 +4,22 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
-[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean |
[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
-[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
-[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
-[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
-[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
+[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
-[**test_endpoint_enums_length_one**](FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} |
[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
-# **array_model**
-> AnimalFarm array_model()
-
-
-
-Test serialization of ArrayModel
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.animal_farm import AnimalFarm
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = AnimalFarm([
- Animal(),
- ]) # AnimalFarm | Input model (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- api_response = api_instance.array_model(body=body)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->array_model: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional]
-
-### Return type
-
-[**AnimalFarm**](AnimalFarm.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: */*
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Output model | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **boolean**
-> bool boolean()
-
-
-
-Test serialization of outer boolean types
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = True # bool | Input boolean as post body (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- api_response = api_instance.boolean(body=body)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->boolean: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | **bool**| Input boolean as post body | [optional]
-
-### Return type
-
-**bool**
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: */*
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Output boolean | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
# **create_xml_item**
> create_xml_item(xml_item)
@@ -159,10 +30,10 @@ this route creates an XmlItem
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.xml_item import XmlItem
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -174,62 +45,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- xml_item = XmlItem(
- attribute_string="string",
- attribute_number=1.234,
- attribute_integer=-2,
- attribute_boolean=True,
- wrapped_array=[
- 1,
- ],
- name_string="string",
- name_number=1.234,
- name_integer=-2,
- name_boolean=True,
- name_array=[
- 1,
- ],
- name_wrapped_array=[
- 1,
- ],
- prefix_string="string",
- prefix_number=1.234,
- prefix_integer=-2,
- prefix_boolean=True,
- prefix_array=[
- 1,
- ],
- prefix_wrapped_array=[
- 1,
- ],
- namespace_string="string",
- namespace_number=1.234,
- namespace_integer=-2,
- namespace_boolean=True,
- namespace_array=[
- 1,
- ],
- namespace_wrapped_array=[
- 1,
- ],
- prefix_ns_string="string",
- prefix_ns_number=1.234,
- prefix_ns_integer=-2,
- prefix_ns_boolean=True,
- prefix_ns_array=[
- 1,
- ],
- prefix_ns_wrapped_array=[
- 1,
- ],
- ) # XmlItem | XmlItem Body
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.FakeApi(api_client)
+ xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body
+
try:
# creates an XmlItem
api_instance.create_xml_item(xml_item)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->create_xml_item: %s\n" % e)
```
@@ -237,7 +59,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body |
+ **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body |
### Return type
@@ -259,20 +81,20 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **number_with_validations**
-> NumberWithValidations number_with_validations()
+# **fake_outer_boolean_serialize**
+> bool fake_outer_boolean_serialize(body=body)
-Test serialization of outer number types
+Test serialization of outer boolean types
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.number_with_validations import NumberWithValidations
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -284,27 +106,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = NumberWithValidations(1E+1) # NumberWithValidations | Input number as post body (optional)
+ api_instance = petstore_api.FakeApi(api_client)
+ body = True # bool | Input boolean as post body (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- api_response = api_instance.number_with_validations(body=body)
+ api_response = api_instance.fake_outer_boolean_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->number_with_validations: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional]
+ **body** | **bool**| Input boolean as post body | [optional]
### Return type
-[**NumberWithValidations**](NumberWithValidations.md)
+**bool**
### Authorization
@@ -318,24 +138,24 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output number | - |
+**200** | Output boolean | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **object_model_with_ref_props**
-> ObjectModelWithRefProps object_model_with_ref_props()
+# **fake_outer_composite_serialize**
+> OuterComposite fake_outer_composite_serialize(body=body)
-Test serialization of object with $refed properties
+Test serialization of object with outer number type
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -347,31 +167,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = ObjectModelWithRefProps(
- my_number=NumberWithValidations(1E+1),
- my_string="my_string_example",
- my_boolean=True,
- ) # ObjectModelWithRefProps | Input model (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
+ api_instance = petstore_api.FakeApi(api_client)
+ body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
+
try:
- api_response = api_instance.object_model_with_ref_props(body=body)
+ api_response = api_instance.fake_outer_composite_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional]
+ **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
-[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)
+[**OuterComposite**](OuterComposite.md)
### Authorization
@@ -385,23 +199,24 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output model | - |
+**200** | Output composite | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **string**
-> str string()
+# **fake_outer_number_serialize**
+> float fake_outer_number_serialize(body=body)
-Test serialization of outer string types
+Test serialization of outer number types
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -413,27 +228,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = "body_example" # str | Input string as post body (optional)
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 3.4 # float | Input number as post body (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- api_response = api_instance.string(body=body)
+ api_response = api_instance.fake_outer_number_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->string: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **str**| Input string as post body | [optional]
+ **body** | **float**| Input number as post body | [optional]
### Return type
-**str**
+**float**
### Authorization
@@ -447,24 +260,24 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output string | - |
+**200** | Output number | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **string_enum**
-> StringEnum string_enum()
+# **fake_outer_string_serialize**
+> str fake_outer_string_serialize(body=body)
-Test serialization of outer enum
+Test serialization of outer string types
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.string_enum import StringEnum
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -476,27 +289,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = StringEnum("placed") # StringEnum | Input enum (optional)
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | Input string as post body (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- api_response = api_instance.string_enum(body=body)
+ api_response = api_instance.fake_outer_string_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->string_enum: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional]
+ **body** | **str**| Input string as post body | [optional]
### Return type
-[**StringEnum**](StringEnum.md)
+**str**
### Authorization
@@ -510,7 +321,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output enum | - |
+**200** | Output string | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -524,10 +335,10 @@ For this test, the body for this request much reference a schema named `File`.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -539,22 +350,12 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = FileSchemaTestClass(
- file=File(
- source_uri="source_uri_example",
- ),
- files=[
- File(
- source_uri="source_uri_example",
- ),
- ],
- ) # FileSchemaTestClass |
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.FakeApi(api_client)
+ body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
+
try:
api_instance.test_body_with_file_schema(body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
@@ -562,7 +363,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+ **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
@@ -592,10 +393,10 @@ No authorization required
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -607,23 +408,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- query = "query_example" # str |
- body = User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- ) # User |
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.FakeApi(api_client)
+ query = 'query_example' # str |
+body = petstore_api.User() # User |
+
try:
api_instance.test_body_with_query_params(query, body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
@@ -631,8 +422,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **query** | **str**| |
- **body** | [**User**](User.md)| |
+ **query** | **str**| |
+ **body** | [**User**](User.md)| |
### Return type
@@ -664,10 +455,10 @@ To test \"client\" model
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.client import Client
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -679,17 +470,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.FakeApi(api_client)
+ body = petstore_api.Client() # Client | client model
- # example passing only required values which don't have defaults set
try:
# To test \"client\" model
api_response = api_instance.test_client_model(body)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
```
@@ -697,7 +485,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Client**](Client.md)| client model |
+ **body** | [**Client**](Client.md)| client model |
### Return type
@@ -719,71 +507,8 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **test_endpoint_enums_length_one**
-> test_endpoint_enums_length_one()
-
-
-
-This route has required values with enums of 1
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
-
- # example passing only required values which don't have defaults set
- try:
- api_instance.test_endpoint_enums_length_one()
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **query_integer** | **int**| | defaults to 3
- **query_string** | **str**| | defaults to "brillig"
- **path_string** | **str**| | defaults to "hello"
- **path_integer** | **int**| | defaults to 34
- **header_number** | **float**| | defaults to 1.234
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: Not defined
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Success | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
# **test_endpoint_parameters**
-> test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -793,9 +518,10 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ
* Basic Authentication (http_basic_test):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -817,35 +543,26 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- number = 32.1 # float | None
- double = 67.8 # float | None
- pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C" # str | None
- byte = 'YQ==' # str | None
- integer = 10 # int | None (optional)
- int32 = 20 # int | None (optional)
- int64 = 1 # int | None (optional)
- float = 3.14 # float | None (optional)
- string = "a" # str | None (optional)
- binary = open('/path/to/file', 'rb') # file_type | None (optional)
- date = dateutil_parser('1970-01-01').date() # date | None (optional)
- date_time = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | None (optional)
- password = "password_example" # str | None (optional)
- param_callback = "param_callback_example" # str | None (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+ api_instance = petstore_api.FakeApi(api_client)
+ number = 3.4 # float | None
+double = 3.4 # float | None
+pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
+byte = 'byte_example' # str | None
+integer = 56 # int | None (optional)
+int32 = 56 # int | None (optional)
+int64 = 56 # int | None (optional)
+float = 3.4 # float | None (optional)
+string = 'string_example' # str | None (optional)
+binary = '/path/to/file' # file | None (optional)
+date = '2013-10-20' # date | None (optional)
+date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
+password = 'password_example' # str | None (optional)
+param_callback = 'param_callback_example' # str | None (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
```
@@ -853,20 +570,20 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **number** | **float**| None |
- **double** | **float**| None |
- **pattern_without_delimiter** | **str**| None |
- **byte** | **str**| None |
- **integer** | **int**| None | [optional]
- **int32** | **int**| None | [optional]
- **int64** | **int**| None | [optional]
- **float** | **float**| None | [optional]
- **string** | **str**| None | [optional]
- **binary** | **file_type**| None | [optional]
- **date** | **date**| None | [optional]
- **date_time** | **datetime**| None | [optional]
- **password** | **str**| None | [optional]
- **param_callback** | **str**| None | [optional]
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **file**| None | [optional]
+ **date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
### Return type
@@ -890,7 +607,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_enum_parameters**
-> test_enum_parameters()
+> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
To test enum parameters
@@ -899,9 +616,10 @@ To test enum parameters
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -913,26 +631,20 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- enum_header_string_array = [
- "$",
- ] # [str] | Header parameter enum test (string array) (optional)
- enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
- enum_query_string_array = [
- "$",
- ] # [str] | Query parameter enum test (string array) (optional)
- enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
- enum_query_integer = 1 # int | Query parameter enum test (double) (optional)
- enum_query_double = 1.1 # float | Query parameter enum test (double) (optional)
- enum_form_string_array = "$" # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$"
- enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
-
- # example passing only required values which don't have defaults set
- # and optional values
+ api_instance = petstore_api.FakeApi(api_client)
+ enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional)
+enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg')
+enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional)
+enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg')
+enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
+enum_query_double = 3.4 # float | Query parameter enum test (double) (optional)
+enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$')
+enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg')
+
try:
# To test enum parameters
api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e)
```
@@ -940,14 +652,14 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional]
- **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
- **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional]
- **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
- **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
- **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
- **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$"
- **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+ **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional]
+ **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg']
+ **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional]
+ **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg']
+ **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
+ **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
+ **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$']
+ **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg']
### Return type
@@ -971,7 +683,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_group_parameters**
-> test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
Fake endpoint to test group parameters (optional)
@@ -980,9 +692,10 @@ Fake endpoint to test group parameters (optional)
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -994,27 +707,18 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- required_string_group = 1 # int | Required String in group parameters
- required_boolean_group = True # bool | Required Boolean in group parameters
- required_int64_group = 1 # int | Required Integer in group parameters
- string_group = 1 # int | String in group parameters (optional)
- boolean_group = True # bool | Boolean in group parameters (optional)
- int64_group = 1 # int | Integer in group parameters (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Fake endpoint to test group parameters (optional)
- api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+ api_instance = petstore_api.FakeApi(api_client)
+ required_string_group = 56 # int | Required String in group parameters
+required_boolean_group = True # bool | Required Boolean in group parameters
+required_int64_group = 56 # int | Required Integer in group parameters
+string_group = 56 # int | String in group parameters (optional)
+boolean_group = True # bool | Boolean in group parameters (optional)
+int64_group = 56 # int | Integer in group parameters (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# Fake endpoint to test group parameters (optional)
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
```
@@ -1022,12 +726,12 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **required_string_group** | **int**| Required String in group parameters |
- **required_boolean_group** | **bool**| Required Boolean in group parameters |
- **required_int64_group** | **int**| Required Integer in group parameters |
- **string_group** | **int**| String in group parameters | [optional]
- **boolean_group** | **bool**| Boolean in group parameters | [optional]
- **int64_group** | **int**| Integer in group parameters | [optional]
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
### Return type
@@ -1057,9 +761,10 @@ test inline additionalProperties
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1071,16 +776,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- param = {
- "key": "key_example",
- } # {str: (str,)} | request body
+ api_instance = petstore_api.FakeApi(api_client)
+ param = {'key': 'param_example'} # dict(str, str) | request body
- # example passing only required values which don't have defaults set
try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(param)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
@@ -1088,7 +790,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | **{str: (str,)}**| request body |
+ **param** | [**dict(str, str)**](str.md)| request body |
### Return type
@@ -1118,9 +820,10 @@ test json serialization of form data
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1132,15 +835,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- param = "param_example" # str | field1
- param2 = "param2_example" # str | field2
+ api_instance = petstore_api.FakeApi(api_client)
+ param = 'param_example' # str | field1
+param2 = 'param2_example' # str | field2
- # example passing only required values which don't have defaults set
try:
# test json serialization of form data
api_instance.test_json_form_data(param, param2)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
```
@@ -1148,8 +850,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | **str**| field1 |
- **param2** | **str**| field2 |
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
### Return type
@@ -1171,3 +873,71 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+# **test_query_parameter_collection_format**
+> test_query_parameter_collection_format(pipe, ioutil, http, url, context)
+
+
+
+To test the collection format in query parameters
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pipe = ['pipe_example'] # list[str] |
+ioutil = ['ioutil_example'] # list[str] |
+http = ['http_example'] # list[str] |
+url = ['url_example'] # list[str] |
+context = ['context_example'] # list[str] |
+
+ try:
+ api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context)
+ except ApiException as e:
+ print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | [**list[str]**](str.md)| |
+ **ioutil** | [**list[str]**](str.md)| |
+ **http** | [**list[str]**](str.md)| |
+ **url** | [**list[str]**](str.md)| |
+ **context** | [**list[str]**](str.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md
similarity index 84%
rename from samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md
rename to samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md
index 9bf5b1babf20..66b43fb1ea11 100644
--- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md
+++ b/samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md
@@ -18,10 +18,10 @@ To test class name in snake case
* Api Key Authentication (api_key_query):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_classname_tags_123_api
-from petstore_api.model.client import Client
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -43,17 +43,14 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client)
- body = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.FakeClassnameTags123Api(api_client)
+ body = petstore_api.Client() # Client | client model
- # example passing only required values which don't have defaults set
try:
# To test class name in snake case
api_response = api_instance.test_classname(body)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
```
@@ -61,7 +58,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Client**](Client.md)| client model |
+ **body** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/File.md b/samples/client/petstore/python-legacy/docs/File.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/File.md
rename to samples/client/petstore/python-legacy/docs/File.md
diff --git a/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md
similarity index 86%
rename from samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md
rename to samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md
index d0a8bbaaba95..dc3722289887 100644
--- a/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md
+++ b/samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**File**](File.md) | | [optional]
-**files** | [**[File]**](File.md) | | [optional]
+**files** | [**list[File]**](File.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/FormatTest.md b/samples/client/petstore/python-legacy/docs/FormatTest.md
similarity index 87%
rename from samples/client/petstore/python-experimental/docs/FormatTest.md
rename to samples/client/petstore/python-legacy/docs/FormatTest.md
index 083b0bd4c98a..f0942f52484f 100644
--- a/samples/client/petstore/python-experimental/docs/FormatTest.md
+++ b/samples/client/petstore/python-legacy/docs/FormatTest.md
@@ -3,19 +3,20 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**number** | **float** | |
-**byte** | **str** | |
-**date** | **date** | |
-**password** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
+**number** | **float** | |
**float** | **float** | | [optional]
**double** | **float** | | [optional]
**string** | **str** | | [optional]
-**binary** | **file_type** | | [optional]
+**byte** | **str** | |
+**binary** | **file** | | [optional]
+**date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
+**password** | **str** | |
+**big_decimal** | [**Decimal**](Decimal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-legacy/docs/HasOnlyReadOnly.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md
rename to samples/client/petstore/python-legacy/docs/HasOnlyReadOnly.md
diff --git a/samples/client/petstore/python-experimental/docs/List.md b/samples/client/petstore/python-legacy/docs/List.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/List.md
rename to samples/client/petstore/python-legacy/docs/List.md
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-legacy/docs/MapTest.md
similarity index 52%
rename from samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md
rename to samples/client/petstore/python-legacy/docs/MapTest.md
index 754b2f3ada4c..a5601691f885 100644
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md
+++ b/samples/client/petstore/python-legacy/docs/MapTest.md
@@ -1,10 +1,12 @@
-# AdditionalPropertiesAnyType
+# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str** | any string name can be used but the value must be the correct type | [optional]
+**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
+**map_of_enum_string** | **dict(str, str)** | | [optional]
+**direct_map** | **dict(str, bool)** | | [optional]
+**indirect_map** | **dict(str, bool)** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
similarity index 86%
rename from samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md
rename to samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index 1484c0638d83..b9808d5275e5 100644
--- a/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**{str: (Animal,)}**](Animal.md) | | [optional]
+**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/Model200Response.md b/samples/client/petstore/python-legacy/docs/Model200Response.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Model200Response.md
rename to samples/client/petstore/python-legacy/docs/Model200Response.md
diff --git a/samples/client/petstore/python-experimental/docs/ModelReturn.md b/samples/client/petstore/python-legacy/docs/ModelReturn.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ModelReturn.md
rename to samples/client/petstore/python-legacy/docs/ModelReturn.md
diff --git a/samples/client/petstore/python-experimental/docs/Name.md b/samples/client/petstore/python-legacy/docs/Name.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Name.md
rename to samples/client/petstore/python-legacy/docs/Name.md
diff --git a/samples/client/petstore/python-experimental/docs/NumberOnly.md b/samples/client/petstore/python-legacy/docs/NumberOnly.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/NumberOnly.md
rename to samples/client/petstore/python-legacy/docs/NumberOnly.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/client/petstore/python-legacy/docs/Order.md
similarity index 83%
rename from samples/openapi3/client/petstore/python-experimental/docs/Order.md
rename to samples/client/petstore/python-legacy/docs/Order.md
index c21210a3bd59..b5f7b22d34cf 100644
--- a/samples/openapi3/client/petstore/python-experimental/docs/Order.md
+++ b/samples/client/petstore/python-legacy/docs/Order.md
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional]
**ship_date** | **datetime** | | [optional]
**status** | **str** | Order Status | [optional]
-**complete** | **bool** | | [optional] if omitted the server will use the default value of False
+**complete** | **bool** | | [optional] [default to False]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/OuterComposite.md b/samples/client/petstore/python-legacy/docs/OuterComposite.md
similarity index 100%
rename from samples/client/petstore/python/docs/OuterComposite.md
rename to samples/client/petstore/python-legacy/docs/OuterComposite.md
diff --git a/samples/client/petstore/python/docs/OuterEnum.md b/samples/client/petstore/python-legacy/docs/OuterEnum.md
similarity index 100%
rename from samples/client/petstore/python/docs/OuterEnum.md
rename to samples/client/petstore/python-legacy/docs/OuterEnum.md
diff --git a/samples/client/petstore/python-experimental/docs/Pet.md b/samples/client/petstore/python-legacy/docs/Pet.md
similarity index 83%
rename from samples/client/petstore/python-experimental/docs/Pet.md
rename to samples/client/petstore/python-legacy/docs/Pet.md
index ce09d401c899..9e15090300f8 100644
--- a/samples/client/petstore/python-experimental/docs/Pet.md
+++ b/samples/client/petstore/python-legacy/docs/Pet.md
@@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | |
-**photo_urls** | **[str]** | |
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
-**tags** | [**[Tag]**](Tag.md) | | [optional]
+**name** | **str** | |
+**photo_urls** | **list[str]** | |
+**tags** | [**list[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-legacy/docs/PetApi.md
similarity index 74%
rename from samples/client/petstore/python-experimental/docs/PetApi.md
rename to samples/client/petstore/python-legacy/docs/PetApi.md
index 6364be448370..e8176632d088 100644
--- a/samples/client/petstore/python-experimental/docs/PetApi.md
+++ b/samples/client/petstore/python-legacy/docs/PetApi.md
@@ -24,10 +24,10 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -49,32 +49,13 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- body = Pet(
- id=1,
- category=Category(
- id=1,
- name="default-name",
- ),
- name="doggie",
- photo_urls=[
- "photo_urls_example",
- ],
- tags=[
- Tag(
- id=1,
- name="name_example",
- full_name="full_name_example",
- ),
- ],
- status="available",
- ) # Pet | Pet object that needs to be added to the store
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.PetApi(api_client)
+ body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
try:
# Add a new pet to the store
api_instance.add_pet(body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
@@ -82,7 +63,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -106,7 +87,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete_pet**
-> delete_pet(pet_id)
+> delete_pet(pet_id, api_key=api_key)
Deletes a pet
@@ -114,9 +95,10 @@ Deletes a pet
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -138,23 +120,14 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | Pet id to delete
- api_key = "api_key_example" # str | (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Deletes a pet
- api_instance.delete_pet(pet_id)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->delete_pet: %s\n" % e)
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | Pet id to delete
+api_key = 'api_key_example' # str | (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# Deletes a pet
api_instance.delete_pet(pet_id, api_key=api_key)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->delete_pet: %s\n" % e)
```
@@ -162,8 +135,8 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| Pet id to delete |
- **api_key** | **str**| | [optional]
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
### Return type
@@ -187,7 +160,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **find_pets_by_status**
-> [Pet] find_pets_by_status(status)
+> list[Pet] find_pets_by_status(status)
Finds Pets by status
@@ -197,10 +170,10 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -222,17 +195,14 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- status = [
- "available",
- ] # [str] | Status values that need to be considered for filter
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # list[str] | Status values that need to be considered for filter
- # example passing only required values which don't have defaults set
try:
# Finds Pets by status
api_response = api_instance.find_pets_by_status(status)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
```
@@ -240,11 +210,11 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | **[str]**| Status values that need to be considered for filter |
+ **status** | [**list[str]**](str.md)| Status values that need to be considered for filter |
### Return type
-[**[Pet]**](Pet.md)
+[**list[Pet]**](Pet.md)
### Authorization
@@ -264,7 +234,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **find_pets_by_tags**
-> [Pet] find_pets_by_tags(tags)
+> list[Pet] find_pets_by_tags(tags)
Finds Pets by tags
@@ -274,10 +244,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -299,17 +269,14 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- tags = [
- "tags_example",
- ] # [str] | Tags to filter by
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # list[str] | Tags to filter by
- # example passing only required values which don't have defaults set
try:
# Finds Pets by tags
api_response = api_instance.find_pets_by_tags(tags)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
```
@@ -317,11 +284,11 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **tags** | **[str]**| Tags to filter by |
+ **tags** | [**list[str]**](str.md)| Tags to filter by |
### Return type
-[**[Pet]**](Pet.md)
+[**list[Pet]**](Pet.md)
### Authorization
@@ -351,10 +318,10 @@ Returns a single pet
* Api Key Authentication (api_key):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -376,15 +343,14 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet to return
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to return
- # example passing only required values which don't have defaults set
try:
# Find pet by ID
api_response = api_instance.get_pet_by_id(pet_id)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
```
@@ -392,7 +358,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to return |
+ **pet_id** | **int**| ID of pet to return |
### Return type
@@ -425,10 +391,10 @@ Update an existing pet
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -450,32 +416,13 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- body = Pet(
- id=1,
- category=Category(
- id=1,
- name="default-name",
- ),
- name="doggie",
- photo_urls=[
- "photo_urls_example",
- ],
- tags=[
- Tag(
- id=1,
- name="name_example",
- full_name="full_name_example",
- ),
- ],
- status="available",
- ) # Pet | Pet object that needs to be added to the store
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.PetApi(api_client)
+ body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
try:
# Update an existing pet
api_instance.update_pet(body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
@@ -483,7 +430,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -509,7 +456,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_pet_with_form**
-> update_pet_with_form(pet_id)
+> update_pet_with_form(pet_id, name=name, status=status)
Updates a pet in the store with form data
@@ -517,9 +464,10 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -541,24 +489,15 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet that needs to be updated
- name = "name_example" # str | Updated name of the pet (optional)
- status = "status_example" # str | Updated status of the pet (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Updates a pet in the store with form data
- api_instance.update_pet_with_form(pet_id)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet that needs to be updated
+name = 'name_example' # str | Updated name of the pet (optional)
+status = 'status_example' # str | Updated status of the pet (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# Updates a pet in the store with form data
api_instance.update_pet_with_form(pet_id, name=name, status=status)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
```
@@ -566,9 +505,9 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet that needs to be updated |
- **name** | **str**| Updated name of the pet | [optional]
- **status** | **str**| Updated status of the pet | [optional]
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
### Return type
@@ -591,7 +530,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file**
-> ApiResponse upload_file(pet_id)
+> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
uploads an image
@@ -599,10 +538,10 @@ uploads an image
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.api_response import ApiResponse
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -624,27 +563,16 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet to update
- additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
- file = open('/path/to/file', 'rb') # file_type | file to upload (optional)
- files = # [file_type] | files to upload (optional)
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+file = '/path/to/file' # file | file to upload (optional)
- # example passing only required values which don't have defaults set
try:
# uploads an image
- api_response = api_instance.upload_file(pet_id)
+ api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->upload_file: %s\n" % e)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- # uploads an image
- api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files)
- pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->upload_file: %s\n" % e)
```
@@ -652,10 +580,9 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
- **file** | **file_type**| file to upload | [optional]
- **files** | **[file_type]**| files to upload | [optional]
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **file**| file to upload | [optional]
### Return type
@@ -678,7 +605,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, required_file)
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
uploads an image (required)
@@ -686,10 +613,10 @@ uploads an image (required)
* OAuth Authentication (petstore_auth):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.api_response import ApiResponse
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -711,26 +638,16 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet to update
- required_file = open('/path/to/file', 'rb') # file_type | file to upload
- additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # uploads an image (required)
- api_response = api_instance.upload_file_with_required_file(pet_id, required_file)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+required_file = '/path/to/file' # file | file to upload
+additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# uploads an image (required)
api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
```
@@ -738,9 +655,9 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **required_file** | **file_type**| file to upload |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **file**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/client/petstore/python-legacy/docs/ReadOnlyFirst.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md
rename to samples/client/petstore/python-legacy/docs/ReadOnlyFirst.md
diff --git a/samples/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/client/petstore/python-legacy/docs/SpecialModelName.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/SpecialModelName.md
rename to samples/client/petstore/python-legacy/docs/SpecialModelName.md
diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-legacy/docs/StoreApi.md
similarity index 83%
rename from samples/client/petstore/python-experimental/docs/StoreApi.md
rename to samples/client/petstore/python-legacy/docs/StoreApi.md
index 30ea16d661f5..b9dc71c38f55 100644
--- a/samples/client/petstore/python-experimental/docs/StoreApi.md
+++ b/samples/client/petstore/python-legacy/docs/StoreApi.md
@@ -20,9 +20,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -34,14 +35,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
- order_id = "order_id_example" # str | ID of the order that needs to be deleted
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 'order_id_example' # str | ID of the order that needs to be deleted
- # example passing only required values which don't have defaults set
try:
# Delete purchase order by ID
api_instance.delete_order(order_id)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->delete_order: %s\n" % e)
```
@@ -49,7 +49,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **str**| ID of the order that needs to be deleted |
+ **order_id** | **str**| ID of the order that needs to be deleted |
### Return type
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> {str: (int,)} get_inventory()
+> dict(str, int) get_inventory()
Returns pet inventories by status
@@ -83,9 +83,10 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -107,14 +108,13 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
-
- # example, this endpoint has no required or optional parameters
+ api_instance = petstore_api.StoreApi(api_client)
+
try:
# Returns pet inventories by status
api_response = api_instance.get_inventory()
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->get_inventory: %s\n" % e)
```
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**{str: (int,)}**
+**dict(str, int)**
### Authorization
@@ -151,10 +151,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
-from petstore_api.model.order import Order
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -166,15 +166,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
- order_id = 1 # int | ID of pet that needs to be fetched
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 56 # int | ID of pet that needs to be fetched
- # example passing only required values which don't have defaults set
try:
# Find purchase order by ID
api_response = api_instance.get_order_by_id(order_id)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
```
@@ -182,7 +181,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **int**| ID of pet that needs to be fetched |
+ **order_id** | **int**| ID of pet that needs to be fetched |
### Return type
@@ -214,10 +213,10 @@ Place an order for a pet
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
-from petstore_api.model.order import Order
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -229,22 +228,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
- body = Order(
- id=1,
- pet_id=1,
- quantity=1,
- ship_date=dateutil_parser('1970-01-01T00:00:00.00Z'),
- status="placed",
- complete=False,
- ) # Order | order placed for purchasing the pet
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.StoreApi(api_client)
+ body = petstore_api.Order() # Order | order placed for purchasing the pet
+
try:
# Place an order for a pet
api_response = api_instance.place_order(body)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
```
@@ -252,7 +243,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Order**](Order.md)| order placed for purchasing the pet |
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/client/petstore/python-legacy/docs/Tag.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Tag.md
rename to samples/client/petstore/python-legacy/docs/Tag.md
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-legacy/docs/TypeHolderDefault.md
similarity index 55%
rename from samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md
rename to samples/client/petstore/python-legacy/docs/TypeHolderDefault.md
index bec81854b950..861da021826a 100644
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md
+++ b/samples/client/petstore/python-legacy/docs/TypeHolderDefault.md
@@ -1,10 +1,13 @@
-# AdditionalPropertiesNumber
+# TypeHolderDefault
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | | [optional]
-**any string name** | **float** | any string name can be used but the value must be the correct type | [optional]
+**string_item** | **str** | | [default to 'what']
+**number_item** | **float** | |
+**integer_item** | **int** | |
+**bool_item** | **bool** | | [default to True]
+**array_item** | **list[int]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md b/samples/client/petstore/python-legacy/docs/TypeHolderExample.md
similarity index 56%
rename from samples/client/petstore/python-experimental/docs/TypeHolderExample.md
rename to samples/client/petstore/python-legacy/docs/TypeHolderExample.md
index 246ac18b2b59..2a410ded8e35 100644
--- a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md
+++ b/samples/client/petstore/python-legacy/docs/TypeHolderExample.md
@@ -1,14 +1,14 @@
# TypeHolderExample
-a model to test required properties with an example and length one enum
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**string_item** | **str** | |
+**number_item** | **float** | |
+**float_item** | **float** | |
+**integer_item** | **int** | |
**bool_item** | **bool** | |
-**array_item** | **[int]** | |
-**string_item** | **str** | | defaults to "what"
-**number_item** | **float** | | defaults to 1.234
-**integer_item** | **int** | | defaults to -2
+**array_item** | **list[int]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/User.md b/samples/client/petstore/python-legacy/docs/User.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/User.md
rename to samples/client/petstore/python-legacy/docs/User.md
diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-legacy/docs/UserApi.md
similarity index 76%
rename from samples/client/petstore/python-experimental/docs/UserApi.md
rename to samples/client/petstore/python-legacy/docs/UserApi.md
index 429d7918521d..6cb9d1ec3849 100644
--- a/samples/client/petstore/python-experimental/docs/UserApi.md
+++ b/samples/client/petstore/python-legacy/docs/UserApi.md
@@ -24,10 +24,10 @@ This can only be done by the logged in user.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -39,23 +39,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- body = User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- ) # User | Created user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ body = petstore_api.User() # User | Created user object
+
try:
# Create user
api_instance.create_user(body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
@@ -63,7 +53,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**User**](User.md)| Created user object |
+ **body** | [**User**](User.md)| Created user object |
### Return type
@@ -93,10 +83,10 @@ Creates list of users with given input array
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -108,25 +98,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- body = [
- User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- ),
- ] # [User] | List of user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ body = [petstore_api.User()] # list[User] | List of user object
+
try:
# Creates list of users with given input array
api_instance.create_users_with_array_input(body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
@@ -134,7 +112,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](User.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -164,10 +142,10 @@ Creates list of users with given input array
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -179,25 +157,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- body = [
- User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- ),
- ] # [User] | List of user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ body = [petstore_api.User()] # list[User] | List of user object
+
try:
# Creates list of users with given input array
api_instance.create_users_with_list_input(body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
@@ -205,7 +171,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](User.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -237,9 +203,10 @@ This can only be done by the logged in user.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -251,14 +218,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | The name that needs to be deleted
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be deleted
- # example passing only required values which don't have defaults set
try:
# Delete user
api_instance.delete_user(username)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->delete_user: %s\n" % e)
```
@@ -266,7 +232,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be deleted |
+ **username** | **str**| The name that needs to be deleted |
### Return type
@@ -297,10 +263,10 @@ Get user by user name
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -312,15 +278,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | The name that needs to be fetched. Use user1 for testing.
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
- # example passing only required values which don't have defaults set
try:
# Get user by user name
api_response = api_instance.get_user_by_name(username)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
```
@@ -328,7 +293,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
+ **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
### Return type
@@ -360,9 +325,10 @@ Logs user into the system
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -374,16 +340,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | The user name for login
- password = "password_example" # str | The password for login in clear text
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The user name for login
+password = 'password_example' # str | The password for login in clear text
- # example passing only required values which don't have defaults set
try:
# Logs user into the system
api_response = api_instance.login_user(username, password)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->login_user: %s\n" % e)
```
@@ -391,8 +356,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The user name for login |
- **password** | **str**| The password for login in clear text |
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
### Return type
@@ -423,9 +388,10 @@ Logs out current logged in user session
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -437,13 +403,12 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
-
- # example, this endpoint has no required or optional parameters
+ api_instance = petstore_api.UserApi(api_client)
+
try:
# Logs out current logged in user session
api_instance.logout_user()
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->logout_user: %s\n" % e)
```
@@ -480,10 +445,10 @@ This can only be done by the logged in user.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -495,24 +460,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | name that need to be deleted
- body = User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- ) # User | Updated user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | name that need to be deleted
+body = petstore_api.User() # User | Updated user object
+
try:
# Updated user
api_instance.update_user(username, body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
```
@@ -520,8 +475,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| name that need to be deleted |
- **body** | [**User**](User.md)| Updated user object |
+ **username** | **str**| name that need to be deleted |
+ **body** | [**User**](User.md)| Updated user object |
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/XmlItem.md b/samples/client/petstore/python-legacy/docs/XmlItem.md
similarity index 71%
rename from samples/client/petstore/python-experimental/docs/XmlItem.md
rename to samples/client/petstore/python-legacy/docs/XmlItem.md
index d30ca4362293..3dd09833fe52 100644
--- a/samples/client/petstore/python-experimental/docs/XmlItem.md
+++ b/samples/client/petstore/python-legacy/docs/XmlItem.md
@@ -7,31 +7,31 @@ Name | Type | Description | Notes
**attribute_number** | **float** | | [optional]
**attribute_integer** | **int** | | [optional]
**attribute_boolean** | **bool** | | [optional]
-**wrapped_array** | **[int]** | | [optional]
+**wrapped_array** | **list[int]** | | [optional]
**name_string** | **str** | | [optional]
**name_number** | **float** | | [optional]
**name_integer** | **int** | | [optional]
**name_boolean** | **bool** | | [optional]
-**name_array** | **[int]** | | [optional]
-**name_wrapped_array** | **[int]** | | [optional]
+**name_array** | **list[int]** | | [optional]
+**name_wrapped_array** | **list[int]** | | [optional]
**prefix_string** | **str** | | [optional]
**prefix_number** | **float** | | [optional]
**prefix_integer** | **int** | | [optional]
**prefix_boolean** | **bool** | | [optional]
-**prefix_array** | **[int]** | | [optional]
-**prefix_wrapped_array** | **[int]** | | [optional]
+**prefix_array** | **list[int]** | | [optional]
+**prefix_wrapped_array** | **list[int]** | | [optional]
**namespace_string** | **str** | | [optional]
**namespace_number** | **float** | | [optional]
**namespace_integer** | **int** | | [optional]
**namespace_boolean** | **bool** | | [optional]
-**namespace_array** | **[int]** | | [optional]
-**namespace_wrapped_array** | **[int]** | | [optional]
+**namespace_array** | **list[int]** | | [optional]
+**namespace_wrapped_array** | **list[int]** | | [optional]
**prefix_ns_string** | **str** | | [optional]
**prefix_ns_number** | **float** | | [optional]
**prefix_ns_integer** | **int** | | [optional]
**prefix_ns_boolean** | **bool** | | [optional]
-**prefix_ns_array** | **[int]** | | [optional]
-**prefix_ns_wrapped_array** | **[int]** | | [optional]
+**prefix_ns_array** | **list[int]** | | [optional]
+**prefix_ns_wrapped_array** | **list[int]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/git_push.sh b/samples/client/petstore/python-legacy/git_push.sh
similarity index 100%
rename from samples/client/petstore/python-experimental/git_push.sh
rename to samples/client/petstore/python-legacy/git_push.sh
diff --git a/samples/client/petstore/python-legacy/petstore_api/__init__.py b/samples/client/petstore/python-legacy/petstore_api/__init__.py
new file mode 100644
index 000000000000..b9fdaf07ac19
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/__init__.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+__version__ = "1.0.0"
+
+# import apis into sdk package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
+
+# import ApiClient
+from petstore_api.api_client import ApiClient
+from petstore_api.configuration import Configuration
+from petstore_api.exceptions import OpenApiException
+from petstore_api.exceptions import ApiTypeError
+from petstore_api.exceptions import ApiValueError
+from petstore_api.exceptions import ApiKeyError
+from petstore_api.exceptions import ApiAttributeError
+from petstore_api.exceptions import ApiException
+# import models into sdk package
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
+from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
+from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
+from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
+from petstore_api.models.additional_properties_string import AdditionalPropertiesString
+from petstore_api.models.animal import Animal
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.big_cat import BigCat
+from petstore_api.models.big_cat_all_of import BigCatAllOf
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.pet import Pet
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.tag import Tag
+from petstore_api.models.type_holder_default import TypeHolderDefault
+from petstore_api.models.type_holder_example import TypeHolderExample
+from petstore_api.models.user import User
+from petstore_api.models.xml_item import XmlItem
+
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/__init__.py b/samples/client/petstore/python-legacy/petstore_api/api/__init__.py
new file mode 100644
index 000000000000..74496adb5a2b
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/__init__.py
@@ -0,0 +1,11 @@
+from __future__ import absolute_import
+
+# flake8: noqa
+
+# import apis into api package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py
new file mode 100644
index 000000000000..6fdd45236472
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py
@@ -0,0 +1,176 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class AnotherFakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def call_123_test_special_tags(self, body, **kwargs): # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: client model (required)
+ :type body: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501
+
+ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: client model (required)
+ :type body: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method call_123_test_special_tags" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/another-fake/dummy', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
new file mode 100644
index 000000000000..252a82c0ef44
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
@@ -0,0 +1,2176 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def create_xml_item(self, xml_item, **kwargs): # noqa: E501
+ """creates an XmlItem # noqa: E501
+
+ this route creates an XmlItem # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_xml_item(xml_item, async_req=True)
+ >>> result = thread.get()
+
+ :param xml_item: XmlItem Body (required)
+ :type xml_item: XmlItem
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501
+
+ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501
+ """creates an XmlItem # noqa: E501
+
+ this route creates an XmlItem # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True)
+ >>> result = thread.get()
+
+ :param xml_item: XmlItem Body (required)
+ :type xml_item: XmlItem
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'xml_item'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_xml_item" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'xml_item' is set
+ if self.api_client.client_side_validation and ('xml_item' not in local_var_params or # noqa: E501
+ local_var_params['xml_item'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'xml_item' in local_var_params:
+ body_params = local_var_params['xml_item']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/create_xml_item', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bool
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_boolean_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "bool",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/boolean', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_composite_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_composite_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input composite as post body
+ :type body: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: OuterComposite
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input composite as post body
+ :type body: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_composite_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "OuterComposite",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/composite', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_number_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_number_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: float
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_number_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "float",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/number', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_string_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_string_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_string_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "str",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/string', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_body_with_file_schema(self, body, **kwargs): # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_body_with_file_schema(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: (required)
+ :type body: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501
+
+ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: (required)
+ :type body: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_file_schema" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-file-schema', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_body_with_query_params(query, body, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param body: (required)
+ :type body: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501
+
+ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param body: (required)
+ :type body: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'query',
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_query_params" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'query' is set
+ if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501
+ local_var_params['query'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501
+ query_params.append(('query', local_var_params['query'])) # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-query-params', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_client_model(self, body, **kwargs): # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: client model (required)
+ :type body: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501
+
+ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: client model (required)
+ :type body: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_client_model" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: file
+ :param date: None
+ :type date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
+
+ def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: file
+ :param date: None
+ :type date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ 'integer',
+ 'int32',
+ 'int64',
+ 'float',
+ 'string',
+ 'binary',
+ 'date',
+ 'date_time',
+ 'password',
+ 'param_callback'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_endpoint_parameters" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'number' is set
+ if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501
+ local_var_params['number'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501
+ # verify the required parameter 'double' is set
+ if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501
+ local_var_params['double'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501
+ # verify the required parameter 'pattern_without_delimiter' is set
+ if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501
+ local_var_params['pattern_without_delimiter'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501
+ # verify the required parameter 'byte' is set
+ if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501
+ local_var_params['byte'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501
+
+ if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501
+ if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501
+ if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501
+ if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501
+ if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501
+ if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501
+ if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501
+ if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501
+ if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501
+ if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501
+ if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501
+ if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
+ len(local_var_params['password']) > 64): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501
+ if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
+ len(local_var_params['password']) < 10): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'integer' in local_var_params:
+ form_params.append(('integer', local_var_params['integer'])) # noqa: E501
+ if 'int32' in local_var_params:
+ form_params.append(('int32', local_var_params['int32'])) # noqa: E501
+ if 'int64' in local_var_params:
+ form_params.append(('int64', local_var_params['int64'])) # noqa: E501
+ if 'number' in local_var_params:
+ form_params.append(('number', local_var_params['number'])) # noqa: E501
+ if 'float' in local_var_params:
+ form_params.append(('float', local_var_params['float'])) # noqa: E501
+ if 'double' in local_var_params:
+ form_params.append(('double', local_var_params['double'])) # noqa: E501
+ if 'string' in local_var_params:
+ form_params.append(('string', local_var_params['string'])) # noqa: E501
+ if 'pattern_without_delimiter' in local_var_params:
+ form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501
+ if 'byte' in local_var_params:
+ form_params.append(('byte', local_var_params['byte'])) # noqa: E501
+ if 'binary' in local_var_params:
+ local_var_files['binary'] = local_var_params['binary'] # noqa: E501
+ if 'date' in local_var_params:
+ form_params.append(('date', local_var_params['date'])) # noqa: E501
+ if 'date_time' in local_var_params:
+ form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501
+ if 'password' in local_var_params:
+ form_params.append(('password', local_var_params['password'])) # noqa: E501
+ if 'param_callback' in local_var_params:
+ form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['http_basic_test'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_enum_parameters(self, **kwargs): # noqa: E501
+ """To test enum parameters # noqa: E501
+
+ To test enum parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_enum_parameters(async_req=True)
+ >>> result = thread.get()
+
+ :param enum_header_string_array: Header parameter enum test (string array)
+ :type enum_header_string_array: list[str]
+ :param enum_header_string: Header parameter enum test (string)
+ :type enum_header_string: str
+ :param enum_query_string_array: Query parameter enum test (string array)
+ :type enum_query_string_array: list[str]
+ :param enum_query_string: Query parameter enum test (string)
+ :type enum_query_string: str
+ :param enum_query_integer: Query parameter enum test (double)
+ :type enum_query_integer: int
+ :param enum_query_double: Query parameter enum test (double)
+ :type enum_query_double: float
+ :param enum_form_string_array: Form parameter enum test (string array)
+ :type enum_form_string_array: list[str]
+ :param enum_form_string: Form parameter enum test (string)
+ :type enum_form_string: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
+
+ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501
+ """To test enum parameters # noqa: E501
+
+ To test enum parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_enum_parameters_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param enum_header_string_array: Header parameter enum test (string array)
+ :type enum_header_string_array: list[str]
+ :param enum_header_string: Header parameter enum test (string)
+ :type enum_header_string: str
+ :param enum_query_string_array: Query parameter enum test (string array)
+ :type enum_query_string_array: list[str]
+ :param enum_query_string: Query parameter enum test (string)
+ :type enum_query_string: str
+ :param enum_query_integer: Query parameter enum test (double)
+ :type enum_query_integer: int
+ :param enum_query_double: Query parameter enum test (double)
+ :type enum_query_double: float
+ :param enum_form_string_array: Form parameter enum test (string array)
+ :type enum_form_string_array: list[str]
+ :param enum_form_string: Form parameter enum test (string)
+ :type enum_form_string: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ 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'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_enum_parameters" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501
+ query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501
+ collection_formats['enum_query_string_array'] = 'csv' # noqa: E501
+ if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501
+ query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501
+ if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501
+ query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501
+ if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501
+ query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501
+
+ header_params = {}
+ if 'enum_header_string_array' in local_var_params:
+ header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501
+ collection_formats['enum_header_string_array'] = 'csv' # noqa: E501
+ if 'enum_header_string' in local_var_params:
+ header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+ if 'enum_form_string_array' in local_var_params:
+ form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501
+ collection_formats['enum_form_string_array'] = 'csv' # noqa: E501
+ if 'enum_form_string' in local_var_params:
+ form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
+
+ def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ 'string_group',
+ 'boolean_group',
+ 'int64_group'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_group_parameters" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'required_string_group' is set
+ if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501
+ local_var_params['required_string_group'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
+ # verify the required parameter 'required_boolean_group' is set
+ if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501
+ local_var_params['required_boolean_group'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
+ # verify the required parameter 'required_int64_group' is set
+ if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501
+ local_var_params['required_int64_group'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501
+ query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
+ if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501
+ query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
+ if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501
+ query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
+ if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501
+ query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
+
+ header_params = {}
+ if 'required_boolean_group' in local_var_params:
+ header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
+ if 'boolean_group' in local_var_params:
+ header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_inline_additional_properties(self, param, **kwargs): # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties(param, async_req=True)
+ >>> result = thread.get()
+
+ :param param: request body (required)
+ :type param: dict(str, str)
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501
+
+ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True)
+ >>> result = thread.get()
+
+ :param param: request body (required)
+ :type param: dict(str, str)
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'param'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_inline_additional_properties" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'param' is set
+ if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501
+ local_var_params['param'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'param' in local_var_params:
+ body_params = local_var_params['param']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/inline-additionalProperties', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_json_form_data(self, param, param2, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_json_form_data(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
+
+ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'param',
+ 'param2'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_json_form_data" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'param' is set
+ if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501
+ local_var_params['param'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501
+ # verify the required parameter 'param2' is set
+ if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501
+ local_var_params['param2'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'param' in local_var_params:
+ form_params.append(('param', local_var_params['param'])) # noqa: E501
+ if 'param2' in local_var_params:
+ form_params.append(('param2', local_var_params['param2'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/jsonFormData', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: list[str]
+ :param ioutil: (required)
+ :type ioutil: list[str]
+ :param http: (required)
+ :type http: list[str]
+ :param url: (required)
+ :type url: list[str]
+ :param context: (required)
+ :type context: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501
+
+ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: list[str]
+ :param ioutil: (required)
+ :type ioutil: list[str]
+ :param http: (required)
+ :type http: list[str]
+ :param url: (required)
+ :type url: list[str]
+ :param context: (required)
+ :type context: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pipe',
+ 'ioutil',
+ 'http',
+ 'url',
+ 'context'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_query_parameter_collection_format" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pipe' is set
+ if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501
+ local_var_params['pipe'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'ioutil' is set
+ if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501
+ local_var_params['ioutil'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'http' is set
+ if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501
+ local_var_params['http'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'url' is set
+ if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501
+ local_var_params['url'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'context' is set
+ if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501
+ local_var_params['context'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501
+ query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501
+ collection_formats['pipe'] = 'csv' # noqa: E501
+ if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501
+ query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501
+ collection_formats['ioutil'] = 'csv' # noqa: E501
+ if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501
+ query_params.append(('http', local_var_params['http'])) # noqa: E501
+ collection_formats['http'] = 'ssv' # noqa: E501
+ if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501
+ query_params.append(('url', local_var_params['url'])) # noqa: E501
+ collection_formats['url'] = 'csv' # noqa: E501
+ if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501
+ query_params.append(('context', local_var_params['context'])) # noqa: E501
+ collection_formats['context'] = 'multi' # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/test-query-paramters', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py
new file mode 100644
index 000000000000..f87835d7a61d
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py
@@ -0,0 +1,176 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeClassnameTags123Api(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def test_classname(self, body, **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_classname(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: client model (required)
+ :type body: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_classname_with_http_info(body, **kwargs) # noqa: E501
+
+ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_classname_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: client model (required)
+ :type body: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_classname" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key_query'] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake_classname_test', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py
new file mode 100644
index 000000000000..5baedc8e6d27
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py
@@ -0,0 +1,1295 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class PetApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def add_pet(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.add_pet(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Pet object that needs to be added to the store (required)
+ :type body: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.add_pet_with_http_info(body, **kwargs) # noqa: E501
+
+ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.add_pet_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Pet object that needs to be added to the store (required)
+ :type body: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method add_pet" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json', 'application/xml']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def delete_pet(self, pet_id, **kwargs): # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'api_key'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_pet" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+ if 'api_key' in local_var_params:
+ header_params['api_key'] = local_var_params['api_key'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def find_pets_by_status(self, status, **kwargs): # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_status(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: list[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
+
+ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'status'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_status" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'status' is set
+ if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501
+ local_var_params['status'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501
+ query_params.append(('status', local_var_params['status'])) # noqa: E501
+ collection_formats['status'] = 'csv' # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "list[Pet]",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByStatus', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def find_pets_by_tags(self, tags, **kwargs): # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_tags(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: list[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
+
+ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'tags'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_tags" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'tags' is set
+ if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501
+ local_var_params['tags'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501
+ query_params.append(('tags', local_var_params['tags'])) # noqa: E501
+ collection_formats['tags'] = 'csv' # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "list[Pet]",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByTags', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Pet
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ 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 pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_pet_by_id" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key'] # noqa: E501
+
+ response_types_map = {
+ 200: "Pet",
+ 400: None,
+ 404: None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def update_pet(self, body, **kwargs): # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Pet object that needs to be added to the store (required)
+ :type body: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_http_info(body, **kwargs) # noqa: E501
+
+ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Pet object that needs to be added to the store (required)
+ :type body: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json', 'application/xml']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.update_pet_with_form(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'name',
+ 'status'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet_with_form" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'name' in local_var_params:
+ form_params.append(('name', local_var_params['name'])) # noqa: E501
+ if 'status' in local_var_params:
+ form_params.append(('status', local_var_params['status'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def upload_file(self, pet_id, **kwargs): # noqa: E501
+ """uploads an image # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: file
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """uploads an image # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: file
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'additional_metadata',
+ 'file'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'additional_metadata' in local_var_params:
+ form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
+ if 'file' in local_var_params:
+ local_var_files['file'] = local_var_params['file'] # noqa: E501
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['multipart/form-data']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}/uploadImage', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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 pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: file
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
+
+ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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 pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: file
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'required_file',
+ 'additional_metadata'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file_with_required_file" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
+ # verify the required parameter 'required_file' is set
+ if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501
+ local_var_params['required_file'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'additional_metadata' in local_var_params:
+ form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
+ if 'required_file' in local_var_params:
+ local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['multipart/form-data']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/fake/{petId}/uploadImageWithRequiredFile', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py
new file mode 100644
index 000000000000..734d8e17dc93
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py
@@ -0,0 +1,565 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class StoreApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def delete_order(self, order_id, **kwargs): # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_order(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
+
+ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_order_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'order_id'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_order" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'order_id' is set
+ if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
+ local_var_params['order_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'order_id' in local_var_params:
+ path_params['order_id'] = local_var_params['order_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_inventory(self, **kwargs): # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_inventory(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: dict(str, int)
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_inventory_with_http_info(**kwargs) # noqa: E501
+
+ def get_inventory_with_http_info(self, **kwargs): # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_inventory_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_inventory" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key'] # noqa: E501
+
+ response_types_map = {
+ 200: "dict(str, int)",
+ }
+
+ return self.api_client.call_api(
+ '/store/inventory', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_order_by_id(self, order_id, **kwargs): # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_order_by_id(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
+
+ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'order_id'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_order_by_id" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'order_id' is set
+ if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
+ local_var_params['order_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
+
+ if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
+ if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
+ collection_formats = {}
+
+ path_params = {}
+ if 'order_id' in local_var_params:
+ path_params['order_id'] = local_var_params['order_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Order",
+ 400: None,
+ 404: None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def place_order(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.place_order(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: order placed for purchasing the pet (required)
+ :type body: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.place_order_with_http_info(body, **kwargs) # noqa: E501
+
+ def place_order_with_http_info(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.place_order_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: order placed for purchasing the pet (required)
+ :type body: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method place_order" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Order",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py
new file mode 100644
index 000000000000..9f8be84771ae
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py
@@ -0,0 +1,1085 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class UserApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def create_user(self, body, **kwargs): # noqa: E501
+ """Create user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.create_user(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Created user object (required)
+ :type body: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_user_with_http_info(body, **kwargs) # noqa: E501
+
+ def create_user_with_http_info(self, body, **kwargs): # noqa: E501
+ """Create user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.create_user_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Created user object (required)
+ :type body: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def create_users_with_array_input(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_array_input(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: List of user object (required)
+ :type body: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501
+
+ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: List of user object (required)
+ :type body: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_array_input" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithArray', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def create_users_with_list_input(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_list_input(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: List of user object (required)
+ :type body: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501
+
+ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: List of user object (required)
+ :type body: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_list_input" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithList', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def delete_user(self, username, **kwargs): # noqa: E501
+ """Delete user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_user(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
+
+ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501
+ """Delete user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_user_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'username' in local_var_params:
+ path_params['username'] = local_var_params['username'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_user_by_name(self, username, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.get_user_by_name(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: User
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
+
+ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_user_by_name" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'username' in local_var_params:
+ path_params['username'] = local_var_params['username'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "User",
+ 400: None,
+ 404: None,
+ }
+
+ return self.api_client.call_api(
+ '/user/{username}', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def login_user(self, username, password, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.login_user(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
+
+ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.login_user_with_http_info(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username',
+ 'password'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method login_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501
+ # verify the required parameter 'password' is set
+ if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501
+ local_var_params['password'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501
+ query_params.append(('username', local_var_params['username'])) # noqa: E501
+ if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501
+ query_params.append(('password', local_var_params['password'])) # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "str",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/user/login', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def logout_user(self, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.logout_user(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.logout_user_with_http_info(**kwargs) # noqa: E501
+
+ def logout_user_with_http_info(self, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.logout_user_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method logout_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/logout', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def update_user(self, username, body, **kwargs): # noqa: E501
+ """Updated user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.update_user(username, body, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param body: Updated user object (required)
+ :type body: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501
+
+ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501
+ """Updated user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.update_user_with_http_info(username, body, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param body: Updated user object (required)
+ :type body: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username',
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501
+ # verify the required parameter 'body' is set
+ if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
+ local_var_params['body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'username' in local_var_params:
+ path_params['username'] = local_var_params['username'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python-legacy/petstore_api/api_client.py b/samples/client/petstore/python-legacy/petstore_api/api_client.py
new file mode 100644
index 000000000000..52c58e68a08f
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/api_client.py
@@ -0,0 +1,693 @@
+# coding: utf-8
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+from __future__ import absolute_import
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+# python 2 and python 3 compatibility library
+import six
+from six.moves.urllib.parse import quote
+
+from petstore_api.configuration import Configuration
+import petstore_api.models
+from petstore_api import rest
+from petstore_api.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int if six.PY3 else long, # noqa: F821
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ if configuration is None:
+ configuration = Configuration.get_default_copy()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = 'OpenAPI-Generator/1.0.0/python'
+ self.client_side_validation = configuration.client_side_validation
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
+
+ def close(self):
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+ def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ query_params = self.parameters_to_tuples(query_params,
+ collection_formats)
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ try:
+ # perform request and return response
+ response_data = self.request(
+ method, url, query_params=query_params, headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ e.body = e.body.decode('utf-8') if six.PY3 else e.body
+ raise e
+
+ self.last_response = response_data
+
+ return_data = response_data
+
+ if not _preload_content:
+ return return_data
+
+ response_type = response_types_map.get(response_data.status, None)
+
+ if six.PY3 and response_type not in ["file", "bytes"]:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+
+ if response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+ if _return_http_data_only:
+ return (return_data)
+ else:
+ return (return_data, response_data.status,
+ response_data.getheaders())
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
+ for attr, _ in six.iteritems(obj.openapi_types)
+ if getattr(obj, attr) is not None}
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in six.iteritems(obj_dict)}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('list['):
+ sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('dict('):
+ sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in six.iteritems(data)}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(petstore_api.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None,_preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :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,
+ header, and post parameters.
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.GET(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.HEAD(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.OPTIONS(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.POST(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.PUT(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.PATCH(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.DELETE(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in six.iteritems(files):
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ accepts = [x.lower() for x in accepts]
+
+ if 'application/json' in accepts:
+ return 'application/json'
+ else:
+ return ', '.join(accepts)
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return 'application/json'
+
+ content_types = [x.lower() for x in content_types]
+
+ if 'application/json' in content_types or '*/*' in content_types:
+ return 'application/json'
+ else:
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, querys, auth_settings,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param querys: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, querys, request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, querys, auth_setting)
+
+ def _apply_auth_params(self, headers, querys, auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param querys: Query parameters tuple list to be updated.
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ headers[auth_setting['key']] = auth_setting['value']
+ elif auth_setting['in'] == 'query':
+ querys.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return six.text_type(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+ has_discriminator = False
+ if (hasattr(klass, 'get_real_child_model')
+ and klass.discriminator_value_class_map):
+ has_discriminator = True
+
+ if not klass.openapi_types and has_discriminator is False:
+ return data
+
+ kwargs = {}
+ if (data is not None and
+ klass.openapi_types is not None and
+ isinstance(data, (list, dict))):
+ for attr, attr_type in six.iteritems(klass.openapi_types):
+ if klass.attribute_map[attr] in data:
+ value = data[klass.attribute_map[attr]]
+ kwargs[attr] = self.__deserialize(value, attr_type)
+
+ instance = klass(**kwargs)
+
+ if has_discriminator:
+ klass_name = instance.get_real_child_model(data)
+ if klass_name:
+ instance = self.__deserialize(data, klass_name)
+ return instance
diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-legacy/petstore_api/configuration.py
similarity index 97%
rename from samples/client/petstore/python-experimental/petstore_api/configuration.py
rename to samples/client/petstore/python-legacy/petstore_api/configuration.py
index 516b0339732b..71e6a7117f8f 100644
--- a/samples/client/petstore/python-experimental/petstore_api/configuration.py
+++ b/samples/client/petstore/python-legacy/petstore_api/configuration.py
@@ -10,13 +10,16 @@
"""
+from __future__ import absolute_import
+
import copy
import logging
import multiprocessing
import sys
import urllib3
-from http import client as http_client
+import six
+from six.moves import http_client as httplib
from petstore_api.exceptions import ApiValueError
@@ -227,8 +230,9 @@ def __init__(self, host=None,
# Enable client side validation
self.client_side_validation = True
- # Options to pass down to the underlying urllib3 socket
self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -307,7 +311,7 @@ def logger_file(self, value):
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
@property
@@ -329,17 +333,17 @@ def debug(self, value):
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
- # turn on http_client debug
- http_client.HTTPConnection.debuglevel = 1
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
- # turn off http_client debug
- http_client.HTTPConnection.debuglevel = 0
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
diff --git a/samples/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/client/petstore/python-legacy/petstore_api/exceptions.py
similarity index 84%
rename from samples/client/petstore/python-experimental/petstore_api/exceptions.py
rename to samples/client/petstore/python-legacy/petstore_api/exceptions.py
index fecd2081b818..08181d4775db 100644
--- a/samples/client/petstore/python-experimental/petstore_api/exceptions.py
+++ b/samples/client/petstore/python-legacy/petstore_api/exceptions.py
@@ -10,6 +10,8 @@
"""
+import six
+
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -126,11 +128,35 @@ def __str__(self):
return error_message
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, int):
+ if isinstance(pth, six.integer_types):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/samples/client/petstore/python-legacy/petstore_api/models/__init__.py b/samples/client/petstore/python-legacy/petstore_api/models/__init__.py
new file mode 100644
index 000000000000..ddef3dea4fdb
--- /dev/null
+++ b/samples/client/petstore/python-legacy/petstore_api/models/__init__.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+# import models into model package
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
+from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
+from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
+from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
+from petstore_api.models.additional_properties_string import AdditionalPropertiesString
+from petstore_api.models.animal import Animal
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.big_cat import BigCat
+from petstore_api.models.big_cat_all_of import BigCatAllOf
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.pet import Pet
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.tag import Tag
+from petstore_api.models.type_holder_default import TypeHolderDefault
+from petstore_api.models.type_holder_example import TypeHolderExample
+from petstore_api.models.user import User
+from petstore_api.models.xml_item import XmlItem
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_any_type.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_any_type.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_any_type.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_array.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_array.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_array.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_boolean.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_boolean.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_boolean.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_class.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_integer.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_integer.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_integer.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_number.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_number.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_number.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_object.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_object.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_object.py
diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_string.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/additional_properties_string.py
rename to samples/client/petstore/python-legacy/petstore_api/models/additional_properties_string.py
diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python-legacy/petstore_api/models/animal.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/animal.py
rename to samples/client/petstore/python-legacy/petstore_api/models/animal.py
diff --git a/samples/client/petstore/python/petstore_api/models/api_response.py b/samples/client/petstore/python-legacy/petstore_api/models/api_response.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/api_response.py
rename to samples/client/petstore/python-legacy/petstore_api/models/api_response.py
diff --git a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py
rename to samples/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py
diff --git a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/array_of_number_only.py
rename to samples/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py
diff --git a/samples/client/petstore/python/petstore_api/models/array_test.py b/samples/client/petstore/python-legacy/petstore_api/models/array_test.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/array_test.py
rename to samples/client/petstore/python-legacy/petstore_api/models/array_test.py
diff --git a/samples/client/petstore/python/petstore_api/models/big_cat.py b/samples/client/petstore/python-legacy/petstore_api/models/big_cat.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/big_cat.py
rename to samples/client/petstore/python-legacy/petstore_api/models/big_cat.py
diff --git a/samples/client/petstore/python/petstore_api/models/big_cat_all_of.py b/samples/client/petstore/python-legacy/petstore_api/models/big_cat_all_of.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/big_cat_all_of.py
rename to samples/client/petstore/python-legacy/petstore_api/models/big_cat_all_of.py
diff --git a/samples/client/petstore/python/petstore_api/models/capitalization.py b/samples/client/petstore/python-legacy/petstore_api/models/capitalization.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/capitalization.py
rename to samples/client/petstore/python-legacy/petstore_api/models/capitalization.py
diff --git a/samples/client/petstore/python/petstore_api/models/cat.py b/samples/client/petstore/python-legacy/petstore_api/models/cat.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/cat.py
rename to samples/client/petstore/python-legacy/petstore_api/models/cat.py
diff --git a/samples/client/petstore/python/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-legacy/petstore_api/models/cat_all_of.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/cat_all_of.py
rename to samples/client/petstore/python-legacy/petstore_api/models/cat_all_of.py
diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python-legacy/petstore_api/models/category.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/category.py
rename to samples/client/petstore/python-legacy/petstore_api/models/category.py
diff --git a/samples/client/petstore/python/petstore_api/models/class_model.py b/samples/client/petstore/python-legacy/petstore_api/models/class_model.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/class_model.py
rename to samples/client/petstore/python-legacy/petstore_api/models/class_model.py
diff --git a/samples/client/petstore/python/petstore_api/models/client.py b/samples/client/petstore/python-legacy/petstore_api/models/client.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/client.py
rename to samples/client/petstore/python-legacy/petstore_api/models/client.py
diff --git a/samples/client/petstore/python/petstore_api/models/dog.py b/samples/client/petstore/python-legacy/petstore_api/models/dog.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/dog.py
rename to samples/client/petstore/python-legacy/petstore_api/models/dog.py
diff --git a/samples/client/petstore/python/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-legacy/petstore_api/models/dog_all_of.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/dog_all_of.py
rename to samples/client/petstore/python-legacy/petstore_api/models/dog_all_of.py
diff --git a/samples/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-legacy/petstore_api/models/enum_arrays.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/enum_arrays.py
rename to samples/client/petstore/python-legacy/petstore_api/models/enum_arrays.py
diff --git a/samples/client/petstore/python/petstore_api/models/enum_class.py b/samples/client/petstore/python-legacy/petstore_api/models/enum_class.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/enum_class.py
rename to samples/client/petstore/python-legacy/petstore_api/models/enum_class.py
diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python-legacy/petstore_api/models/enum_test.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/enum_test.py
rename to samples/client/petstore/python-legacy/petstore_api/models/enum_test.py
diff --git a/samples/client/petstore/python/petstore_api/models/file.py b/samples/client/petstore/python-legacy/petstore_api/models/file.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/file.py
rename to samples/client/petstore/python-legacy/petstore_api/models/file.py
diff --git a/samples/client/petstore/python/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/file_schema_test_class.py
rename to samples/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py
diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python-legacy/petstore_api/models/format_test.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/format_test.py
rename to samples/client/petstore/python-legacy/petstore_api/models/format_test.py
diff --git a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/has_only_read_only.py
rename to samples/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py
diff --git a/samples/client/petstore/python/petstore_api/models/list.py b/samples/client/petstore/python-legacy/petstore_api/models/list.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/list.py
rename to samples/client/petstore/python-legacy/petstore_api/models/list.py
diff --git a/samples/client/petstore/python/petstore_api/models/map_test.py b/samples/client/petstore/python-legacy/petstore_api/models/map_test.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/map_test.py
rename to samples/client/petstore/python-legacy/petstore_api/models/map_test.py
diff --git a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py
rename to samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
diff --git a/samples/client/petstore/python/petstore_api/models/model200_response.py b/samples/client/petstore/python-legacy/petstore_api/models/model200_response.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/model200_response.py
rename to samples/client/petstore/python-legacy/petstore_api/models/model200_response.py
diff --git a/samples/client/petstore/python/petstore_api/models/model_return.py b/samples/client/petstore/python-legacy/petstore_api/models/model_return.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/model_return.py
rename to samples/client/petstore/python-legacy/petstore_api/models/model_return.py
diff --git a/samples/client/petstore/python/petstore_api/models/name.py b/samples/client/petstore/python-legacy/petstore_api/models/name.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/name.py
rename to samples/client/petstore/python-legacy/petstore_api/models/name.py
diff --git a/samples/client/petstore/python/petstore_api/models/number_only.py b/samples/client/petstore/python-legacy/petstore_api/models/number_only.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/number_only.py
rename to samples/client/petstore/python-legacy/petstore_api/models/number_only.py
diff --git a/samples/client/petstore/python/petstore_api/models/order.py b/samples/client/petstore/python-legacy/petstore_api/models/order.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/order.py
rename to samples/client/petstore/python-legacy/petstore_api/models/order.py
diff --git a/samples/client/petstore/python/petstore_api/models/outer_composite.py b/samples/client/petstore/python-legacy/petstore_api/models/outer_composite.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/outer_composite.py
rename to samples/client/petstore/python-legacy/petstore_api/models/outer_composite.py
diff --git a/samples/client/petstore/python/petstore_api/models/outer_enum.py b/samples/client/petstore/python-legacy/petstore_api/models/outer_enum.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/outer_enum.py
rename to samples/client/petstore/python-legacy/petstore_api/models/outer_enum.py
diff --git a/samples/client/petstore/python/petstore_api/models/pet.py b/samples/client/petstore/python-legacy/petstore_api/models/pet.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/pet.py
rename to samples/client/petstore/python-legacy/petstore_api/models/pet.py
diff --git a/samples/client/petstore/python/petstore_api/models/read_only_first.py b/samples/client/petstore/python-legacy/petstore_api/models/read_only_first.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/read_only_first.py
rename to samples/client/petstore/python-legacy/petstore_api/models/read_only_first.py
diff --git a/samples/client/petstore/python/petstore_api/models/special_model_name.py b/samples/client/petstore/python-legacy/petstore_api/models/special_model_name.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/special_model_name.py
rename to samples/client/petstore/python-legacy/petstore_api/models/special_model_name.py
diff --git a/samples/client/petstore/python/petstore_api/models/tag.py b/samples/client/petstore/python-legacy/petstore_api/models/tag.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/tag.py
rename to samples/client/petstore/python-legacy/petstore_api/models/tag.py
diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-legacy/petstore_api/models/type_holder_default.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/type_holder_default.py
rename to samples/client/petstore/python-legacy/petstore_api/models/type_holder_default.py
diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-legacy/petstore_api/models/type_holder_example.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/type_holder_example.py
rename to samples/client/petstore/python-legacy/petstore_api/models/type_holder_example.py
diff --git a/samples/client/petstore/python/petstore_api/models/user.py b/samples/client/petstore/python-legacy/petstore_api/models/user.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/user.py
rename to samples/client/petstore/python-legacy/petstore_api/models/user.py
diff --git a/samples/client/petstore/python/petstore_api/models/xml_item.py b/samples/client/petstore/python-legacy/petstore_api/models/xml_item.py
similarity index 100%
rename from samples/client/petstore/python/petstore_api/models/xml_item.py
rename to samples/client/petstore/python-legacy/petstore_api/models/xml_item.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/rest.py b/samples/client/petstore/python-legacy/petstore_api/rest.py
similarity index 94%
rename from samples/client/petstore/python-experimental/petstore_api/rest.py
rename to samples/client/petstore/python-legacy/petstore_api/rest.py
index 9537cea6b1af..17e85148bb30 100644
--- a/samples/client/petstore/python-experimental/petstore_api/rest.py
+++ b/samples/client/petstore/python-legacy/petstore_api/rest.py
@@ -10,17 +10,21 @@
"""
+from __future__ import absolute_import
+
import io
import json
import logging
import re
import ssl
-from urllib.parse import urlencode
import certifi
+# python 2 and python 3 compatibility library
+import six
+from six.moves.urllib.parse import urlencode
import urllib3
-from petstore_api.exceptions import ApiException, ApiValueError
+from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
logger = logging.getLogger(__name__)
@@ -140,7 +144,7 @@ def request(self, method, url, query_params=None, headers=None,
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
+ if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
@@ -220,6 +224,18 @@ def request(self, method, url, query_params=None, headers=None,
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
+ if r.status == 401:
+ raise UnauthorizedException(http_resp=r)
+
+ if r.status == 403:
+ raise ForbiddenException(http_resp=r)
+
+ if r.status == 404:
+ raise NotFoundException(http_resp=r)
+
+ if 500 <= r.status <= 599:
+ raise ServiceException(http_resp=r)
+
raise ApiException(http_resp=r)
return r
diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/client/petstore/python-legacy/pom.xml
similarity index 89%
rename from samples/openapi3/client/petstore/python-experimental/pom.xml
rename to samples/client/petstore/python-legacy/pom.xml
index c2364c744828..71814d4388d9 100644
--- a/samples/openapi3/client/petstore/python-experimental/pom.xml
+++ b/samples/client/petstore/python-legacy/pom.xml
@@ -1,10 +1,10 @@
4.0.0
org.openapitools
- PythonExperimentalOAS3PetstoreTests
+ PythonPetstoreClientTests
pom
1.0-SNAPSHOT
- Python-Experimental OpenAPI3 Petstore Client
+ Python OpenAPI Petstore Client
@@ -35,7 +35,7 @@
make
- test
+ test-all
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt b/samples/client/petstore/python-legacy/requirements.txt
similarity index 66%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt
rename to samples/client/petstore/python-legacy/requirements.txt
index 2c2f00fcb27b..eb358efd5bd3 100644
--- a/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt
+++ b/samples/client/petstore/python-legacy/requirements.txt
@@ -1,5 +1,6 @@
-nulltype
certifi >= 14.05.14
+future; python_version<="2.7"
+six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
diff --git a/samples/client/petstore/python-experimental/setup.cfg b/samples/client/petstore/python-legacy/setup.cfg
similarity index 100%
rename from samples/client/petstore/python-experimental/setup.cfg
rename to samples/client/petstore/python-legacy/setup.cfg
diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-legacy/setup.py
similarity index 91%
rename from samples/client/petstore/python-experimental/setup.py
rename to samples/client/petstore/python-legacy/setup.py
index 56811ec079bd..2a3ca48e06ba 100644
--- a/samples/client/petstore/python-experimental/setup.py
+++ b/samples/client/petstore/python-legacy/setup.py
@@ -21,12 +21,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = [
- "urllib3 >= 1.15",
- "certifi",
- "python-dateutil",
- "nulltype",
-]
+REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
@@ -36,7 +31,6 @@
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
- python_requires=">=3.5",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
diff --git a/samples/client/petstore/python-legacy/test-requirements.txt b/samples/client/petstore/python-legacy/test-requirements.txt
new file mode 100644
index 000000000000..4ed3991cbec1
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test-requirements.txt
@@ -0,0 +1,3 @@
+pytest~=4.6.7 # needed for python 2.7+3.4
+pytest-cov>=2.8.1
+pytest-randomly==1.2.3 # needed for python 2.7+3.4
diff --git a/samples/client/petstore/python-experimental/tests/__init__.py b/samples/client/petstore/python-legacy/test/__init__.py
similarity index 100%
rename from samples/client/petstore/python-experimental/tests/__init__.py
rename to samples/client/petstore/python-legacy/test/__init__.py
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py b/samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py
similarity index 72%
rename from samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py
rename to samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py
index ce985f76ed9e..4b6739a1faf3 100644
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
+from petstore_api.rest import ApiException
class TestAdditionalPropertiesAnyType(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testAdditionalPropertiesAnyType(self):
"""Test AdditionalPropertiesAnyType"""
# FIXME: construct object with mandatory attributes with example values
- # model = AdditionalPropertiesAnyType() # noqa: E501
+ # model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_outer_composite.py b/samples/client/petstore/python-legacy/test/test_additional_properties_array.py
similarity index 61%
rename from samples/openapi3/client/petstore/python/test/test_outer_composite.py
rename to samples/client/petstore/python-legacy/test/test_additional_properties_array.py
index dcb078cd2164..c4cf43499cfa 100644
--- a/samples/openapi3/client/petstore/python/test/test_outer_composite.py
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_array.py
@@ -15,12 +15,12 @@
import unittest
import petstore_api
-from petstore_api.models.outer_composite import OuterComposite # noqa: E501
+from petstore_api.models.additional_properties_array import AdditionalPropertiesArray # noqa: E501
from petstore_api.rest import ApiException
-class TestOuterComposite(unittest.TestCase):
- """OuterComposite unit test stubs"""
+class TestAdditionalPropertiesArray(unittest.TestCase):
+ """AdditionalPropertiesArray unit test stubs"""
def setUp(self):
pass
@@ -28,10 +28,10 @@ def setUp(self):
def tearDown(self):
pass
- def testOuterComposite(self):
- """Test OuterComposite"""
+ def testAdditionalPropertiesArray(self):
+ """Test AdditionalPropertiesArray"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
+ # model = petstore_api.models.additional_properties_array.AdditionalPropertiesArray() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py b/samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py
new file mode 100644
index 000000000000..cc3cecc8522f
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ OpenAPI spec version: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestAdditionalPropertiesBoolean(unittest.TestCase):
+ """AdditionalPropertiesBoolean unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testAdditionalPropertiesBoolean(self):
+ """Test AdditionalPropertiesBoolean"""
+ # FIXME: construct object with mandatory attributes with example values
+ # model = petstore_api.models.additional_properties_boolean.AdditionalPropertiesBoolean() # noqa: E501
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/client/petstore/python-legacy/test/test_additional_properties_class.py
similarity index 72%
rename from samples/client/petstore/python-experimental/test/test_additional_properties_class.py
rename to samples/client/petstore/python-legacy/test/test_additional_properties_class.py
index befc14455da2..fc9df3bbb505 100644
--- a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_class.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
class TestAdditionalPropertiesClass(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testAdditionalPropertiesClass(self):
"""Test AdditionalPropertiesClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = AdditionalPropertiesClass() # noqa: E501
+ # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_integer.py b/samples/client/petstore/python-legacy/test/test_additional_properties_integer.py
new file mode 100644
index 000000000000..774c367b2109
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_integer.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ OpenAPI spec version: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestAdditionalPropertiesInteger(unittest.TestCase):
+ """AdditionalPropertiesInteger unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testAdditionalPropertiesInteger(self):
+ """Test AdditionalPropertiesInteger"""
+ # FIXME: construct object with mandatory attributes with example values
+ # model = petstore_api.models.additional_properties_integer.AdditionalPropertiesInteger() # noqa: E501
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python/test/test_outer_enum_default_value.py b/samples/client/petstore/python-legacy/test/test_additional_properties_number.py
similarity index 60%
rename from samples/openapi3/client/petstore/python/test/test_outer_enum_default_value.py
rename to samples/client/petstore/python-legacy/test/test_additional_properties_number.py
index ff64e640c6c2..0d370e781b36 100644
--- a/samples/openapi3/client/petstore/python/test/test_outer_enum_default_value.py
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_number.py
@@ -15,12 +15,12 @@
import unittest
import petstore_api
-from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
+from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber # noqa: E501
from petstore_api.rest import ApiException
-class TestOuterEnumDefaultValue(unittest.TestCase):
- """OuterEnumDefaultValue unit test stubs"""
+class TestAdditionalPropertiesNumber(unittest.TestCase):
+ """AdditionalPropertiesNumber unit test stubs"""
def setUp(self):
pass
@@ -28,10 +28,10 @@ def setUp(self):
def tearDown(self):
pass
- def testOuterEnumDefaultValue(self):
- """Test OuterEnumDefaultValue"""
+ def testAdditionalPropertiesNumber(self):
+ """Test AdditionalPropertiesNumber"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.outer_enum_default_value.OuterEnumDefaultValue() # noqa: E501
+ # model = petstore_api.models.additional_properties_number.AdditionalPropertiesNumber() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_outer_enum_integer.py b/samples/client/petstore/python-legacy/test/test_additional_properties_object.py
similarity index 60%
rename from samples/openapi3/client/petstore/python/test/test_outer_enum_integer.py
rename to samples/client/petstore/python-legacy/test/test_additional_properties_object.py
index ab9eb42104b8..6e718b28cdef 100644
--- a/samples/openapi3/client/petstore/python/test/test_outer_enum_integer.py
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_object.py
@@ -15,12 +15,12 @@
import unittest
import petstore_api
-from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
from petstore_api.rest import ApiException
-class TestOuterEnumInteger(unittest.TestCase):
- """OuterEnumInteger unit test stubs"""
+class TestAdditionalPropertiesObject(unittest.TestCase):
+ """AdditionalPropertiesObject unit test stubs"""
def setUp(self):
pass
@@ -28,10 +28,10 @@ def setUp(self):
def tearDown(self):
pass
- def testOuterEnumInteger(self):
- """Test OuterEnumInteger"""
+ def testAdditionalPropertiesObject(self):
+ """Test AdditionalPropertiesObject"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.outer_enum_integer.OuterEnumInteger() # noqa: E501
+ # model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_string.py b/samples/client/petstore/python-legacy/test/test_additional_properties_string.py
new file mode 100644
index 000000000000..a46cb3e256dc
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_additional_properties_string.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ OpenAPI spec version: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.models.additional_properties_string import AdditionalPropertiesString # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestAdditionalPropertiesString(unittest.TestCase):
+ """AdditionalPropertiesString unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testAdditionalPropertiesString(self):
+ """Test AdditionalPropertiesString"""
+ # FIXME: construct object with mandatory attributes with example values
+ # model = petstore_api.models.additional_properties_string.AdditionalPropertiesString() # noqa: E501
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-legacy/test/test_animal.py b/samples/client/petstore/python-legacy/test/test_animal.py
new file mode 100644
index 000000000000..88d0693a1003
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_animal.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.animal import Animal # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAnimal(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Animal
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.animal.Animal() # noqa: E501
+ if include_optional :
+ return Animal(
+ class_name = '0',
+ color = 'red'
+ )
+ else :
+ return Animal(
+ class_name = '0',
+ )
+
+ def testAnimal(self):
+ """Test Animal"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/client/petstore/python-legacy/test/test_another_fake_api.py
similarity index 69%
rename from samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py
rename to samples/client/petstore/python-legacy/test/test_another_fake_api.py
index c58dfa6202bc..4b80dc4eda52 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py
+++ b/samples/client/petstore/python-legacy/test/test_another_fake_api.py
@@ -5,28 +5,31 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
+from petstore_api.rest import ApiException
class TestAnotherFakeApi(unittest.TestCase):
"""AnotherFakeApi unit test stubs"""
def setUp(self):
- self.api = AnotherFakeApi() # noqa: E501
+ self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
def tearDown(self):
pass
- def test_call_123_test_special_tags(self):
- """Test case for call_123_test_special_tags
+ def test_test_special_tags(self):
+ """Test case for test_special_tags
To test special tags # noqa: E501
"""
diff --git a/samples/client/petstore/python-experimental/test/test_api_response.py b/samples/client/petstore/python-legacy/test/test_api_response.py
similarity index 75%
rename from samples/client/petstore/python-experimental/test/test_api_response.py
rename to samples/client/petstore/python-legacy/test/test_api_response.py
index 9db92633f626..5031b458a0db 100644
--- a/samples/client/petstore/python-experimental/test/test_api_response.py
+++ b/samples/client/petstore/python-legacy/test/test_api_response.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.api_response import ApiResponse
+from petstore_api.models.api_response import ApiResponse # noqa: E501
+from petstore_api.rest import ApiException
class TestApiResponse(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testApiResponse(self):
"""Test ApiResponse"""
# FIXME: construct object with mandatory attributes with example values
- # model = ApiResponse() # noqa: E501
+ # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py
similarity index 72%
rename from samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py
rename to samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py
index 4980ad17afb5..a02233045421 100644
--- a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py
+++ b/samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testArrayOfArrayOfNumberOnly(self):
"""Test ArrayOfArrayOfNumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = ArrayOfArrayOfNumberOnly() # noqa: E501
+ # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/client/petstore/python-legacy/test/test_array_of_number_only.py
similarity index 74%
rename from samples/client/petstore/python-experimental/test/test_array_of_number_only.py
rename to samples/client/petstore/python-legacy/test/test_array_of_number_only.py
index 479c537cada7..1a928bf7d2e0 100644
--- a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py
+++ b/samples/client/petstore/python-legacy/test/test_array_of_number_only.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
class TestArrayOfNumberOnly(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testArrayOfNumberOnly(self):
"""Test ArrayOfNumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = ArrayOfNumberOnly() # noqa: E501
+ # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-legacy/test/test_array_test.py
similarity index 71%
rename from samples/openapi3/client/petstore/python-experimental/test/test_array_test.py
rename to samples/client/petstore/python-legacy/test/test_array_test.py
index 19042d9c461d..c56b77b77ee3 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py
+++ b/samples/client/petstore/python-legacy/test/test_array_test.py
@@ -5,18 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
-import sys
+from __future__ import absolute_import
+
import unittest
import petstore_api
-from petstore_api.model.read_only_first import ReadOnlyFirst
-globals()['ReadOnlyFirst'] = ReadOnlyFirst
-from petstore_api.model.array_test import ArrayTest
+from petstore_api.models.array_test import ArrayTest # noqa: E501
+from petstore_api.rest import ApiException
class TestArrayTest(unittest.TestCase):
@@ -31,7 +31,7 @@ def tearDown(self):
def testArrayTest(self):
"""Test ArrayTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = ArrayTest() # noqa: E501
+ # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_big_cat.py b/samples/client/petstore/python-legacy/test/test_big_cat.py
similarity index 100%
rename from samples/client/petstore/python/test/test_big_cat.py
rename to samples/client/petstore/python-legacy/test/test_big_cat.py
diff --git a/samples/client/petstore/python/test/test_big_cat_all_of.py b/samples/client/petstore/python-legacy/test/test_big_cat_all_of.py
similarity index 100%
rename from samples/client/petstore/python/test/test_big_cat_all_of.py
rename to samples/client/petstore/python-legacy/test/test_big_cat_all_of.py
diff --git a/samples/client/petstore/python-experimental/test/test_capitalization.py b/samples/client/petstore/python-legacy/test/test_capitalization.py
similarity index 75%
rename from samples/client/petstore/python-experimental/test/test_capitalization.py
rename to samples/client/petstore/python-legacy/test/test_capitalization.py
index 20d2649c01eb..2ae7725b3f09 100644
--- a/samples/client/petstore/python-experimental/test/test_capitalization.py
+++ b/samples/client/petstore/python-legacy/test/test_capitalization.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.capitalization import Capitalization
+from petstore_api.models.capitalization import Capitalization # noqa: E501
+from petstore_api.rest import ApiException
class TestCapitalization(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testCapitalization(self):
"""Test Capitalization"""
# FIXME: construct object with mandatory attributes with example values
- # model = Capitalization() # noqa: E501
+ # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_cat.py b/samples/client/petstore/python-legacy/test/test_cat.py
new file mode 100644
index 000000000000..a835b6af736b
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_cat.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.cat import Cat # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCat(unittest.TestCase):
+ """Cat unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Cat
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.cat.Cat() # noqa: E501
+ if include_optional :
+ return Cat(
+ declawed = True
+ )
+ else :
+ return Cat(
+ )
+
+ def testCat(self):
+ """Test Cat"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/client/petstore/python-legacy/test/test_cat_all_of.py
similarity index 76%
rename from samples/client/petstore/python-experimental/test/test_cat_all_of.py
rename to samples/client/petstore/python-legacy/test/test_cat_all_of.py
index a5bb91ac864e..531443380c6e 100644
--- a/samples/client/petstore/python-experimental/test/test_cat_all_of.py
+++ b/samples/client/petstore/python-legacy/test/test_cat_all_of.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.cat_all_of import CatAllOf
+from petstore_api.models.cat_all_of import CatAllOf # noqa: E501
+from petstore_api.rest import ApiException
class TestCatAllOf(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testCatAllOf(self):
"""Test CatAllOf"""
# FIXME: construct object with mandatory attributes with example values
- # model = CatAllOf() # noqa: E501
+ # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_category.py b/samples/client/petstore/python-legacy/test/test_category.py
new file mode 100644
index 000000000000..05b4714fe9f3
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_category.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.category import Category # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCategory(unittest.TestCase):
+ """Category unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Category
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.category.Category() # noqa: E501
+ if include_optional :
+ return Category(
+ id = 56,
+ name = 'default-name'
+ )
+ else :
+ return Category(
+ name = 'default-name',
+ )
+
+ def testCategory(self):
+ """Test Category"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_class_model.py b/samples/client/petstore/python-legacy/test/test_class_model.py
similarity index 76%
rename from samples/client/petstore/python-experimental/test/test_class_model.py
rename to samples/client/petstore/python-legacy/test/test_class_model.py
index 060df39e4b5e..12b7fb99402e 100644
--- a/samples/client/petstore/python-experimental/test/test_class_model.py
+++ b/samples/client/petstore/python-legacy/test/test_class_model.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.class_model import ClassModel
+from petstore_api.models.class_model import ClassModel # noqa: E501
+from petstore_api.rest import ApiException
class TestClassModel(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testClassModel(self):
"""Test ClassModel"""
# FIXME: construct object with mandatory attributes with example values
- # model = ClassModel() # noqa: E501
+ # model = petstore_api.models.class_model.ClassModel() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_client.py b/samples/client/petstore/python-legacy/test/test_client.py
similarity index 77%
rename from samples/client/petstore/python-experimental/test/test_client.py
rename to samples/client/petstore/python-legacy/test/test_client.py
index ab5e3a80d377..9e18c4310d96 100644
--- a/samples/client/petstore/python-experimental/test/test_client.py
+++ b/samples/client/petstore/python-legacy/test/test_client.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.client import Client
+from petstore_api.models.client import Client # noqa: E501
+from petstore_api.rest import ApiException
class TestClient(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testClient(self):
"""Test Client"""
# FIXME: construct object with mandatory attributes with example values
- # model = Client() # noqa: E501
+ # model = petstore_api.models.client.Client() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_outer_enum.py b/samples/client/petstore/python-legacy/test/test_dog.py
similarity index 70%
rename from samples/openapi3/client/petstore/python/test/test_outer_enum.py
rename to samples/client/petstore/python-legacy/test/test_dog.py
index 472e36e16821..dc151f998ddd 100644
--- a/samples/openapi3/client/petstore/python/test/test_outer_enum.py
+++ b/samples/client/petstore/python-legacy/test/test_dog.py
@@ -15,12 +15,12 @@
import unittest
import petstore_api
-from petstore_api.models.outer_enum import OuterEnum # noqa: E501
+from petstore_api.models.dog import Dog # noqa: E501
from petstore_api.rest import ApiException
-class TestOuterEnum(unittest.TestCase):
- """OuterEnum unit test stubs"""
+class TestDog(unittest.TestCase):
+ """Dog unit test stubs"""
def setUp(self):
pass
@@ -28,10 +28,10 @@ def setUp(self):
def tearDown(self):
pass
- def testOuterEnum(self):
- """Test OuterEnum"""
+ def testDog(self):
+ """Test Dog"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501
+ # model = petstore_api.models.dog.Dog() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/client/petstore/python-legacy/test/test_dog_all_of.py
similarity index 76%
rename from samples/client/petstore/python-experimental/test/test_dog_all_of.py
rename to samples/client/petstore/python-legacy/test/test_dog_all_of.py
index 7ab4e8ae79d8..3d79f2888c96 100644
--- a/samples/client/petstore/python-experimental/test/test_dog_all_of.py
+++ b/samples/client/petstore/python-legacy/test/test_dog_all_of.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.dog_all_of import DogAllOf
+from petstore_api.models.dog_all_of import DogAllOf # noqa: E501
+from petstore_api.rest import ApiException
class TestDogAllOf(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testDogAllOf(self):
"""Test DogAllOf"""
# FIXME: construct object with mandatory attributes with example values
- # model = DogAllOf() # noqa: E501
+ # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-legacy/test/test_enum_arrays.py
similarity index 71%
rename from samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py
rename to samples/client/petstore/python-legacy/test/test_enum_arrays.py
index 9458d918a604..be572508ef22 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py
+++ b/samples/client/petstore/python-legacy/test/test_enum_arrays.py
@@ -5,16 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
-import sys
+from __future__ import absolute_import
+
import unittest
import petstore_api
-from petstore_api.model.enum_arrays import EnumArrays
+from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
+from petstore_api.rest import ApiException
class TestEnumArrays(unittest.TestCase):
@@ -29,7 +31,7 @@ def tearDown(self):
def testEnumArrays(self):
"""Test EnumArrays"""
# FIXME: construct object with mandatory attributes with example values
- # model = EnumArrays() # noqa: E501
+ # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_enum_class.py b/samples/client/petstore/python-legacy/test/test_enum_class.py
new file mode 100644
index 000000000000..f092ab776424
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_enum_class.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_class import EnumClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumClass(unittest.TestCase):
+ """EnumClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_class.EnumClass() # noqa: E501
+ if include_optional :
+ return EnumClass(
+ )
+ else :
+ return EnumClass(
+ )
+
+ def testEnumClass(self):
+ """Test EnumClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-legacy/test/test_enum_test.py
similarity index 70%
rename from samples/client/petstore/python-experimental/test/test_enum_test.py
rename to samples/client/petstore/python-legacy/test/test_enum_test.py
index 7b4c1b6b66ac..ecd43afc709d 100644
--- a/samples/client/petstore/python-experimental/test/test_enum_test.py
+++ b/samples/client/petstore/python-legacy/test/test_enum_test.py
@@ -5,22 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-try:
- from petstore_api.model import string_enum
-except ImportError:
- string_enum = sys.modules[
- 'petstore_api.model.string_enum']
-from petstore_api.model.enum_test import EnumTest
+from petstore_api.models.enum_test import EnumTest # noqa: E501
+from petstore_api.rest import ApiException
class TestEnumTest(unittest.TestCase):
@@ -35,7 +31,7 @@ def tearDown(self):
def testEnumTest(self):
"""Test EnumTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = EnumTest() # noqa: E501
+ # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_fake_api.py b/samples/client/petstore/python-legacy/test/test_fake_api.py
new file mode 100644
index 000000000000..fc2cbef35f1c
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_fake_api.py
@@ -0,0 +1,98 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ OpenAPI spec version: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.fake_api import FakeApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestFakeApi(unittest.TestCase):
+ """FakeApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_fake_outer_boolean_serialize(self):
+ """Test case for fake_outer_boolean_serialize
+
+ """
+ pass
+
+ def test_fake_outer_composite_serialize(self):
+ """Test case for fake_outer_composite_serialize
+
+ """
+ pass
+
+ def test_fake_outer_number_serialize(self):
+ """Test case for fake_outer_number_serialize
+
+ """
+ pass
+
+ def test_fake_outer_string_serialize(self):
+ """Test case for fake_outer_string_serialize
+
+ """
+ pass
+
+ def test_test_body_with_query_params(self):
+ """Test case for test_body_with_query_params
+
+ """
+ pass
+
+ def test_test_client_model(self):
+ """Test case for test_client_model
+
+ To test \"client\" model # noqa: E501
+ """
+ pass
+
+ def test_test_endpoint_parameters(self):
+ """Test case for test_endpoint_parameters
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ """
+ pass
+
+ def test_test_enum_parameters(self):
+ """Test case for test_enum_parameters
+
+ To test enum parameters # noqa: E501
+ """
+ pass
+
+ def test_test_inline_additional_properties(self):
+ """Test case for test_inline_additional_properties
+
+ test inline additionalProperties # noqa: E501
+ """
+ pass
+
+ def test_test_json_form_data(self):
+ """Test case for test_json_form_data
+
+ test json serialization of form data # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py
similarity index 78%
rename from samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py
rename to samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py
index b7724aaed7d1..87cac0b9ef85 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py
+++ b/samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py
@@ -5,22 +5,25 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
+from petstore_api.rest import ApiException
class TestFakeClassnameTags123Api(unittest.TestCase):
"""FakeClassnameTags123Api unit test stubs"""
def setUp(self):
- self.api = FakeClassnameTags123Api() # noqa: E501
+ self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/client/petstore/python-legacy/test/test_file.py b/samples/client/petstore/python-legacy/test/test_file.py
new file mode 100644
index 000000000000..bc51bffba560
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_file.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file import File # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFile(unittest.TestCase):
+ """File unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test File
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file.File() # noqa: E501
+ if include_optional :
+ return File(
+ source_uri = '0'
+ )
+ else :
+ return File(
+ )
+
+ def testFile(self):
+ """Test File"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-legacy/test/test_file_schema_test_class.py b/samples/client/petstore/python-legacy/test/test_file_schema_test_class.py
new file mode 100644
index 000000000000..182a1b0a5537
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_file_schema_test_class.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFileSchemaTestClass(unittest.TestCase):
+ """FileSchemaTestClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FileSchemaTestClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
+ if include_optional :
+ return FileSchemaTestClass(
+ file = petstore_api.models.file.File(
+ source_uri = '0', ),
+ files = [
+ petstore_api.models.file.File(
+ source_uri = '0', )
+ ]
+ )
+ else :
+ return FileSchemaTestClass(
+ )
+
+ def testFileSchemaTestClass(self):
+ """Test FileSchemaTestClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-legacy/test/test_format_test.py b/samples/client/petstore/python-legacy/test/test_format_test.py
new file mode 100644
index 000000000000..e64c47b385d7
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_format_test.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.format_test import FormatTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFormatTest(unittest.TestCase):
+ """FormatTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FormatTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.format_test.FormatTest() # noqa: E501
+ if include_optional :
+ return FormatTest(
+ integer = 1E+1,
+ int32 = 2E+1,
+ int64 = 56,
+ number = 32.1,
+ float = 54.3,
+ double = 67.8,
+ string = 'a',
+ byte = 'YQ==',
+ binary = 'bytes',
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
+ password = '0123456789',
+ big_decimal = 1
+ )
+ else :
+ return FormatTest(
+ number = 32.1,
+ byte = 'YQ==',
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ password = '0123456789',
+ )
+
+ def testFormatTest(self):
+ """Test FormatTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/client/petstore/python-legacy/test/test_has_only_read_only.py
similarity index 74%
rename from samples/client/petstore/python-experimental/test/test_has_only_read_only.py
rename to samples/client/petstore/python-legacy/test/test_has_only_read_only.py
index 9ebd7683b398..2dc052a328a0 100644
--- a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py
+++ b/samples/client/petstore/python-legacy/test/test_has_only_read_only.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
+from petstore_api.rest import ApiException
class TestHasOnlyReadOnly(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testHasOnlyReadOnly(self):
"""Test HasOnlyReadOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = HasOnlyReadOnly() # noqa: E501
+ # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_list.py b/samples/client/petstore/python-legacy/test/test_list.py
similarity index 77%
rename from samples/client/petstore/python-experimental/test/test_list.py
rename to samples/client/petstore/python-legacy/test/test_list.py
index 52156adfed2e..a538a6b1ad36 100644
--- a/samples/client/petstore/python-experimental/test/test_list.py
+++ b/samples/client/petstore/python-legacy/test/test_list.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.list import List
+from petstore_api.models.list import List # noqa: E501
+from petstore_api.rest import ApiException
class TestList(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testList(self):
"""Test List"""
# FIXME: construct object with mandatory attributes with example values
- # model = List() # noqa: E501
+ # model = petstore_api.models.list.List() # noqa: E501
pass
diff --git a/samples/client/petstore/python-legacy/test/test_map_test.py b/samples/client/petstore/python-legacy/test/test_map_test.py
new file mode 100644
index 000000000000..40eb0a42e6ea
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_map_test.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.map_test import MapTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMapTest(unittest.TestCase):
+ """MapTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MapTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.map_test.MapTest() # noqa: E501
+ if include_optional :
+ return MapTest(
+ map_map_of_string = {
+ 'key' : {
+ 'key' : '0'
+ }
+ },
+ map_of_enum_string = {
+ 'UPPER' : 'UPPER'
+ },
+ direct_map = {
+ 'key' : True
+ },
+ indirect_map = {
+ 'key' : True
+ }
+ )
+ else :
+ return MapTest(
+ )
+
+ def testMapTest(self):
+ """Test MapTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py
new file mode 100644
index 000000000000..ef77830aa192
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
+ """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MixedPropertiesAndAdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ uuid = '0',
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ map = {
+ 'key' : petstore_api.models.animal.Animal(
+ class_name = '0',
+ color = 'red', )
+ }
+ )
+ else :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ )
+
+ def testMixedPropertiesAndAdditionalPropertiesClass(self):
+ """Test MixedPropertiesAndAdditionalPropertiesClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_model200_response.py b/samples/client/petstore/python-legacy/test/test_model200_response.py
similarity index 74%
rename from samples/client/petstore/python-experimental/test/test_model200_response.py
rename to samples/client/petstore/python-legacy/test/test_model200_response.py
index 4012eaae3362..fab761f4edba 100644
--- a/samples/client/petstore/python-experimental/test/test_model200_response.py
+++ b/samples/client/petstore/python-legacy/test/test_model200_response.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.model200_response import Model200Response
+from petstore_api.models.model200_response import Model200Response # noqa: E501
+from petstore_api.rest import ApiException
class TestModel200Response(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testModel200Response(self):
"""Test Model200Response"""
# FIXME: construct object with mandatory attributes with example values
- # model = Model200Response() # noqa: E501
+ # model = petstore_api.models.model200_response.Model200Response() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_model_return.py b/samples/client/petstore/python-legacy/test/test_model_return.py
similarity index 75%
rename from samples/client/petstore/python-experimental/test/test_model_return.py
rename to samples/client/petstore/python-legacy/test/test_model_return.py
index 54c98b33cd66..ae3f15ee6b83 100644
--- a/samples/client/petstore/python-experimental/test/test_model_return.py
+++ b/samples/client/petstore/python-legacy/test/test_model_return.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.model_return import ModelReturn
+from petstore_api.models.model_return import ModelReturn # noqa: E501
+from petstore_api.rest import ApiException
class TestModelReturn(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testModelReturn(self):
"""Test ModelReturn"""
# FIXME: construct object with mandatory attributes with example values
- # model = ModelReturn() # noqa: E501
+ # model = petstore_api.models.model_return.ModelReturn() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_name.py b/samples/client/petstore/python-legacy/test/test_name.py
similarity index 77%
rename from samples/client/petstore/python-experimental/test/test_name.py
rename to samples/client/petstore/python-legacy/test/test_name.py
index 6a9be99d1a57..d6c72563991f 100644
--- a/samples/client/petstore/python-experimental/test/test_name.py
+++ b/samples/client/petstore/python-legacy/test/test_name.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.name import Name
+from petstore_api.models.name import Name # noqa: E501
+from petstore_api.rest import ApiException
class TestName(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testName(self):
"""Test Name"""
# FIXME: construct object with mandatory attributes with example values
- # model = Name() # noqa: E501
+ # model = petstore_api.models.name.Name() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_number_only.py b/samples/client/petstore/python-legacy/test/test_number_only.py
similarity index 76%
rename from samples/client/petstore/python-experimental/test/test_number_only.py
rename to samples/client/petstore/python-legacy/test/test_number_only.py
index 07aab1d78af7..7f6df65c8058 100644
--- a/samples/client/petstore/python-experimental/test/test_number_only.py
+++ b/samples/client/petstore/python-legacy/test/test_number_only.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.number_only import NumberOnly
+from petstore_api.models.number_only import NumberOnly # noqa: E501
+from petstore_api.rest import ApiException
class TestNumberOnly(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testNumberOnly(self):
"""Test NumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = NumberOnly() # noqa: E501
+ # model = petstore_api.models.number_only.NumberOnly() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-legacy/test/test_order.py
similarity index 73%
rename from samples/openapi3/client/petstore/python-experimental/test/test_order.py
rename to samples/client/petstore/python-legacy/test/test_order.py
index fd420b846a74..3e7d517d5c79 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_order.py
+++ b/samples/client/petstore/python-legacy/test/test_order.py
@@ -5,16 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
-import sys
+from __future__ import absolute_import
+
import unittest
import petstore_api
-from petstore_api.model.order import Order
+from petstore_api.models.order import Order # noqa: E501
+from petstore_api.rest import ApiException
class TestOrder(unittest.TestCase):
@@ -29,7 +31,7 @@ def tearDown(self):
def testOrder(self):
"""Test Order"""
# FIXME: construct object with mandatory attributes with example values
- # model = Order() # noqa: E501
+ # model = petstore_api.models.order.Order() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_outer_composite.py b/samples/client/petstore/python-legacy/test/test_outer_composite.py
similarity index 100%
rename from samples/client/petstore/python/test/test_outer_composite.py
rename to samples/client/petstore/python-legacy/test/test_outer_composite.py
diff --git a/samples/client/petstore/python/test/test_outer_enum.py b/samples/client/petstore/python-legacy/test/test_outer_enum.py
similarity index 100%
rename from samples/client/petstore/python/test/test_outer_enum.py
rename to samples/client/petstore/python-legacy/test/test_outer_enum.py
diff --git a/samples/client/petstore/python-legacy/test/test_pet.py b/samples/client/petstore/python-legacy/test/test_pet.py
new file mode 100644
index 000000000000..2e4a40d78b31
--- /dev/null
+++ b/samples/client/petstore/python-legacy/test/test_pet.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.pet import Pet # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestPet(unittest.TestCase):
+ """Pet unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Pet
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.pet.Pet() # noqa: E501
+ if include_optional :
+ return Pet(
+ id = 56,
+ category = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ name = 'doggie',
+ photo_urls = [
+ '0'
+ ],
+ tags = [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '0', )
+ ],
+ status = 'available'
+ )
+ else :
+ return Pet(
+ name = 'doggie',
+ photo_urls = [
+ '0'
+ ],
+ )
+
+ def testPet(self):
+ """Test Pet"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/client/petstore/python-legacy/test/test_pet_api.py
similarity index 86%
rename from samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py
rename to samples/client/petstore/python-legacy/test/test_pet_api.py
index d545f497297a..ffd3e25c4c64 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py
+++ b/samples/client/petstore/python-legacy/test/test_pet_api.py
@@ -5,22 +5,25 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.pet_api import PetApi # noqa: E501
+from petstore_api.rest import ApiException
class TestPetApi(unittest.TestCase):
"""PetApi unit test stubs"""
def setUp(self):
- self.api = PetApi() # noqa: E501
+ self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
def tearDown(self):
pass
@@ -81,13 +84,6 @@ def test_upload_file(self):
"""
pass
- def test_upload_file_with_required_file(self):
- """Test case for upload_file_with_required_file
-
- uploads an image (required) # noqa: E501
- """
- pass
-
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_read_only_first.py b/samples/client/petstore/python-legacy/test/test_read_only_first.py
similarity index 75%
rename from samples/client/petstore/python-experimental/test/test_read_only_first.py
rename to samples/client/petstore/python-legacy/test/test_read_only_first.py
index c2dcde240e77..2b647b83fc89 100644
--- a/samples/client/petstore/python-experimental/test/test_read_only_first.py
+++ b/samples/client/petstore/python-legacy/test/test_read_only_first.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.read_only_first import ReadOnlyFirst
+from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
+from petstore_api.rest import ApiException
class TestReadOnlyFirst(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testReadOnlyFirst(self):
"""Test ReadOnlyFirst"""
# FIXME: construct object with mandatory attributes with example values
- # model = ReadOnlyFirst() # noqa: E501
+ # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_special_model_name.py b/samples/client/petstore/python-legacy/test/test_special_model_name.py
similarity index 74%
rename from samples/client/petstore/python-experimental/test/test_special_model_name.py
rename to samples/client/petstore/python-legacy/test/test_special_model_name.py
index 6124525f5170..4edfec164f7d 100644
--- a/samples/client/petstore/python-experimental/test/test_special_model_name.py
+++ b/samples/client/petstore/python-legacy/test/test_special_model_name.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.special_model_name import SpecialModelName
+from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
+from petstore_api.rest import ApiException
class TestSpecialModelName(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testSpecialModelName(self):
"""Test SpecialModelName"""
# FIXME: construct object with mandatory attributes with example values
- # model = SpecialModelName() # noqa: E501
+ # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/client/petstore/python-legacy/test/test_store_api.py
similarity index 86%
rename from samples/openapi3/client/petstore/python-experimental/test/test_store_api.py
rename to samples/client/petstore/python-legacy/test/test_store_api.py
index 3680a34b42a0..37bf771d13a6 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py
+++ b/samples/client/petstore/python-legacy/test/test_store_api.py
@@ -5,22 +5,25 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.store_api import StoreApi # noqa: E501
+from petstore_api.rest import ApiException
class TestStoreApi(unittest.TestCase):
"""StoreApi unit test stubs"""
def setUp(self):
- self.api = StoreApi() # noqa: E501
+ self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/client/petstore/python-experimental/test/test_tag.py b/samples/client/petstore/python-legacy/test/test_tag.py
similarity index 77%
rename from samples/client/petstore/python-experimental/test/test_tag.py
rename to samples/client/petstore/python-legacy/test/test_tag.py
index 68a3b9046bf4..2c3c5157e718 100644
--- a/samples/client/petstore/python-experimental/test/test_tag.py
+++ b/samples/client/petstore/python-legacy/test/test_tag.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.tag import Tag
+from petstore_api.models.tag import Tag # noqa: E501
+from petstore_api.rest import ApiException
class TestTag(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testTag(self):
"""Test Tag"""
# FIXME: construct object with mandatory attributes with example values
- # model = Tag() # noqa: E501
+ # model = petstore_api.models.tag.Tag() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-legacy/test/test_type_holder_default.py
similarity index 56%
rename from samples/client/petstore/python-experimental/test/test_type_holder_default.py
rename to samples/client/petstore/python-legacy/test/test_type_holder_default.py
index f9c050b81a82..e23ab2a32fc7 100644
--- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py
+++ b/samples/client/petstore/python-legacy/test/test_type_holder_default.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.type_holder_default import TypeHolderDefault
+from petstore_api.models.type_holder_default import TypeHolderDefault # noqa: E501
+from petstore_api.rest import ApiException
class TestTypeHolderDefault(unittest.TestCase):
@@ -31,8 +32,15 @@ def testTypeHolderDefault(self):
"""Test TypeHolderDefault"""
# required_vars are set to None now until swagger-parser/swagger-core fixes
# https://github.com/swagger-api/swagger-parser/issues/971
- array_item = [1, 2, 3]
- model = TypeHolderDefault(array_item=array_item)
+ required_vars = ['number_item', 'integer_item', 'array_item']
+ sample_values = [5.67, 4, [-5, 2, -6]]
+ assigned_variables = {}
+ for index, required_var in enumerate(required_vars):
+ with self.assertRaises(ValueError):
+ model = TypeHolderDefault(**assigned_variables)
+ assigned_variables[required_var] = sample_values[index]
+ # assigned_variables is fully set, all required variables passed in
+ model = TypeHolderDefault(**assigned_variables)
self.assertEqual(model.string_item, 'what')
self.assertEqual(model.bool_item, True)
diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_example.py b/samples/client/petstore/python-legacy/test/test_type_holder_example.py
similarity index 74%
rename from samples/client/petstore/python-experimental/test/test_type_holder_example.py
rename to samples/client/petstore/python-legacy/test/test_type_holder_example.py
index e1ee7c368628..7a2621494857 100644
--- a/samples/client/petstore/python-experimental/test/test_type_holder_example.py
+++ b/samples/client/petstore/python-legacy/test/test_type_holder_example.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.type_holder_example import TypeHolderExample
+from petstore_api.models.type_holder_example import TypeHolderExample # noqa: E501
+from petstore_api.rest import ApiException
class TestTypeHolderExample(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testTypeHolderExample(self):
"""Test TypeHolderExample"""
# FIXME: construct object with mandatory attributes with example values
- # model = TypeHolderExample() # noqa: E501
+ # model = petstore_api.models.type_holder_example.TypeHolderExample() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_user.py b/samples/client/petstore/python-legacy/test/test_user.py
similarity index 77%
rename from samples/client/petstore/python-experimental/test/test_user.py
rename to samples/client/petstore/python-legacy/test/test_user.py
index 7241bb589c52..ad9386b6908e 100644
--- a/samples/client/petstore/python-experimental/test/test_user.py
+++ b/samples/client/petstore/python-legacy/test/test_user.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.user import User
+from petstore_api.models.user import User # noqa: E501
+from petstore_api.rest import ApiException
class TestUser(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testUser(self):
"""Test User"""
# FIXME: construct object with mandatory attributes with example values
- # model = User() # noqa: E501
+ # model = petstore_api.models.user.User() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/client/petstore/python-legacy/test/test_user_api.py
similarity index 90%
rename from samples/openapi3/client/petstore/python-experimental/test/test_user_api.py
rename to samples/client/petstore/python-legacy/test/test_user_api.py
index abf57b0733da..6e8aed4f18c7 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py
+++ b/samples/client/petstore/python-legacy/test/test_user_api.py
@@ -5,22 +5,25 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.user_api import UserApi # noqa: E501
+from petstore_api.rest import ApiException
class TestUserApi(unittest.TestCase):
"""UserApi unit test stubs"""
def setUp(self):
- self.api = UserApi() # noqa: E501
+ self.api = petstore_api.api.user_api.UserApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/client/petstore/python-experimental/test/test_xml_item.py b/samples/client/petstore/python-legacy/test/test_xml_item.py
similarity index 76%
rename from samples/client/petstore/python-experimental/test/test_xml_item.py
rename to samples/client/petstore/python-legacy/test/test_xml_item.py
index 4354664815ff..121f1ccb6623 100644
--- a/samples/client/petstore/python-experimental/test/test_xml_item.py
+++ b/samples/client/petstore/python-legacy/test/test_xml_item.py
@@ -5,17 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- The version of the OpenAPI document: 1.0.0
+ OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
-from petstore_api.model.xml_item import XmlItem
+from petstore_api.models.xml_item import XmlItem # noqa: E501
+from petstore_api.rest import ApiException
class TestXmlItem(unittest.TestCase):
@@ -30,7 +31,7 @@ def tearDown(self):
def testXmlItem(self):
"""Test XmlItem"""
# FIXME: construct object with mandatory attributes with example values
- # model = XmlItem() # noqa: E501
+ # model = petstore_api.models.xml_item.XmlItem() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test_python2.sh b/samples/client/petstore/python-legacy/test_python2.sh
similarity index 100%
rename from samples/client/petstore/python/test_python2.sh
rename to samples/client/petstore/python-legacy/test_python2.sh
diff --git a/samples/client/petstore/python/test_python2_and_3.sh b/samples/client/petstore/python-legacy/test_python2_and_3.sh
similarity index 100%
rename from samples/client/petstore/python/test_python2_and_3.sh
rename to samples/client/petstore/python-legacy/test_python2_and_3.sh
diff --git a/samples/client/petstore/python-experimental/testfiles/foo.png b/samples/client/petstore/python-legacy/testfiles/foo.png
similarity index 100%
rename from samples/client/petstore/python-experimental/testfiles/foo.png
rename to samples/client/petstore/python-legacy/testfiles/foo.png
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/__init__.py b/samples/client/petstore/python-legacy/tests/__init__.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/__init__.py
rename to samples/client/petstore/python-legacy/tests/__init__.py
diff --git a/samples/client/petstore/python-experimental/tests/test_api_client.py b/samples/client/petstore/python-legacy/tests/test_api_client.py
similarity index 73%
rename from samples/client/petstore/python-experimental/tests/test_api_client.py
rename to samples/client/petstore/python-legacy/tests/test_api_client.py
index c249bf1fc5e8..216e1f9ec1b4 100644
--- a/samples/client/petstore/python-experimental/tests/test_api_client.py
+++ b/samples/client/petstore/python-legacy/tests/test_api_client.py
@@ -29,7 +29,6 @@ def setUp(self):
def test_configuration(self):
config = petstore_api.Configuration()
- config.host = 'http://localhost/'
config.api_key['api_key'] = '123456'
config.api_key_prefix['api_key'] = 'PREFIX'
@@ -46,7 +45,7 @@ def test_configuration(self):
self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key'])
# update parameters based on auth setting
- client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
+ client.update_params_for_auth(header_params, query_params, auth_settings)
# test api key auth
self.assertEqual(header_params['test1'], 'value1')
@@ -57,29 +56,6 @@ def test_configuration(self):
self.assertEqual('test_username', client.configuration.username)
self.assertEqual('test_password', client.configuration.password)
- # test api key without prefix
- config.api_key['api_key'] = '123456'
- config.api_key_prefix['api_key'] = None
- # update parameters based on auth setting
- client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
- self.assertEqual(header_params['api_key'], '123456')
-
- # test api key with empty prefix
- config.api_key['api_key'] = '123456'
- config.api_key_prefix['api_key'] = ''
- # update parameters based on auth setting
- client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
- self.assertEqual(header_params['api_key'], '123456')
-
- # test api key with prefix specified in the api_key, useful when the prefix
- # must include '=' sign followed by the API key secret without space.
- config.api_key['api_key'] = 'PREFIX=123456'
- config.api_key_prefix['api_key'] = None
- # update parameters based on auth setting
- client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
- self.assertEqual(header_params['api_key'], 'PREFIX=123456')
-
-
def test_select_header_accept(self):
accepts = ['APPLICATION/JSON', 'APPLICATION/XML']
accept = self.api_client.select_header_accept(accepts)
@@ -166,27 +142,23 @@ def test_sanitize_for_serialization(self):
# model
pet_dict = {"id": 1, "name": "monkey",
"category": {"id": 1, "name": "test category"},
- "tags": [{"id": 1, "fullName": "test tag1"},
- {"id": 2, "fullName": "test tag2"}],
+ "tags": [{"id": 1, "name": "test tag1"},
+ {"id": 2, "name": "test tag2"}],
"status": "available",
"photoUrls": ["http://foo.bar.com/3",
"http://foo.bar.com/4"]}
- from petstore_api.model.pet import Pet
- from petstore_api.model.category import Category
- from petstore_api.model.tag import Tag
- from petstore_api.model.string_boolean_map import StringBooleanMap
- pet = Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"])
+ pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"])
pet.id = pet_dict["id"]
- cate = Category()
+ cate = petstore_api.Category()
cate.id = pet_dict["category"]["id"]
cate.name = pet_dict["category"]["name"]
pet.category = cate
- tag1 = Tag()
+ tag1 = petstore_api.Tag()
tag1.id = pet_dict["tags"][0]["id"]
- tag1.full_name = pet_dict["tags"][0]["fullName"]
- tag2 = Tag()
+ tag1.name = pet_dict["tags"][0]["name"]
+ tag2 = petstore_api.Tag()
tag2.id = pet_dict["tags"][1]["id"]
- tag2.full_name = pet_dict["tags"][1]["fullName"]
+ tag2.name = pet_dict["tags"][1]["name"]
pet.tags = [tag1, tag2]
pet.status = pet_dict["status"]
@@ -200,12 +172,6 @@ def test_sanitize_for_serialization(self):
result = self.api_client.sanitize_for_serialization(data)
self.assertEqual(result, list_of_pet_dict)
- # model with additional proerties
- model_dict = {'some_key': True}
- model = StringBooleanMap(**model_dict)
- result = self.api_client.sanitize_for_serialization(model)
- self.assertEqual(result, model_dict)
-
def test_context_manager_closes_threadpool(self):
with petstore_api.ApiClient() as client:
self.assertIsNotNone(client.pool)
diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-legacy/tests/test_api_exception.py
similarity index 72%
rename from samples/client/petstore/python-experimental/tests/test_api_exception.py
rename to samples/client/petstore/python-legacy/tests/test_api_exception.py
index 0d0771b57850..b076628c0a0b 100644
--- a/samples/client/petstore/python-experimental/tests/test_api_exception.py
+++ b/samples/client/petstore/python-legacy/tests/test_api_exception.py
@@ -15,6 +15,7 @@
import unittest
import petstore_api
+from petstore_api.rest import ApiException
from .util import id_gen
@@ -22,19 +23,17 @@ class ApiExceptionTests(unittest.TestCase):
def setUp(self):
self.api_client = petstore_api.ApiClient()
- from petstore_api.api.pet_api import PetApi
- self.pet_api = PetApi(self.api_client)
+ self.pet_api = petstore_api.PetApi(self.api_client)
self.setUpModels()
def setUpModels(self):
- from petstore_api.model import category, tag, pet
- self.category = category.Category()
+ self.category = petstore_api.Category()
self.category.id = id_gen()
self.category.name = "dog"
- self.tag = tag.Tag()
+ self.tag = petstore_api.Tag()
self.tag.id = id_gen()
- self.tag.full_name = "blank"
- self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.tag.name = "blank"
+ self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
self.pet.id = id_gen()
self.pet.status = "sold"
self.pet.category = self.category
@@ -44,12 +43,12 @@ def test_404_error(self):
self.pet_api.add_pet(self.pet)
self.pet_api.delete_pet(pet_id=self.pet.id)
- with self.checkRaiseRegex(petstore_api.ApiException, "Pet not found"):
+ with self.checkRaiseRegex(ApiException, "Pet not found"):
self.pet_api.get_pet_by_id(pet_id=self.pet.id)
try:
self.pet_api.get_pet_by_id(pet_id=self.pet.id)
- except petstore_api.ApiException as e:
+ except ApiException as e:
self.assertEqual(e.status, 404)
self.assertEqual(e.reason, "Not Found")
self.checkRegex(e.body, "Pet not found")
@@ -57,18 +56,20 @@ def test_404_error(self):
def test_500_error(self):
self.pet_api.add_pet(self.pet)
- with self.checkRaiseRegex(petstore_api.ApiException, "Internal Server Error"):
+ with self.checkRaiseRegex(ApiException, "Internal Server Error"):
self.pet_api.upload_file(
pet_id=self.pet.id,
- additional_metadata="special"
+ additional_metadata="special",
+ file=None
)
try:
self.pet_api.upload_file(
pet_id=self.pet.id,
- additional_metadata="special"
+ additional_metadata="special",
+ file=None
)
- except petstore_api.ApiException as e:
+ except ApiException as e:
self.assertEqual(e.status, 500)
self.assertEqual(e.reason, "Internal Server Error")
self.checkRegex(e.body, "Error 500 Internal Server Error")
diff --git a/samples/client/petstore/python/tests/test_configuration.py b/samples/client/petstore/python-legacy/tests/test_configuration.py
similarity index 100%
rename from samples/client/petstore/python/tests/test_configuration.py
rename to samples/client/petstore/python-legacy/tests/test_configuration.py
diff --git a/samples/client/petstore/python-legacy/tests/test_deserialization.py b/samples/client/petstore/python-legacy/tests/test_deserialization.py
new file mode 100644
index 000000000000..6c4e083d1cd7
--- /dev/null
+++ b/samples/client/petstore/python-legacy/tests/test_deserialization.py
@@ -0,0 +1,241 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd OpenAPIPetstore-python
+$ nosetests -v
+"""
+from collections import namedtuple
+import json
+import os
+import time
+import unittest
+import datetime
+
+import petstore_api
+
+
+MockResponse = namedtuple('MockResponse', 'data')
+
+
+class DeserializationTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.deserialize = self.api_client.deserialize
+
+ def test_enum_test(self):
+ """ deserialize dict(str, Enum_Test) """
+ data = {
+ 'enum_test': {
+ "enum_string": "UPPER",
+ "enum_string_required": "lower",
+ "enum_integer": 1,
+ "enum_number": 1.1,
+ "outerEnum": "placed"
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'dict(str, EnumTest)')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest))
+ self.assertEqual(deserialized['enum_test'],
+ petstore_api.EnumTest(enum_string="UPPER",
+ enum_string_required="lower",
+ enum_integer=1,
+ enum_number=1.1,
+ outer_enum=petstore_api.OuterEnum.PLACED))
+
+ def test_deserialize_dict_str_pet(self):
+ """ deserialize dict(str, Pet) """
+ data = {
+ 'pet': {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'dict(str, Pet)')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet))
+
+ def test_deserialize_dict_str_dog(self):
+ """ deserialize dict(str, Dog), use discriminator"""
+ data = {
+ 'dog': {
+ "id": 0,
+ "className": "Dog",
+ "color": "white",
+ "bread": "Jack Russel Terrier"
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'dict(str, Animal)')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog))
+
+ def test_deserialize_dict_str_int(self):
+ """ deserialize dict(str, int) """
+ data = {
+ 'integer': 1
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'dict(str, int)')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['integer'], int))
+
+ def test_deserialize_str(self):
+ """ deserialize str """
+ data = "test str"
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "str")
+ self.assertTrue(isinstance(deserialized, str))
+
+ def test_deserialize_date(self):
+ """ deserialize date """
+ data = "1997-07-16"
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "date")
+ self.assertTrue(isinstance(deserialized, datetime.date))
+
+ def test_deserialize_datetime(self):
+ """ deserialize datetime """
+ data = "1997-07-16T19:20:30.45+01:00"
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "datetime")
+ self.assertTrue(isinstance(deserialized, datetime.datetime))
+
+ def test_deserialize_pet(self):
+ """ deserialize pet """
+ data = {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "Pet")
+ self.assertTrue(isinstance(deserialized, petstore_api.Pet))
+ self.assertEqual(deserialized.id, 0)
+ self.assertEqual(deserialized.name, "doggie")
+ self.assertTrue(isinstance(deserialized.category, petstore_api.Category))
+ self.assertEqual(deserialized.category.name, "string")
+ self.assertTrue(isinstance(deserialized.tags, list))
+ self.assertEqual(deserialized.tags[0].name, "string")
+
+ def test_deserialize_list_of_pet(self):
+ """ deserialize list[Pet] """
+ data = [
+ {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie0",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ },
+ {
+ "id": 1,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie1",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }]
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "list[Pet]")
+ self.assertTrue(isinstance(deserialized, list))
+ self.assertTrue(isinstance(deserialized[0], petstore_api.Pet))
+ self.assertEqual(deserialized[0].id, 0)
+ self.assertEqual(deserialized[1].id, 1)
+ self.assertEqual(deserialized[0].name, "doggie0")
+ self.assertEqual(deserialized[1].name, "doggie1")
+
+ def test_deserialize_nested_dict(self):
+ """ deserialize dict(str, dict(str, int)) """
+ data = {
+ "foo": {
+ "bar": 1
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "dict(str, dict(str, int))")
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized["foo"], dict))
+ self.assertTrue(isinstance(deserialized["foo"]["bar"], int))
+
+ def test_deserialize_nested_list(self):
+ """ deserialize list[list[str]] """
+ data = [["foo"]]
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "list[list[str]]")
+ self.assertTrue(isinstance(deserialized, list))
+ self.assertTrue(isinstance(deserialized[0], list))
+ self.assertTrue(isinstance(deserialized[0][0], str))
+
+ def test_deserialize_none(self):
+ """ deserialize None """
+ response = MockResponse(data=json.dumps(None))
+
+ deserialized = self.deserialize(response, "datetime")
+ self.assertIsNone(deserialized)
diff --git a/samples/client/petstore/python/tests/test_enum_arrays.py b/samples/client/petstore/python-legacy/tests/test_enum_arrays.py
similarity index 100%
rename from samples/client/petstore/python/tests/test_enum_arrays.py
rename to samples/client/petstore/python-legacy/tests/test_enum_arrays.py
diff --git a/samples/client/petstore/python/tests/test_map_test.py b/samples/client/petstore/python-legacy/tests/test_map_test.py
similarity index 100%
rename from samples/client/petstore/python/tests/test_map_test.py
rename to samples/client/petstore/python-legacy/tests/test_map_test.py
diff --git a/samples/client/petstore/python/tests/test_order_model.py b/samples/client/petstore/python-legacy/tests/test_order_model.py
similarity index 100%
rename from samples/client/petstore/python/tests/test_order_model.py
rename to samples/client/petstore/python-legacy/tests/test_order_model.py
diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-legacy/tests/test_pet_api.py
similarity index 57%
rename from samples/client/petstore/python-experimental/tests/test_pet_api.py
rename to samples/client/petstore/python-legacy/tests/test_pet_api.py
index 38d7a1cc0b82..a7b47bdc5670 100644
--- a/samples/client/petstore/python-experimental/tests/test_pet_api.py
+++ b/samples/client/petstore/python-legacy/tests/test_pet_api.py
@@ -11,37 +11,20 @@
$ nosetests -v
"""
-from collections import namedtuple
-import json
import os
import unittest
import petstore_api
from petstore_api import Configuration
-from petstore_api.rest import (
- RESTClientObject,
- RESTResponse
-)
-
-import six
-
-from petstore_api.exceptions import (
- ApiException,
- ApiValueError,
- ApiTypeError,
-)
-from petstore_api.api.pet_api import PetApi
-from petstore_api.model import pet
+from petstore_api.rest import ApiException
+
from .util import id_gen
-import urllib3
+import json
-if six.PY3:
- from unittest.mock import patch
-else:
- from mock import patch
+import urllib3
-HOST = 'http://localhost/v2'
+HOST = 'http://petstore.swagger.io/v2'
class TimeoutWithEqual(urllib3.Timeout):
@@ -76,19 +59,18 @@ def setUp(self):
config.host = HOST
config.access_token = 'ACCESS_TOKEN'
self.api_client = petstore_api.ApiClient(config)
- self.pet_api = PetApi(self.api_client)
+ self.pet_api = petstore_api.PetApi(self.api_client)
self.setUpModels()
self.setUpFiles()
def setUpModels(self):
- from petstore_api.model import category, tag
- self.category = category.Category()
+ self.category = petstore_api.Category()
self.category.id = id_gen()
self.category.name = "dog"
- self.tag = tag.Tag()
+ self.tag = petstore_api.Tag()
self.tag.id = id_gen()
self.tag.name = "python-pet-tag"
- self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
self.pet.id = id_gen()
self.pet.status = "sold"
self.pet.category = self.category
@@ -97,6 +79,7 @@ def setUpModels(self):
def setUpFiles(self):
self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
self.test_file_dir = os.path.realpath(self.test_file_dir)
+ self.foo = os.path.join(self.test_file_dir, "foo.png")
def test_preload_content_flag(self):
self.pet_api.add_pet(self.pet)
@@ -118,42 +101,17 @@ def test_preload_content_flag(self):
resp.close()
resp.release_conn()
- def test_config(self):
- config = Configuration(host=HOST)
- self.assertIsNotNone(config.get_host_settings())
- self.assertEqual(config.get_basic_auth_token(),
- urllib3.util.make_headers(basic_auth=":").get('authorization'))
- # No authentication scheme has been configured at this point, so auth_settings()
- # should return an empty list.
- self.assertEqual(len(config.auth_settings()), 0)
- # Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters.
- config.access_token = 'MY-ACCESS_TOKEN'
- self.assertEqual(len(config.auth_settings()), 1)
- self.assertIn("petstore_auth", config.auth_settings().keys())
- config.username = "user"
- config.password = "password"
- self.assertEqual(
- config.get_basic_auth_token(),
- urllib3.util.make_headers(basic_auth="user:password").get('authorization'))
- self.assertEqual(len(config.auth_settings()), 2)
- self.assertIn("petstore_auth", config.auth_settings().keys())
- self.assertIn("http_basic_test", config.auth_settings().keys())
- config.username = None
- config.password = None
- self.assertEqual(len(config.auth_settings()), 1)
- self.assertIn("petstore_auth", config.auth_settings().keys())
-
def test_timeout(self):
mock_pool = MockPoolManager(self)
self.api_client.rest_client.pool_manager = mock_pool
- mock_pool.expect_request('POST', 'http://localhost/v2/pet',
+ mock_pool.expect_request('POST', HOST + '/pet',
body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
headers={'Content-Type': 'application/json',
'Authorization': 'Bearer ACCESS_TOKEN',
'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
preload_content=True, timeout=TimeoutWithEqual(total=5))
- mock_pool.expect_request('POST', 'http://localhost/v2/pet',
+ mock_pool.expect_request('POST', HOST + '/pet',
body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
headers={'Content-Type': 'application/json',
'Authorization': 'Bearer ACCESS_TOKEN',
@@ -163,9 +121,33 @@ def test_timeout(self):
self.pet_api.add_pet(self.pet, _request_timeout=5)
self.pet_api.add_pet(self.pet, _request_timeout=(1, 2))
+ def test_auth_settings(self):
+ mock_pool = MockPoolManager(self)
+ self.api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.expect_request('POST', HOST + '/pet',
+ body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
+ headers={'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ACCESS_TOKEN',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
+ headers={'Content-Type': 'application/json',
+ 'Authorization': 'Prefix ANOTHER_TOKEN',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ self.pet_api.add_pet(self.pet, _request_auth=None)
+ self.pet_api.add_pet(self.pet, _request_auth={
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': 'Prefix ANOTHER_TOKEN'
+ })
+
def test_separate_default_client_instances(self):
- pet_api = PetApi()
- pet_api2 = PetApi()
+ pet_api = petstore_api.PetApi()
+ pet_api2 = petstore_api.PetApi()
self.assertNotEqual(pet_api.api_client, pet_api2.api_client)
pet_api.api_client.user_agent = 'api client 3'
@@ -174,8 +156,8 @@ def test_separate_default_client_instances(self):
self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent)
def test_separate_default_config_instances(self):
- pet_api = PetApi()
- pet_api2 = PetApi()
+ pet_api = petstore_api.PetApi()
+ pet_api2 = petstore_api.PetApi()
self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration)
pet_api.api_client.configuration.host = 'somehost'
@@ -189,7 +171,7 @@ def test_async_request(self):
thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
result = thread.get()
- self.assertIsInstance(result, pet.Pet)
+ self.assertIsInstance(result, petstore_api.Pet)
def test_async_with_result(self):
self.pet_api.add_pet(self.pet, async_req=False)
@@ -206,17 +188,16 @@ def test_async_with_result(self):
def test_async_with_http_info(self):
self.pet_api.add_pet(self.pet)
- thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True,
- _return_http_data_only=False)
+ 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, pet.Pet)
+ self.assertIsInstance(data, petstore_api.Pet)
self.assertEqual(status, 200)
def test_async_exception(self):
self.pet_api.add_pet(self.pet)
- thread = self.pet_api.get_pet_by_id(-9999999999999, async_req=True)
+ thread = self.pet_api.get_pet_by_id("-9999999999999", async_req=True)
exception = None
try:
@@ -239,10 +220,7 @@ def test_add_pet_and_get_pet_by_id(self):
def test_add_pet_and_get_pet_by_id_with_http_info(self):
self.pet_api.add_pet(self.pet)
- fetched = self.pet_api.get_pet_by_id(
- pet_id=self.pet.id,
- _return_http_data_only=False
- )
+ fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id)
self.assertIsNotNone(fetched)
self.assertEqual(self.pet.id, fetched[0].id)
self.assertIsNotNone(fetched[0].category)
@@ -289,108 +267,21 @@ def test_update_pet_with_form(self):
def test_upload_file(self):
# upload file with form parameter
- file_path1 = os.path.join(self.test_file_dir, "1px_pic1.png")
- file_path2 = os.path.join(self.test_file_dir, "1px_pic2.png")
try:
- file = open(file_path1, "rb")
additional_metadata = "special"
self.pet_api.upload_file(
pet_id=self.pet.id,
additional_metadata=additional_metadata,
- file=file
+ file=self.foo
)
except ApiException as e:
self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
- finally:
- file.close()
-
- # upload only one file
- try:
- file = open(file_path1, "rb")
- self.pet_api.upload_file(pet_id=self.pet.id, file=file)
- except ApiException as e:
- self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
- finally:
- file.close()
- # upload multiple files
- HTTPResponse = namedtuple(
- 'urllib3_response_HTTPResponse',
- ['status', 'reason', 'data', 'getheaders', 'getheader']
- )
- headers = {}
- def get_headers():
- return headers
- def get_header(name, default=None):
- return headers.get(name, default)
- api_respponse = {
- 'code': 200,
- 'type': 'blah',
- 'message': 'file upload succeeded'
- }
- http_response = HTTPResponse(
- status=200,
- reason='OK',
- data=json.dumps(api_respponse).encode('utf-8'),
- getheaders=get_headers,
- getheader=get_header
- )
- mock_response = RESTResponse(http_response)
+ # upload only file
try:
- file1 = open(file_path1, "rb")
- file2 = open(file_path2, "rb")
- with patch.object(RESTClientObject, 'request') as mock_method:
- mock_method.return_value = mock_response
- res = self.pet_api.upload_file(
- pet_id=684696917, files=[file1, file2])
- mock_method.assert_called_with(
- 'POST',
- 'http://localhost/v2/pet/684696917/uploadImage',
- _preload_content=True,
- _request_timeout=None,
- body=None,
- headers={
- 'Accept': 'application/json',
- 'Content-Type': 'multipart/form-data',
- 'User-Agent': 'OpenAPI-Generator/1.0.0/python',
- 'Authorization': 'Bearer ACCESS_TOKEN'
- },
- post_params=[
- ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')),
- ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png'))
- ],
- query_params=[]
- )
+ self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo)
except ApiException as e:
self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
- finally:
- file1.close()
- file2.close()
-
- # passing in an array of files to when file only allows one
- # raises an exceptions
- try:
- file = open(file_path1, "rb")
- with self.assertRaises(ApiTypeError) as exc:
- self.pet_api.upload_file(pet_id=self.pet.id, file=[file])
- finally:
- file.close()
-
- # passing in a single file when an array of file is required
- # raises an exception
- try:
- file = open(file_path1, "rb")
- with self.assertRaises(ApiTypeError) as exc:
- self.pet_api.upload_file(pet_id=self.pet.id, files=file)
- finally:
- file.close()
-
- # passing in a closed file raises an exception
- with self.assertRaises(ApiValueError) as exc:
- file = open(file_path1, "rb")
- file.close()
- self.pet_api.upload_file(pet_id=self.pet.id, file=file)
-
def test_delete_pet(self):
self.pet_api.add_pet(self.pet)
diff --git a/samples/client/petstore/python/tests/test_pet_model.py b/samples/client/petstore/python-legacy/tests/test_pet_model.py
similarity index 100%
rename from samples/client/petstore/python/tests/test_pet_model.py
rename to samples/client/petstore/python-legacy/tests/test_pet_model.py
diff --git a/samples/client/petstore/python-experimental/tests/test_store_api.py b/samples/client/petstore/python-legacy/tests/test_store_api.py
similarity index 84%
rename from samples/client/petstore/python-experimental/tests/test_store_api.py
rename to samples/client/petstore/python-legacy/tests/test_store_api.py
index a7c1d5dd6670..1817477aba69 100644
--- a/samples/client/petstore/python-experimental/tests/test_store_api.py
+++ b/samples/client/petstore/python-legacy/tests/test_store_api.py
@@ -14,13 +14,13 @@
import unittest
import petstore_api
-from petstore_api.api.store_api import StoreApi
+from petstore_api.rest import ApiException
class StoreApiTests(unittest.TestCase):
def setUp(self):
- self.store_api = StoreApi()
+ self.store_api = petstore_api.StoreApi()
def tearDown(self):
# sleep 1 sec between two every 2 tests
diff --git a/samples/client/petstore/python-experimental/tests/util.py b/samples/client/petstore/python-legacy/tests/util.py
similarity index 100%
rename from samples/client/petstore/python-experimental/tests/util.py
rename to samples/client/petstore/python-legacy/tests/util.py
diff --git a/samples/client/petstore/python-experimental/tox.ini b/samples/client/petstore/python-legacy/tox.ini
similarity index 87%
rename from samples/client/petstore/python-experimental/tox.ini
rename to samples/client/petstore/python-legacy/tox.ini
index 8989fc3c4d96..169d895329bf 100644
--- a/samples/client/petstore/python-experimental/tox.ini
+++ b/samples/client/petstore/python-legacy/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py3
+envlist = py27, py3
[testenv]
deps=-r{toxinidir}/requirements.txt
diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md
index 1cfb40e579e7..8f9d03589bc7 100644
--- a/samples/client/petstore/python-tornado/README.md
+++ b/samples/client/petstore/python-tornado/README.md
@@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientCodegen
+- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen
## Requirements.
diff --git a/samples/client/petstore/python/.gitlab-ci.yml b/samples/client/petstore/python/.gitlab-ci.yml
index 142ce3712ed0..611e425676ee 100644
--- a/samples/client/petstore/python/.gitlab-ci.yml
+++ b/samples/client/petstore/python/.gitlab-ci.yml
@@ -3,31 +3,22 @@
stages:
- test
-.nosetest:
+.tests:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
-nosetest-2.7:
- extends: .nosetest
- image: python:2.7-alpine
-nosetest-3.3:
- extends: .nosetest
- image: python:3.3-alpine
-nosetest-3.4:
- extends: .nosetest
- image: python:3.4-alpine
-nosetest-3.5:
- extends: .nosetest
+test-3.5:
+ extends: .tests
image: python:3.5-alpine
-nosetest-3.6:
- extends: .nosetest
+test-3.6:
+ extends: .tests
image: python:3.6-alpine
-nosetest-3.7:
- extends: .nosetest
+test-3.7:
+ extends: .tests
image: python:3.7-alpine
-nosetest-3.8:
- extends: .nosetest
+test-3.8:
+ extends: .tests
image: python:3.8-alpine
diff --git a/samples/client/petstore/python/.openapi-generator/FILES b/samples/client/petstore/python/.openapi-generator/FILES
index 4beeb0e176e3..b8f4347feb8c 100644
--- a/samples/client/petstore/python/.openapi-generator/FILES
+++ b/samples/client/petstore/python/.openapi-generator/FILES
@@ -11,17 +11,24 @@ docs/AdditionalPropertiesNumber.md
docs/AdditionalPropertiesObject.md
docs/AdditionalPropertiesString.md
docs/Animal.md
+docs/AnimalFarm.md
docs/AnotherFakeApi.md
docs/ApiResponse.md
docs/ArrayOfArrayOfNumberOnly.md
docs/ArrayOfNumberOnly.md
docs/ArrayTest.md
-docs/BigCat.md
-docs/BigCatAllOf.md
docs/Capitalization.md
docs/Cat.md
docs/CatAllOf.md
docs/Category.md
+docs/Child.md
+docs/ChildAllOf.md
+docs/ChildCat.md
+docs/ChildCatAllOf.md
+docs/ChildDog.md
+docs/ChildDogAllOf.md
+docs/ChildLizard.md
+docs/ChildLizardAllOf.md
docs/ClassModel.md
docs/Client.md
docs/Dog.md
@@ -34,6 +41,8 @@ docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
docs/FormatTest.md
+docs/Grandparent.md
+docs/GrandparentAnimal.md
docs/HasOnlyReadOnly.md
docs/List.md
docs/MapTest.md
@@ -42,14 +51,20 @@ docs/Model200Response.md
docs/ModelReturn.md
docs/Name.md
docs/NumberOnly.md
+docs/NumberWithValidations.md
+docs/ObjectModelWithRefProps.md
docs/Order.md
-docs/OuterComposite.md
-docs/OuterEnum.md
+docs/Parent.md
+docs/ParentAllOf.md
+docs/ParentPet.md
docs/Pet.md
docs/PetApi.md
+docs/Player.md
docs/ReadOnlyFirst.md
docs/SpecialModelName.md
docs/StoreApi.md
+docs/StringBooleanMap.md
+docs/StringEnum.md
docs/Tag.md
docs/TypeHolderDefault.md
docs/TypeHolderExample.md
@@ -66,57 +81,75 @@ petstore_api/api/pet_api.py
petstore_api/api/store_api.py
petstore_api/api/user_api.py
petstore_api/api_client.py
+petstore_api/apis/__init__.py
petstore_api/configuration.py
petstore_api/exceptions.py
+petstore_api/model/additional_properties_any_type.py
+petstore_api/model/additional_properties_array.py
+petstore_api/model/additional_properties_boolean.py
+petstore_api/model/additional_properties_class.py
+petstore_api/model/additional_properties_integer.py
+petstore_api/model/additional_properties_number.py
+petstore_api/model/additional_properties_object.py
+petstore_api/model/additional_properties_string.py
+petstore_api/model/animal.py
+petstore_api/model/animal_farm.py
+petstore_api/model/api_response.py
+petstore_api/model/array_of_array_of_number_only.py
+petstore_api/model/array_of_number_only.py
+petstore_api/model/array_test.py
+petstore_api/model/capitalization.py
+petstore_api/model/cat.py
+petstore_api/model/cat_all_of.py
+petstore_api/model/category.py
+petstore_api/model/child.py
+petstore_api/model/child_all_of.py
+petstore_api/model/child_cat.py
+petstore_api/model/child_cat_all_of.py
+petstore_api/model/child_dog.py
+petstore_api/model/child_dog_all_of.py
+petstore_api/model/child_lizard.py
+petstore_api/model/child_lizard_all_of.py
+petstore_api/model/class_model.py
+petstore_api/model/client.py
+petstore_api/model/dog.py
+petstore_api/model/dog_all_of.py
+petstore_api/model/enum_arrays.py
+petstore_api/model/enum_class.py
+petstore_api/model/enum_test.py
+petstore_api/model/file.py
+petstore_api/model/file_schema_test_class.py
+petstore_api/model/format_test.py
+petstore_api/model/grandparent.py
+petstore_api/model/grandparent_animal.py
+petstore_api/model/has_only_read_only.py
+petstore_api/model/list.py
+petstore_api/model/map_test.py
+petstore_api/model/mixed_properties_and_additional_properties_class.py
+petstore_api/model/model200_response.py
+petstore_api/model/model_return.py
+petstore_api/model/name.py
+petstore_api/model/number_only.py
+petstore_api/model/number_with_validations.py
+petstore_api/model/object_model_with_ref_props.py
+petstore_api/model/order.py
+petstore_api/model/parent.py
+petstore_api/model/parent_all_of.py
+petstore_api/model/parent_pet.py
+petstore_api/model/pet.py
+petstore_api/model/player.py
+petstore_api/model/read_only_first.py
+petstore_api/model/special_model_name.py
+petstore_api/model/string_boolean_map.py
+petstore_api/model/string_enum.py
+petstore_api/model/tag.py
+petstore_api/model/type_holder_default.py
+petstore_api/model/type_holder_example.py
+petstore_api/model/user.py
+petstore_api/model/xml_item.py
+petstore_api/model_utils.py
+petstore_api/models/__init__.py
petstore_api/models/__init__.py
-petstore_api/models/additional_properties_any_type.py
-petstore_api/models/additional_properties_array.py
-petstore_api/models/additional_properties_boolean.py
-petstore_api/models/additional_properties_class.py
-petstore_api/models/additional_properties_integer.py
-petstore_api/models/additional_properties_number.py
-petstore_api/models/additional_properties_object.py
-petstore_api/models/additional_properties_string.py
-petstore_api/models/animal.py
-petstore_api/models/api_response.py
-petstore_api/models/array_of_array_of_number_only.py
-petstore_api/models/array_of_number_only.py
-petstore_api/models/array_test.py
-petstore_api/models/big_cat.py
-petstore_api/models/big_cat_all_of.py
-petstore_api/models/capitalization.py
-petstore_api/models/cat.py
-petstore_api/models/cat_all_of.py
-petstore_api/models/category.py
-petstore_api/models/class_model.py
-petstore_api/models/client.py
-petstore_api/models/dog.py
-petstore_api/models/dog_all_of.py
-petstore_api/models/enum_arrays.py
-petstore_api/models/enum_class.py
-petstore_api/models/enum_test.py
-petstore_api/models/file.py
-petstore_api/models/file_schema_test_class.py
-petstore_api/models/format_test.py
-petstore_api/models/has_only_read_only.py
-petstore_api/models/list.py
-petstore_api/models/map_test.py
-petstore_api/models/mixed_properties_and_additional_properties_class.py
-petstore_api/models/model200_response.py
-petstore_api/models/model_return.py
-petstore_api/models/name.py
-petstore_api/models/number_only.py
-petstore_api/models/order.py
-petstore_api/models/outer_composite.py
-petstore_api/models/outer_enum.py
-petstore_api/models/pet.py
-petstore_api/models/read_only_first.py
-petstore_api/models/special_model_name.py
-petstore_api/models/tag.py
-petstore_api/models/type_holder_default.py
-petstore_api/models/type_holder_example.py
-petstore_api/models/user.py
-petstore_api/models/xml_item.py
petstore_api/rest.py
requirements.txt
setup.cfg
diff --git a/samples/client/petstore/python/.travis.yml b/samples/client/petstore/python/.travis.yml
index fcd7e31c7ccf..f931f0f74b96 100644
--- a/samples/client/petstore/python/.travis.yml
+++ b/samples/client/petstore/python/.travis.yml
@@ -1,10 +1,6 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- - "2.7"
- - "3.2"
- - "3.3"
- - "3.4"
- "3.5"
- "3.6"
- "3.7"
diff --git a/samples/client/petstore/python/Makefile b/samples/client/petstore/python/Makefile
index ba5c5e73c63c..a6bbba4a434f 100644
--- a/samples/client/petstore/python/Makefile
+++ b/samples/client/petstore/python/Makefile
@@ -3,7 +3,7 @@
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
-VENV=.venv
+VENV=venv
clean:
rm -rf $(REQUIREMENTS_OUT)
@@ -15,7 +15,4 @@ clean:
find . -name "__pycache__" -delete
test: clean
- bash ./test_python2.sh
-
-test-all: clean
- bash ./test_python2_and_3.sh
+ bash ./test_python.sh
diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md
index 1cfb40e579e7..2d85178cd3ea 100644
--- a/samples/client/petstore/python/README.md
+++ b/samples/client/petstore/python/README.md
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
## Requirements.
-Python 2.7 and 3.4+
+Python >= 3.5
## Installation & Usage
### pip install
@@ -45,13 +45,12 @@ import petstore_api
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
from pprint import pprint
-
+from petstore_api.api import another_fake_api
+from petstore_api.model.client import Client
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
@@ -63,16 +62,17 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.AnotherFakeApi(api_client)
- body = petstore_api.Client() # Client | client model
+ api_instance = another_fake_api.AnotherFakeApi(api_client)
+ body = Client(
+ client="client_example",
+ ) # Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
-
```
## Documentation for API Endpoints
@@ -82,20 +82,22 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
+*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean |
*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
-*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
-*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
-*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
-*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
+*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
+*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
+*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**test_endpoint_enums_length_one**](docs/FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} |
*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
-*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
@@ -131,16 +133,23 @@ Class | Method | HTTP request | Description
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
- [AdditionalPropertiesString](docs/AdditionalPropertiesString.md)
- [Animal](docs/Animal.md)
+ - [AnimalFarm](docs/AnimalFarm.md)
- [ApiResponse](docs/ApiResponse.md)
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
- - [BigCat](docs/BigCat.md)
- - [BigCatAllOf](docs/BigCatAllOf.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [CatAllOf](docs/CatAllOf.md)
- [Category](docs/Category.md)
+ - [Child](docs/Child.md)
+ - [ChildAllOf](docs/ChildAllOf.md)
+ - [ChildCat](docs/ChildCat.md)
+ - [ChildCatAllOf](docs/ChildCatAllOf.md)
+ - [ChildDog](docs/ChildDog.md)
+ - [ChildDogAllOf](docs/ChildDogAllOf.md)
+ - [ChildLizard](docs/ChildLizard.md)
+ - [ChildLizardAllOf](docs/ChildLizardAllOf.md)
- [ClassModel](docs/ClassModel.md)
- [Client](docs/Client.md)
- [Dog](docs/Dog.md)
@@ -151,6 +160,8 @@ Class | Method | HTTP request | Description
- [File](docs/File.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [FormatTest](docs/FormatTest.md)
+ - [Grandparent](docs/Grandparent.md)
+ - [GrandparentAnimal](docs/GrandparentAnimal.md)
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [List](docs/List.md)
- [MapTest](docs/MapTest.md)
@@ -159,12 +170,18 @@ Class | Method | HTTP request | Description
- [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md)
- [NumberOnly](docs/NumberOnly.md)
+ - [NumberWithValidations](docs/NumberWithValidations.md)
+ - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md)
- [Order](docs/Order.md)
- - [OuterComposite](docs/OuterComposite.md)
- - [OuterEnum](docs/OuterEnum.md)
+ - [Parent](docs/Parent.md)
+ - [ParentAllOf](docs/ParentAllOf.md)
+ - [ParentPet](docs/ParentPet.md)
- [Pet](docs/Pet.md)
+ - [Player](docs/Player.md)
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [SpecialModelName](docs/SpecialModelName.md)
+ - [StringBooleanMap](docs/StringBooleanMap.md)
+ - [StringEnum](docs/StringEnum.md)
- [Tag](docs/Tag.md)
- [TypeHolderDefault](docs/TypeHolderDefault.md)
- [TypeHolderExample](docs/TypeHolderExample.md)
@@ -209,3 +226,22 @@ Class | Method | HTTP request | Description
+## Notes for Large OpenAPI documents
+If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a
+RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
+
+Solution 1:
+Use specific imports for apis and models like:
+- `from petstore_api.api.default_api import DefaultApi`
+- `from petstore_api.model.pet import Pet`
+
+Solution 1:
+Before importing the package, adjust the maximum recursion limit as shown below:
+```
+import sys
+sys.setrecursionlimit(1500)
+import petstore_api
+from petstore_api.apis import *
+from petstore_api.models import *
+```
+
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md
index 9843d35ab906..754b2f3ada4c 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **bool, date, datetime, dict, float, int, list, str** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python/docs/AdditionalPropertiesArray.md
index cfe09d91c726..61ac566c14d2 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesArray.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesArray.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **[bool, date, datetime, dict, float, int, list, str]** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python/docs/AdditionalPropertiesBoolean.md
index 74f009554a7f..f2567f064cfd 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesBoolean.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesBoolean.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md
index eb3e0524de1a..4a9d1dd133ce 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md
@@ -3,17 +3,17 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_string** | **dict(str, str)** | | [optional]
-**map_number** | **dict(str, float)** | | [optional]
-**map_integer** | **dict(str, int)** | | [optional]
-**map_boolean** | **dict(str, bool)** | | [optional]
-**map_array_integer** | **dict(str, list[int])** | | [optional]
-**map_array_anytype** | **dict(str, list[object])** | | [optional]
-**map_map_string** | **dict(str, dict(str, str))** | | [optional]
-**map_map_anytype** | **dict(str, dict(str, object))** | | [optional]
-**anytype_1** | **object** | | [optional]
-**anytype_2** | **object** | | [optional]
-**anytype_3** | **object** | | [optional]
+**map_string** | **{str: (str,)}** | | [optional]
+**map_number** | **{str: (float,)}** | | [optional]
+**map_integer** | **{str: (int,)}** | | [optional]
+**map_boolean** | **{str: (bool,)}** | | [optional]
+**map_array_integer** | **{str: ([int],)}** | | [optional]
+**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str],)}** | | [optional]
+**map_map_string** | **{str: ({str: (str,)},)}** | | [optional]
+**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)}** | | [optional]
+**anytype_1** | **bool, date, datetime, dict, float, int, list, str** | | [optional]
+**anytype_2** | **bool, date, datetime, dict, float, int, list, str** | | [optional]
+**anytype_3** | **bool, date, datetime, dict, float, int, list, str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python/docs/AdditionalPropertiesInteger.md
index a3e58fd1b0bd..fe0ba709c8ef 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesInteger.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesInteger.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **int** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python/docs/AdditionalPropertiesNumber.md
index 37eafe1ff031..bec81854b950 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesNumber.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesNumber.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **float** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python/docs/AdditionalPropertiesObject.md
index 7f4d6713c758..3fcf2c9299df 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesObject.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesObject.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str,)}** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesString.md b/samples/client/petstore/python/docs/AdditionalPropertiesString.md
index 9317cfeee80b..bbe0b1cbbbb9 100644
--- a/samples/client/petstore/python/docs/AdditionalPropertiesString.md
+++ b/samples/client/petstore/python/docs/AdditionalPropertiesString.md
@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
+**any string name** | **str** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/Animal.md b/samples/client/petstore/python/docs/Animal.md
index 7ed4ba541fa3..698dc711aeb9 100644
--- a/samples/client/petstore/python/docs/Animal.md
+++ b/samples/client/petstore/python/docs/Animal.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
-**color** | **str** | | [optional] [default to 'red']
+**color** | **str** | | [optional] if omitted the server will use the default value of "red"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/client/petstore/python/docs/AnimalFarm.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/AnimalFarm.md
rename to samples/client/petstore/python/docs/AnimalFarm.md
diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md
index 047c4ae6444b..7bc6fba30a60 100644
--- a/samples/client/petstore/python/docs/AnotherFakeApi.md
+++ b/samples/client/petstore/python/docs/AnotherFakeApi.md
@@ -17,10 +17,10 @@ To test special tags and operation ID starting with number
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import another_fake_api
+from petstore_api.model.client import Client
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -32,14 +32,17 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.AnotherFakeApi(api_client)
- body = petstore_api.Client() # Client | client model
+ api_instance = another_fake_api.AnotherFakeApi(api_client)
+ body = Client(
+ client="client_example",
+ ) # Client | client model
+ # example passing only required values which don't have defaults set
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
```
@@ -47,7 +50,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Client**](Client.md)| client model |
+ **body** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
index aa3988ab1679..1a68df0090bb 100644
--- a/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
+++ b/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_array_number** | **list[list[float]]** | | [optional]
+**array_array_number** | **[[float]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python/docs/ArrayOfNumberOnly.md
index 2c3de967aec6..b8a760f56dc2 100644
--- a/samples/client/petstore/python/docs/ArrayOfNumberOnly.md
+++ b/samples/client/petstore/python/docs/ArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_number** | **list[float]** | | [optional]
+**array_number** | **[float]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/ArrayTest.md b/samples/client/petstore/python/docs/ArrayTest.md
index 6ab0d1378065..b94f23fd2271 100644
--- a/samples/client/petstore/python/docs/ArrayTest.md
+++ b/samples/client/petstore/python/docs/ArrayTest.md
@@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_of_string** | **list[str]** | | [optional]
-**array_array_of_integer** | **list[list[int]]** | | [optional]
-**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional]
+**array_of_string** | **[str]** | | [optional]
+**array_array_of_integer** | **[[int]]** | | [optional]
+**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/Cat.md b/samples/client/petstore/python/docs/Cat.md
index 8d30565d014e..b2662bc06c1d 100644
--- a/samples/client/petstore/python/docs/Cat.md
+++ b/samples/client/petstore/python/docs/Cat.md
@@ -3,7 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
**declawed** | **bool** | | [optional]
+**color** | **str** | | [optional] if omitted the server will use the default value of "red"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/Category.md b/samples/client/petstore/python/docs/Category.md
index 7e5c1e316499..287225d66fd7 100644
--- a/samples/client/petstore/python/docs/Category.md
+++ b/samples/client/petstore/python/docs/Category.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**name** | **str** | | defaults to "default-name"
**id** | **int** | | [optional]
-**name** | **str** | | [default to 'default-name']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/Child.md b/samples/client/petstore/python/docs/Child.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Child.md
rename to samples/client/petstore/python/docs/Child.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildAllOf.md b/samples/client/petstore/python/docs/ChildAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildAllOf.md
rename to samples/client/petstore/python/docs/ChildAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildCat.md b/samples/client/petstore/python/docs/ChildCat.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildCat.md
rename to samples/client/petstore/python/docs/ChildCat.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/client/petstore/python/docs/ChildCatAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildCatAllOf.md
rename to samples/client/petstore/python/docs/ChildCatAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildDog.md b/samples/client/petstore/python/docs/ChildDog.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildDog.md
rename to samples/client/petstore/python/docs/ChildDog.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md b/samples/client/petstore/python/docs/ChildDogAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildDogAllOf.md
rename to samples/client/petstore/python/docs/ChildDogAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildLizard.md b/samples/client/petstore/python/docs/ChildLizard.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildLizard.md
rename to samples/client/petstore/python/docs/ChildLizard.md
diff --git a/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md b/samples/client/petstore/python/docs/ChildLizardAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md
rename to samples/client/petstore/python/docs/ChildLizardAllOf.md
diff --git a/samples/client/petstore/python/docs/Dog.md b/samples/client/petstore/python/docs/Dog.md
index f727487975c4..ca679f81b41c 100644
--- a/samples/client/petstore/python/docs/Dog.md
+++ b/samples/client/petstore/python/docs/Dog.md
@@ -3,7 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
**breed** | **str** | | [optional]
+**color** | **str** | | [optional] if omitted the server will use the default value of "red"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/EnumArrays.md b/samples/client/petstore/python/docs/EnumArrays.md
index e15a5f1fd049..e0b5582e9d5b 100644
--- a/samples/client/petstore/python/docs/EnumArrays.md
+++ b/samples/client/petstore/python/docs/EnumArrays.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**just_symbol** | **str** | | [optional]
-**array_enum** | **list[str]** | | [optional]
+**array_enum** | **[str]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/EnumClass.md b/samples/client/petstore/python/docs/EnumClass.md
index 67f017becd0c..6dda7fd8a77f 100644
--- a/samples/client/petstore/python/docs/EnumClass.md
+++ b/samples/client/petstore/python/docs/EnumClass.md
@@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/EnumTest.md b/samples/client/petstore/python/docs/EnumTest.md
index c4c1630250ff..22dd3d5f48d8 100644
--- a/samples/client/petstore/python/docs/EnumTest.md
+++ b/samples/client/petstore/python/docs/EnumTest.md
@@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**enum_string** | **str** | | [optional]
**enum_string_required** | **str** | |
+**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
-**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**string_enum** | [**StringEnum**](StringEnum.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md
index 68a36b5f7525..b098d80fdd33 100644
--- a/samples/client/petstore/python/docs/FakeApi.md
+++ b/samples/client/petstore/python/docs/FakeApi.md
@@ -4,22 +4,151 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
+[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
+[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean |
[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
-[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
-[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
-[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
-[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
+[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
+[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
+[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+[**test_endpoint_enums_length_one**](FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} |
[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
-[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
+# **array_model**
+> AnimalFarm array_model()
+
+
+
+Test serialization of ArrayModel
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from petstore_api.model.animal_farm import AnimalFarm
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ body = AnimalFarm([
+ Animal(),
+ ]) # AnimalFarm | Input model (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ api_response = api_instance.array_model(body=body)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->array_model: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional]
+
+### Return type
+
+[**AnimalFarm**](AnimalFarm.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output model | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **boolean**
+> bool boolean()
+
+
+
+Test serialization of outer boolean types
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ body = True # bool | Input boolean as post body (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ api_response = api_instance.boolean(body=body)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->boolean: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **bool**| Input boolean as post body | [optional]
+
+### Return type
+
+**bool**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output boolean | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
# **create_xml_item**
> create_xml_item(xml_item)
@@ -30,10 +159,10 @@ this route creates an XmlItem
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.xml_item import XmlItem
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -45,13 +174,62 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body
-
+ api_instance = fake_api.FakeApi(api_client)
+ xml_item = XmlItem(
+ attribute_string="string",
+ attribute_number=1.234,
+ attribute_integer=-2,
+ attribute_boolean=True,
+ wrapped_array=[
+ 1,
+ ],
+ name_string="string",
+ name_number=1.234,
+ name_integer=-2,
+ name_boolean=True,
+ name_array=[
+ 1,
+ ],
+ name_wrapped_array=[
+ 1,
+ ],
+ prefix_string="string",
+ prefix_number=1.234,
+ prefix_integer=-2,
+ prefix_boolean=True,
+ prefix_array=[
+ 1,
+ ],
+ prefix_wrapped_array=[
+ 1,
+ ],
+ namespace_string="string",
+ namespace_number=1.234,
+ namespace_integer=-2,
+ namespace_boolean=True,
+ namespace_array=[
+ 1,
+ ],
+ namespace_wrapped_array=[
+ 1,
+ ],
+ prefix_ns_string="string",
+ prefix_ns_number=1.234,
+ prefix_ns_integer=-2,
+ prefix_ns_boolean=True,
+ prefix_ns_array=[
+ 1,
+ ],
+ prefix_ns_wrapped_array=[
+ 1,
+ ],
+ ) # XmlItem | XmlItem Body
+
+ # example passing only required values which don't have defaults set
try:
# creates an XmlItem
api_instance.create_xml_item(xml_item)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->create_xml_item: %s\n" % e)
```
@@ -59,7 +237,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body |
+ **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body |
### Return type
@@ -81,20 +259,20 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_boolean_serialize**
-> bool fake_outer_boolean_serialize(body=body)
+# **number_with_validations**
+> NumberWithValidations number_with_validations()
-Test serialization of outer boolean types
+Test serialization of outer number types
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.number_with_validations import NumberWithValidations
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -106,25 +284,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = True # bool | Input boolean as post body (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ body = NumberWithValidations(1E+1) # NumberWithValidations | Input number as post body (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_boolean_serialize(body=body)
+ api_response = api_instance.number_with_validations(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->number_with_validations: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **bool**| Input boolean as post body | [optional]
+ **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional]
### Return type
-**bool**
+[**NumberWithValidations**](NumberWithValidations.md)
### Authorization
@@ -138,24 +318,24 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output boolean | - |
+**200** | Output number | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_composite_serialize**
-> OuterComposite fake_outer_composite_serialize(body=body)
+# **object_model_with_ref_props**
+> ObjectModelWithRefProps object_model_with_ref_props()
-Test serialization of object with outer number type
+Test serialization of object with $refed properties
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -167,25 +347,31 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
-
+ api_instance = fake_api.FakeApi(api_client)
+ body = ObjectModelWithRefProps(
+ my_number=NumberWithValidations(1E+1),
+ my_string="my_string_example",
+ my_boolean=True,
+ ) # ObjectModelWithRefProps | Input model (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_composite_serialize(body=body)
+ api_response = api_instance.object_model_with_ref_props(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+ **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional]
### Return type
-[**OuterComposite**](OuterComposite.md)
+[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)
### Authorization
@@ -199,24 +385,23 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output composite | - |
+**200** | Output model | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_number_serialize**
-> float fake_outer_number_serialize(body=body)
+# **string**
+> str string()
-Test serialization of outer number types
+Test serialization of outer string types
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -228,25 +413,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = 3.4 # float | Input number as post body (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ body = "body_example" # str | Input string as post body (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_number_serialize(body=body)
+ api_response = api_instance.string(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->string: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **float**| Input number as post body | [optional]
+ **body** | **str**| Input string as post body | [optional]
### Return type
-**float**
+**str**
### Authorization
@@ -260,24 +447,24 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output number | - |
+**200** | Output string | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_string_serialize**
-> str fake_outer_string_serialize(body=body)
+# **string_enum**
+> StringEnum string_enum()
-Test serialization of outer string types
+Test serialization of outer enum
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.string_enum import StringEnum
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -289,25 +476,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = 'body_example' # str | Input string as post body (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ body = StringEnum("placed") # StringEnum | Input enum (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_string_serialize(body=body)
+ api_response = api_instance.string_enum(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->string_enum: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **str**| Input string as post body | [optional]
+ **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional]
### Return type
-**str**
+[**StringEnum**](StringEnum.md)
### Authorization
@@ -321,7 +510,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output string | - |
+**200** | Output enum | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -335,10 +524,10 @@ For this test, the body for this request much reference a schema named `File`.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -350,12 +539,22 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
-
+ api_instance = fake_api.FakeApi(api_client)
+ body = FileSchemaTestClass(
+ file=File(
+ source_uri="source_uri_example",
+ ),
+ files=[
+ File(
+ source_uri="source_uri_example",
+ ),
+ ],
+ ) # FileSchemaTestClass |
+
+ # example passing only required values which don't have defaults set
try:
api_instance.test_body_with_file_schema(body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
@@ -363,7 +562,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+ **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
@@ -393,10 +592,10 @@ No authorization required
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -408,13 +607,23 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- query = 'query_example' # str |
-body = petstore_api.User() # User |
-
+ api_instance = fake_api.FakeApi(api_client)
+ query = "query_example" # str |
+ body = User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ ) # User |
+
+ # example passing only required values which don't have defaults set
try:
api_instance.test_body_with_query_params(query, body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
@@ -422,8 +631,8 @@ body = petstore_api.User() # User |
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **query** | **str**| |
- **body** | [**User**](User.md)| |
+ **query** | **str**| |
+ **body** | [**User**](User.md)| |
### Return type
@@ -455,10 +664,10 @@ To test \"client\" model
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.client import Client
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -470,14 +679,17 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = petstore_api.Client() # Client | client model
+ api_instance = fake_api.FakeApi(api_client)
+ body = Client(
+ client="client_example",
+ ) # Client | client model
+ # example passing only required values which don't have defaults set
try:
# To test \"client\" model
api_response = api_instance.test_client_model(body)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
```
@@ -485,7 +697,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Client**](Client.md)| client model |
+ **body** | [**Client**](Client.md)| client model |
### Return type
@@ -507,8 +719,71 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+# **test_endpoint_enums_length_one**
+> test_endpoint_enums_length_one()
+
+
+
+This route has required values with enums of 1
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+
+ # example passing only required values which don't have defaults set
+ try:
+ api_instance.test_endpoint_enums_length_one()
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query_integer** | **int**| | defaults to 3
+ **query_string** | **str**| | defaults to "brillig"
+ **path_string** | **str**| | defaults to "hello"
+ **path_integer** | **int**| | defaults to 34
+ **header_number** | **float**| | defaults to 1.234
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
# **test_endpoint_parameters**
-> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -518,10 +793,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ
* Basic Authentication (http_basic_test):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -543,26 +817,35 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- number = 3.4 # float | None
-double = 3.4 # float | None
-pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
-byte = 'byte_example' # str | None
-integer = 56 # int | None (optional)
-int32 = 56 # int | None (optional)
-int64 = 56 # int | None (optional)
-float = 3.4 # float | None (optional)
-string = 'string_example' # str | None (optional)
-binary = '/path/to/file' # file | None (optional)
-date = '2013-10-20' # date | None (optional)
-date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
-password = 'password_example' # str | None (optional)
-param_callback = 'param_callback_example' # str | None (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ number = 32.1 # float | None
+ double = 67.8 # float | None
+ pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C" # str | None
+ byte = 'YQ==' # str | None
+ integer = 10 # int | None (optional)
+ int32 = 20 # int | None (optional)
+ int64 = 1 # int | None (optional)
+ float = 3.14 # float | None (optional)
+ string = "a" # str | None (optional)
+ binary = open('/path/to/file', 'rb') # file_type | None (optional)
+ date = dateutil_parser('1970-01-01').date() # date | None (optional)
+ date_time = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | None (optional)
+ password = "password_example" # str | None (optional)
+ param_callback = "param_callback_example" # str | None (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
```
@@ -570,20 +853,20 @@ param_callback = 'param_callback_example' # str | None (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **number** | **float**| None |
- **double** | **float**| None |
- **pattern_without_delimiter** | **str**| None |
- **byte** | **str**| None |
- **integer** | **int**| None | [optional]
- **int32** | **int**| None | [optional]
- **int64** | **int**| None | [optional]
- **float** | **float**| None | [optional]
- **string** | **str**| None | [optional]
- **binary** | **file**| None | [optional]
- **date** | **date**| None | [optional]
- **date_time** | **datetime**| None | [optional]
- **password** | **str**| None | [optional]
- **param_callback** | **str**| None | [optional]
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **file_type**| None | [optional]
+ **date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
### Return type
@@ -607,7 +890,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_enum_parameters**
-> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
+> test_enum_parameters()
To test enum parameters
@@ -616,10 +899,9 @@ To test enum parameters
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -631,20 +913,26 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional)
-enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg')
-enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional)
-enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg')
-enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
-enum_query_double = 3.4 # float | Query parameter enum test (double) (optional)
-enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$')
-enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg')
-
+ api_instance = fake_api.FakeApi(api_client)
+ enum_header_string_array = [
+ "$",
+ ] # [str] | Header parameter enum test (string array) (optional)
+ enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
+ enum_query_string_array = [
+ "$",
+ ] # [str] | Query parameter enum test (string array) (optional)
+ enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
+ enum_query_integer = 1 # int | Query parameter enum test (double) (optional)
+ enum_query_double = 1.1 # float | Query parameter enum test (double) (optional)
+ enum_form_string_array = "$" # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$"
+ enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
+
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# To test enum parameters
api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e)
```
@@ -652,14 +940,14 @@ enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional]
- **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg']
- **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional]
- **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg']
- **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
- **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
- **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$']
- **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg']
+ **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional]
+ **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+ **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional]
+ **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+ **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
+ **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
+ **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$"
+ **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
### Return type
@@ -683,7 +971,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_group_parameters**
-> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
Fake endpoint to test group parameters (optional)
@@ -692,10 +980,9 @@ Fake endpoint to test group parameters (optional)
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -707,18 +994,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- required_string_group = 56 # int | Required String in group parameters
-required_boolean_group = True # bool | Required Boolean in group parameters
-required_int64_group = 56 # int | Required Integer in group parameters
-string_group = 56 # int | String in group parameters (optional)
-boolean_group = True # bool | Boolean in group parameters (optional)
-int64_group = 56 # int | Integer in group parameters (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ required_string_group = 1 # int | Required String in group parameters
+ required_boolean_group = True # bool | Required Boolean in group parameters
+ required_int64_group = 1 # int | Required Integer in group parameters
+ string_group = 1 # int | String in group parameters (optional)
+ boolean_group = True # bool | Boolean in group parameters (optional)
+ int64_group = 1 # int | Integer in group parameters (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Fake endpoint to test group parameters (optional)
+ api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Fake endpoint to test group parameters (optional)
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
```
@@ -726,12 +1022,12 @@ int64_group = 56 # int | Integer in group parameters (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **required_string_group** | **int**| Required String in group parameters |
- **required_boolean_group** | **bool**| Required Boolean in group parameters |
- **required_int64_group** | **int**| Required Integer in group parameters |
- **string_group** | **int**| String in group parameters | [optional]
- **boolean_group** | **bool**| Boolean in group parameters | [optional]
- **int64_group** | **int**| Integer in group parameters | [optional]
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
### Return type
@@ -761,10 +1057,9 @@ test inline additionalProperties
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -776,13 +1071,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- param = {'key': 'param_example'} # dict(str, str) | request body
+ api_instance = fake_api.FakeApi(api_client)
+ param = {
+ "key": "key_example",
+ } # {str: (str,)} | request body
+ # example passing only required values which don't have defaults set
try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(param)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
@@ -790,7 +1088,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | [**dict(str, str)**](str.md)| request body |
+ **param** | **{str: (str,)}**| request body |
### Return type
@@ -820,10 +1118,9 @@ test json serialization of form data
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -835,14 +1132,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- param = 'param_example' # str | field1
-param2 = 'param2_example' # str | field2
+ api_instance = fake_api.FakeApi(api_client)
+ param = "param_example" # str | field1
+ param2 = "param2_example" # str | field2
+ # example passing only required values which don't have defaults set
try:
# test json serialization of form data
api_instance.test_json_form_data(param, param2)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
```
@@ -850,8 +1148,8 @@ param2 = 'param2_example' # str | field2
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | **str**| field1 |
- **param2** | **str**| field2 |
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
### Return type
@@ -873,71 +1171,3 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **test_query_parameter_collection_format**
-> test_query_parameter_collection_format(pipe, ioutil, http, url, context)
-
-
-
-To test the collection format in query parameters
-
-### Example
-
-```python
-from __future__ import print_function
-import time
-import petstore_api
-from petstore_api.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- pipe = ['pipe_example'] # list[str] |
-ioutil = ['ioutil_example'] # list[str] |
-http = ['http_example'] # list[str] |
-url = ['url_example'] # list[str] |
-context = ['context_example'] # list[str] |
-
- try:
- api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context)
- except ApiException as e:
- print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pipe** | [**list[str]**](str.md)| |
- **ioutil** | [**list[str]**](str.md)| |
- **http** | [**list[str]**](str.md)| |
- **url** | [**list[str]**](str.md)| |
- **context** | [**list[str]**](str.md)| |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: Not defined
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Success | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md
index 66b43fb1ea11..9bf5b1babf20 100644
--- a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md
+++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md
@@ -18,10 +18,10 @@ To test class name in snake case
* Api Key Authentication (api_key_query):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_classname_tags_123_api
+from petstore_api.model.client import Client
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -43,14 +43,17 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeClassnameTags123Api(api_client)
- body = petstore_api.Client() # Client | client model
+ api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client)
+ body = Client(
+ client="client_example",
+ ) # Client | client model
+ # example passing only required values which don't have defaults set
try:
# To test class name in snake case
api_response = api_instance.test_classname(body)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
```
@@ -58,7 +61,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Client**](Client.md)| client model |
+ **body** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/client/petstore/python/docs/FileSchemaTestClass.md b/samples/client/petstore/python/docs/FileSchemaTestClass.md
index dc3722289887..d0a8bbaaba95 100644
--- a/samples/client/petstore/python/docs/FileSchemaTestClass.md
+++ b/samples/client/petstore/python/docs/FileSchemaTestClass.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**File**](File.md) | | [optional]
-**files** | [**list[File]**](File.md) | | [optional]
+**files** | [**[File]**](File.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/FormatTest.md b/samples/client/petstore/python/docs/FormatTest.md
index f0942f52484f..083b0bd4c98a 100644
--- a/samples/client/petstore/python/docs/FormatTest.md
+++ b/samples/client/petstore/python/docs/FormatTest.md
@@ -3,20 +3,19 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**number** | **float** | |
+**byte** | **str** | |
+**date** | **date** | |
+**password** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
-**number** | **float** | |
**float** | **float** | | [optional]
**double** | **float** | | [optional]
**string** | **str** | | [optional]
-**byte** | **str** | |
-**binary** | **file** | | [optional]
-**date** | **date** | |
+**binary** | **file_type** | | [optional]
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
-**password** | **str** | |
-**big_decimal** | [**Decimal**](Decimal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/Grandparent.md b/samples/client/petstore/python/docs/Grandparent.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Grandparent.md
rename to samples/client/petstore/python/docs/Grandparent.md
diff --git a/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/client/petstore/python/docs/GrandparentAnimal.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/GrandparentAnimal.md
rename to samples/client/petstore/python/docs/GrandparentAnimal.md
diff --git a/samples/client/petstore/python/docs/MapTest.md b/samples/client/petstore/python/docs/MapTest.md
index a5601691f885..ad561b7220bf 100644
--- a/samples/client/petstore/python/docs/MapTest.md
+++ b/samples/client/petstore/python/docs/MapTest.md
@@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
-**map_of_enum_string** | **dict(str, str)** | | [optional]
-**direct_map** | **dict(str, bool)** | | [optional]
-**indirect_map** | **dict(str, bool)** | | [optional]
+**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional]
+**map_of_enum_string** | **{str: (str,)}** | | [optional]
+**direct_map** | **{str: (bool,)}** | | [optional]
+**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index b9808d5275e5..1484c0638d83 100644
--- a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
+**map** | [**{str: (Animal,)}**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/client/petstore/python/docs/NumberWithValidations.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/NumberWithValidations.md
rename to samples/client/petstore/python/docs/NumberWithValidations.md
diff --git a/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python/docs/ObjectModelWithRefProps.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md
rename to samples/client/petstore/python/docs/ObjectModelWithRefProps.md
diff --git a/samples/client/petstore/python/docs/Order.md b/samples/client/petstore/python/docs/Order.md
index b5f7b22d34cf..c21210a3bd59 100644
--- a/samples/client/petstore/python/docs/Order.md
+++ b/samples/client/petstore/python/docs/Order.md
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional]
**ship_date** | **datetime** | | [optional]
**status** | **str** | Order Status | [optional]
-**complete** | **bool** | | [optional] [default to False]
+**complete** | **bool** | | [optional] if omitted the server will use the default value of False
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-experimental/docs/Parent.md b/samples/client/petstore/python/docs/Parent.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Parent.md
rename to samples/client/petstore/python/docs/Parent.md
diff --git a/samples/client/petstore/python-experimental/docs/ParentAllOf.md b/samples/client/petstore/python/docs/ParentAllOf.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ParentAllOf.md
rename to samples/client/petstore/python/docs/ParentAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/ParentPet.md b/samples/client/petstore/python/docs/ParentPet.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/ParentPet.md
rename to samples/client/petstore/python/docs/ParentPet.md
diff --git a/samples/client/petstore/python/docs/Pet.md b/samples/client/petstore/python/docs/Pet.md
index 9e15090300f8..ce09d401c899 100644
--- a/samples/client/petstore/python/docs/Pet.md
+++ b/samples/client/petstore/python/docs/Pet.md
@@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**name** | **str** | |
+**photo_urls** | **[str]** | |
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
-**name** | **str** | |
-**photo_urls** | **list[str]** | |
-**tags** | [**list[Tag]**](Tag.md) | | [optional]
+**tags** | [**[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md
index e8176632d088..6364be448370 100644
--- a/samples/client/petstore/python/docs/PetApi.md
+++ b/samples/client/petstore/python/docs/PetApi.md
@@ -24,10 +24,10 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -49,13 +49,32 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
-
+ api_instance = pet_api.PetApi(api_client)
+ body = Pet(
+ id=1,
+ category=Category(
+ id=1,
+ name="default-name",
+ ),
+ name="doggie",
+ photo_urls=[
+ "photo_urls_example",
+ ],
+ tags=[
+ Tag(
+ id=1,
+ name="name_example",
+ full_name="full_name_example",
+ ),
+ ],
+ status="available",
+ ) # Pet | Pet object that needs to be added to the store
+
+ # example passing only required values which don't have defaults set
try:
# Add a new pet to the store
api_instance.add_pet(body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
@@ -63,7 +82,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -87,7 +106,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete_pet**
-> delete_pet(pet_id, api_key=api_key)
+> delete_pet(pet_id)
Deletes a pet
@@ -95,10 +114,9 @@ Deletes a pet
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -120,14 +138,23 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | Pet id to delete
-api_key = 'api_key_example' # str | (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | Pet id to delete
+ api_key = "api_key_example" # str | (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Deletes a pet
+ api_instance.delete_pet(pet_id)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->delete_pet: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Deletes a pet
api_instance.delete_pet(pet_id, api_key=api_key)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->delete_pet: %s\n" % e)
```
@@ -135,8 +162,8 @@ api_key = 'api_key_example' # str | (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| Pet id to delete |
- **api_key** | **str**| | [optional]
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
### Return type
@@ -160,7 +187,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **find_pets_by_status**
-> list[Pet] find_pets_by_status(status)
+> [Pet] find_pets_by_status(status)
Finds Pets by status
@@ -170,10 +197,10 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -195,14 +222,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- status = ['status_example'] # list[str] | Status values that need to be considered for filter
+ api_instance = pet_api.PetApi(api_client)
+ status = [
+ "available",
+ ] # [str] | Status values that need to be considered for filter
+ # example passing only required values which don't have defaults set
try:
# Finds Pets by status
api_response = api_instance.find_pets_by_status(status)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
```
@@ -210,11 +240,11 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | [**list[str]**](str.md)| Status values that need to be considered for filter |
+ **status** | **[str]**| Status values that need to be considered for filter |
### Return type
-[**list[Pet]**](Pet.md)
+[**[Pet]**](Pet.md)
### Authorization
@@ -234,7 +264,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **find_pets_by_tags**
-> list[Pet] find_pets_by_tags(tags)
+> [Pet] find_pets_by_tags(tags)
Finds Pets by tags
@@ -244,10 +274,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -269,14 +299,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- tags = ['tags_example'] # list[str] | Tags to filter by
+ api_instance = pet_api.PetApi(api_client)
+ tags = [
+ "tags_example",
+ ] # [str] | Tags to filter by
+ # example passing only required values which don't have defaults set
try:
# Finds Pets by tags
api_response = api_instance.find_pets_by_tags(tags)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
```
@@ -284,11 +317,11 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **tags** | [**list[str]**](str.md)| Tags to filter by |
+ **tags** | **[str]**| Tags to filter by |
### Return type
-[**list[Pet]**](Pet.md)
+[**[Pet]**](Pet.md)
### Authorization
@@ -318,10 +351,10 @@ Returns a single pet
* Api Key Authentication (api_key):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -343,14 +376,15 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet to return
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet to return
+ # example passing only required values which don't have defaults set
try:
# Find pet by ID
api_response = api_instance.get_pet_by_id(pet_id)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
```
@@ -358,7 +392,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to return |
+ **pet_id** | **int**| ID of pet to return |
### Return type
@@ -391,10 +425,10 @@ Update an existing pet
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -416,13 +450,32 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
-
+ api_instance = pet_api.PetApi(api_client)
+ body = Pet(
+ id=1,
+ category=Category(
+ id=1,
+ name="default-name",
+ ),
+ name="doggie",
+ photo_urls=[
+ "photo_urls_example",
+ ],
+ tags=[
+ Tag(
+ id=1,
+ name="name_example",
+ full_name="full_name_example",
+ ),
+ ],
+ status="available",
+ ) # Pet | Pet object that needs to be added to the store
+
+ # example passing only required values which don't have defaults set
try:
# Update an existing pet
api_instance.update_pet(body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
@@ -430,7 +483,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -456,7 +509,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_pet_with_form**
-> update_pet_with_form(pet_id, name=name, status=status)
+> update_pet_with_form(pet_id)
Updates a pet in the store with form data
@@ -464,10 +517,9 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -489,15 +541,24 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet that needs to be updated
-name = 'name_example' # str | Updated name of the pet (optional)
-status = 'status_example' # str | Updated status of the pet (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet that needs to be updated
+ name = "name_example" # str | Updated name of the pet (optional)
+ status = "status_example" # str | Updated status of the pet (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Updates a pet in the store with form data
+ api_instance.update_pet_with_form(pet_id)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Updates a pet in the store with form data
api_instance.update_pet_with_form(pet_id, name=name, status=status)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
```
@@ -505,9 +566,9 @@ status = 'status_example' # str | Updated status of the pet (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet that needs to be updated |
- **name** | **str**| Updated name of the pet | [optional]
- **status** | **str**| Updated status of the pet | [optional]
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
### Return type
@@ -530,7 +591,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file**
-> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+> ApiResponse upload_file(pet_id)
uploads an image
@@ -538,10 +599,10 @@ uploads an image
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.api_response import ApiResponse
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -563,16 +624,27 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet to update
-additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
-file = '/path/to/file' # file | file to upload (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet to update
+ additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
+ file = open('/path/to/file', 'rb') # file_type | file to upload (optional)
+ files = # [file_type] | files to upload (optional)
+ # example passing only required values which don't have defaults set
try:
# uploads an image
- api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+ api_response = api_instance.upload_file(pet_id)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->upload_file: %s\n" % e)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ # uploads an image
+ api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file: %s\n" % e)
```
@@ -580,9 +652,10 @@ file = '/path/to/file' # file | file to upload (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
- **file** | **file**| file to upload | [optional]
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **file_type**| file to upload | [optional]
+ **files** | **[file_type]**| files to upload | [optional]
### Return type
@@ -605,7 +678,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+> ApiResponse upload_file_with_required_file(pet_id, required_file)
uploads an image (required)
@@ -613,10 +686,10 @@ uploads an image (required)
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.api_response import ApiResponse
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -638,16 +711,26 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet to update
-required_file = '/path/to/file' # file | file to upload
-additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet to update
+ required_file = open('/path/to/file', 'rb') # file_type | file to upload
+ additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # uploads an image (required)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# uploads an image (required)
api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
```
@@ -655,9 +738,9 @@ additional_metadata = 'additional_metadata_example' # str | Additional data to p
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **required_file** | **file**| file to upload |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **file_type**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/Player.md b/samples/client/petstore/python/docs/Player.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/Player.md
rename to samples/client/petstore/python/docs/Player.md
diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md
index b9dc71c38f55..30ea16d661f5 100644
--- a/samples/client/petstore/python/docs/StoreApi.md
+++ b/samples/client/petstore/python/docs/StoreApi.md
@@ -20,10 +20,9 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -35,13 +34,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
- order_id = 'order_id_example' # str | ID of the order that needs to be deleted
+ api_instance = store_api.StoreApi(api_client)
+ order_id = "order_id_example" # str | ID of the order that needs to be deleted
+ # example passing only required values which don't have defaults set
try:
# Delete purchase order by ID
api_instance.delete_order(order_id)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->delete_order: %s\n" % e)
```
@@ -49,7 +49,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **str**| ID of the order that needs to be deleted |
+ **order_id** | **str**| ID of the order that needs to be deleted |
### Return type
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> dict(str, int) get_inventory()
+> {str: (int,)} get_inventory()
Returns pet inventories by status
@@ -83,10 +83,9 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -108,13 +107,14 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
-
+ api_instance = store_api.StoreApi(api_client)
+
+ # example, this endpoint has no required or optional parameters
try:
# Returns pet inventories by status
api_response = api_instance.get_inventory()
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->get_inventory: %s\n" % e)
```
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**dict(str, int)**
+**{str: (int,)}**
### Authorization
@@ -151,10 +151,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
+from petstore_api.model.order import Order
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -166,14 +166,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
- order_id = 56 # int | ID of pet that needs to be fetched
+ api_instance = store_api.StoreApi(api_client)
+ order_id = 1 # int | ID of pet that needs to be fetched
+ # example passing only required values which don't have defaults set
try:
# Find purchase order by ID
api_response = api_instance.get_order_by_id(order_id)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
```
@@ -181,7 +182,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **int**| ID of pet that needs to be fetched |
+ **order_id** | **int**| ID of pet that needs to be fetched |
### Return type
@@ -213,10 +214,10 @@ Place an order for a pet
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
+from petstore_api.model.order import Order
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -228,14 +229,22 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
- body = petstore_api.Order() # Order | order placed for purchasing the pet
-
+ api_instance = store_api.StoreApi(api_client)
+ body = Order(
+ id=1,
+ pet_id=1,
+ quantity=1,
+ ship_date=dateutil_parser('1970-01-01T00:00:00.00Z'),
+ status="placed",
+ complete=False,
+ ) # Order | order placed for purchasing the pet
+
+ # example passing only required values which don't have defaults set
try:
# Place an order for a pet
api_response = api_instance.place_order(body)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
```
@@ -243,7 +252,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Order**](Order.md)| order placed for purchasing the pet |
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/client/petstore/python/docs/StringBooleanMap.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/StringBooleanMap.md
rename to samples/client/petstore/python/docs/StringBooleanMap.md
diff --git a/samples/client/petstore/python-experimental/docs/StringEnum.md b/samples/client/petstore/python/docs/StringEnum.md
similarity index 100%
rename from samples/client/petstore/python-experimental/docs/StringEnum.md
rename to samples/client/petstore/python/docs/StringEnum.md
diff --git a/samples/client/petstore/python/docs/Tag.md b/samples/client/petstore/python/docs/Tag.md
index 243cd98eda69..fb8be02da161 100644
--- a/samples/client/petstore/python/docs/Tag.md
+++ b/samples/client/petstore/python/docs/Tag.md
@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**name** | **str** | | [optional]
+**full_name** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/TypeHolderDefault.md b/samples/client/petstore/python/docs/TypeHolderDefault.md
index 861da021826a..42322d2f4c37 100644
--- a/samples/client/petstore/python/docs/TypeHolderDefault.md
+++ b/samples/client/petstore/python/docs/TypeHolderDefault.md
@@ -1,13 +1,16 @@
# TypeHolderDefault
+a model to test optional properties with server defaults
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**string_item** | **str** | | [default to 'what']
-**number_item** | **float** | |
-**integer_item** | **int** | |
-**bool_item** | **bool** | | [default to True]
-**array_item** | **list[int]** | |
+**array_item** | **[int]** | |
+**string_item** | **str** | | defaults to "what"
+**number_item** | **float** | | defaults to 1.234
+**integer_item** | **int** | | defaults to -2
+**bool_item** | **bool** | | defaults to True
+**date_item** | **date** | | [optional]
+**datetime_item** | **datetime** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/TypeHolderExample.md b/samples/client/petstore/python/docs/TypeHolderExample.md
index 2a410ded8e35..246ac18b2b59 100644
--- a/samples/client/petstore/python/docs/TypeHolderExample.md
+++ b/samples/client/petstore/python/docs/TypeHolderExample.md
@@ -1,14 +1,14 @@
# TypeHolderExample
+a model to test required properties with an example and length one enum
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**string_item** | **str** | |
-**number_item** | **float** | |
-**float_item** | **float** | |
-**integer_item** | **int** | |
**bool_item** | **bool** | |
-**array_item** | **list[int]** | |
+**array_item** | **[int]** | |
+**string_item** | **str** | | defaults to "what"
+**number_item** | **float** | | defaults to 1.234
+**integer_item** | **int** | | defaults to -2
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md
index 6cb9d1ec3849..429d7918521d 100644
--- a/samples/client/petstore/python/docs/UserApi.md
+++ b/samples/client/petstore/python/docs/UserApi.md
@@ -24,10 +24,10 @@ This can only be done by the logged in user.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -39,13 +39,23 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- body = petstore_api.User() # User | Created user object
-
+ api_instance = user_api.UserApi(api_client)
+ body = User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ ) # User | Created user object
+
+ # example passing only required values which don't have defaults set
try:
# Create user
api_instance.create_user(body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
@@ -53,7 +63,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**User**](User.md)| Created user object |
+ **body** | [**User**](User.md)| Created user object |
### Return type
@@ -83,10 +93,10 @@ Creates list of users with given input array
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -98,13 +108,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- body = [petstore_api.User()] # list[User] | List of user object
-
+ api_instance = user_api.UserApi(api_client)
+ body = [
+ User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ ),
+ ] # [User] | List of user object
+
+ # example passing only required values which don't have defaults set
try:
# Creates list of users with given input array
api_instance.create_users_with_array_input(body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
@@ -112,7 +134,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](User.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
@@ -142,10 +164,10 @@ Creates list of users with given input array
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -157,13 +179,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- body = [petstore_api.User()] # list[User] | List of user object
-
+ api_instance = user_api.UserApi(api_client)
+ body = [
+ User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ ),
+ ] # [User] | List of user object
+
+ # example passing only required values which don't have defaults set
try:
# Creates list of users with given input array
api_instance.create_users_with_list_input(body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
@@ -171,7 +205,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](User.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
@@ -203,10 +237,9 @@ This can only be done by the logged in user.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -218,13 +251,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | The name that needs to be deleted
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | The name that needs to be deleted
+ # example passing only required values which don't have defaults set
try:
# Delete user
api_instance.delete_user(username)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->delete_user: %s\n" % e)
```
@@ -232,7 +266,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be deleted |
+ **username** | **str**| The name that needs to be deleted |
### Return type
@@ -263,10 +297,10 @@ Get user by user name
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -278,14 +312,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | The name that needs to be fetched. Use user1 for testing.
+ # example passing only required values which don't have defaults set
try:
# Get user by user name
api_response = api_instance.get_user_by_name(username)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
```
@@ -293,7 +328,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
+ **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
### Return type
@@ -325,10 +360,9 @@ Logs user into the system
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -340,15 +374,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | The user name for login
-password = 'password_example' # str | The password for login in clear text
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | The user name for login
+ password = "password_example" # str | The password for login in clear text
+ # example passing only required values which don't have defaults set
try:
# Logs user into the system
api_response = api_instance.login_user(username, password)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->login_user: %s\n" % e)
```
@@ -356,8 +391,8 @@ password = 'password_example' # str | The password for login in clear text
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The user name for login |
- **password** | **str**| The password for login in clear text |
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
### Return type
@@ -388,10 +423,9 @@ Logs out current logged in user session
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -403,12 +437,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
-
+ api_instance = user_api.UserApi(api_client)
+
+ # example, this endpoint has no required or optional parameters
try:
# Logs out current logged in user session
api_instance.logout_user()
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->logout_user: %s\n" % e)
```
@@ -445,10 +480,10 @@ This can only be done by the logged in user.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -460,14 +495,24 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | name that need to be deleted
-body = petstore_api.User() # User | Updated user object
-
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | name that need to be deleted
+ body = User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ ) # User | Updated user object
+
+ # example passing only required values which don't have defaults set
try:
# Updated user
api_instance.update_user(username, body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
```
@@ -475,8 +520,8 @@ body = petstore_api.User() # User | Updated user object
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| name that need to be deleted |
- **body** | [**User**](User.md)| Updated user object |
+ **username** | **str**| name that need to be deleted |
+ **body** | [**User**](User.md)| Updated user object |
### Return type
diff --git a/samples/client/petstore/python/docs/XmlItem.md b/samples/client/petstore/python/docs/XmlItem.md
index 3dd09833fe52..d30ca4362293 100644
--- a/samples/client/petstore/python/docs/XmlItem.md
+++ b/samples/client/petstore/python/docs/XmlItem.md
@@ -7,31 +7,31 @@ Name | Type | Description | Notes
**attribute_number** | **float** | | [optional]
**attribute_integer** | **int** | | [optional]
**attribute_boolean** | **bool** | | [optional]
-**wrapped_array** | **list[int]** | | [optional]
+**wrapped_array** | **[int]** | | [optional]
**name_string** | **str** | | [optional]
**name_number** | **float** | | [optional]
**name_integer** | **int** | | [optional]
**name_boolean** | **bool** | | [optional]
-**name_array** | **list[int]** | | [optional]
-**name_wrapped_array** | **list[int]** | | [optional]
+**name_array** | **[int]** | | [optional]
+**name_wrapped_array** | **[int]** | | [optional]
**prefix_string** | **str** | | [optional]
**prefix_number** | **float** | | [optional]
**prefix_integer** | **int** | | [optional]
**prefix_boolean** | **bool** | | [optional]
-**prefix_array** | **list[int]** | | [optional]
-**prefix_wrapped_array** | **list[int]** | | [optional]
+**prefix_array** | **[int]** | | [optional]
+**prefix_wrapped_array** | **[int]** | | [optional]
**namespace_string** | **str** | | [optional]
**namespace_number** | **float** | | [optional]
**namespace_integer** | **int** | | [optional]
**namespace_boolean** | **bool** | | [optional]
-**namespace_array** | **list[int]** | | [optional]
-**namespace_wrapped_array** | **list[int]** | | [optional]
+**namespace_array** | **[int]** | | [optional]
+**namespace_wrapped_array** | **[int]** | | [optional]
**prefix_ns_string** | **str** | | [optional]
**prefix_ns_number** | **float** | | [optional]
**prefix_ns_integer** | **int** | | [optional]
**prefix_ns_boolean** | **bool** | | [optional]
-**prefix_ns_array** | **list[int]** | | [optional]
-**prefix_ns_wrapped_array** | **list[int]** | | [optional]
+**prefix_ns_array** | **[int]** | | [optional]
+**prefix_ns_wrapped_array** | **[int]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python/petstore_api/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py
index b9fdaf07ac19..50dbde60cc5a 100644
--- a/samples/client/petstore/python/petstore_api/__init__.py
+++ b/samples/client/petstore/python/petstore_api/__init__.py
@@ -12,74 +12,18 @@
"""
-from __future__ import absolute_import
-
__version__ = "1.0.0"
-# import apis into sdk package
-from petstore_api.api.another_fake_api import AnotherFakeApi
-from petstore_api.api.fake_api import FakeApi
-from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
-from petstore_api.api.pet_api import PetApi
-from petstore_api.api.store_api import StoreApi
-from petstore_api.api.user_api import UserApi
-
# import ApiClient
from petstore_api.api_client import ApiClient
+
+# import Configuration
from petstore_api.configuration import Configuration
+
+# import exceptions
from petstore_api.exceptions import OpenApiException
+from petstore_api.exceptions import ApiAttributeError
from petstore_api.exceptions import ApiTypeError
from petstore_api.exceptions import ApiValueError
from petstore_api.exceptions import ApiKeyError
-from petstore_api.exceptions import ApiAttributeError
from petstore_api.exceptions import ApiException
-# import models into sdk package
-from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
-from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
-from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
-from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
-from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
-from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
-from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
-from petstore_api.models.additional_properties_string import AdditionalPropertiesString
-from petstore_api.models.animal import Animal
-from petstore_api.models.api_response import ApiResponse
-from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
-from petstore_api.models.array_test import ArrayTest
-from petstore_api.models.big_cat import BigCat
-from petstore_api.models.big_cat_all_of import BigCatAllOf
-from petstore_api.models.capitalization import Capitalization
-from petstore_api.models.cat import Cat
-from petstore_api.models.cat_all_of import CatAllOf
-from petstore_api.models.category import Category
-from petstore_api.models.class_model import ClassModel
-from petstore_api.models.client import Client
-from petstore_api.models.dog import Dog
-from petstore_api.models.dog_all_of import DogAllOf
-from petstore_api.models.enum_arrays import EnumArrays
-from petstore_api.models.enum_class import EnumClass
-from petstore_api.models.enum_test import EnumTest
-from petstore_api.models.file import File
-from petstore_api.models.file_schema_test_class import FileSchemaTestClass
-from petstore_api.models.format_test import FormatTest
-from petstore_api.models.has_only_read_only import HasOnlyReadOnly
-from petstore_api.models.list import List
-from petstore_api.models.map_test import MapTest
-from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-from petstore_api.models.model200_response import Model200Response
-from petstore_api.models.model_return import ModelReturn
-from petstore_api.models.name import Name
-from petstore_api.models.number_only import NumberOnly
-from petstore_api.models.order import Order
-from petstore_api.models.outer_composite import OuterComposite
-from petstore_api.models.outer_enum import OuterEnum
-from petstore_api.models.pet import Pet
-from petstore_api.models.read_only_first import ReadOnlyFirst
-from petstore_api.models.special_model_name import SpecialModelName
-from petstore_api.models.tag import Tag
-from petstore_api.models.type_holder_default import TypeHolderDefault
-from petstore_api.models.type_holder_example import TypeHolderExample
-from petstore_api.models.user import User
-from petstore_api.models.xml_item import XmlItem
-
diff --git a/samples/client/petstore/python/petstore_api/api/__init__.py b/samples/client/petstore/python/petstore_api/api/__init__.py
index 74496adb5a2b..840e9f0cd908 100644
--- a/samples/client/petstore/python/petstore_api/api/__init__.py
+++ b/samples/client/petstore/python/petstore_api/api/__init__.py
@@ -1,11 +1,3 @@
-from __future__ import absolute_import
-
-# flake8: noqa
-
-# import apis into api package
-from petstore_api.api.another_fake_api import AnotherFakeApi
-from petstore_api.api.fake_api import FakeApi
-from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
-from petstore_api.api.pet_api import PetApi
-from petstore_api.api.store_api import StoreApi
-from petstore_api.api.user_api import UserApi
+# do not import all apis into this module because that uses a lot of memory and stack frames
+# if you need the ability to import all apis from one package, import them with
+# from petstore_api.apis import AnotherFakeApi
diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py
index 6fdd45236472..29cc147fd32d 100644
--- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py
+++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.client import Client
class AnotherFakeApi(object):
@@ -36,141 +38,120 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def call_123_test_special_tags(self, body, **kwargs): # noqa: E501
- """To test special tags # noqa: E501
-
- To test special tags and operation ID starting with number # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.call_123_test_special_tags(body, async_req=True)
- >>> result = thread.get()
-
- :param body: client model (required)
- :type body: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Client
- """
- kwargs['_return_http_data_only'] = True
- return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501
-
- def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501
- """To test special tags # noqa: E501
-
- To test special tags and operation ID starting with number # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: client model (required)
- :type body: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __call_123_test_special_tags(
+ self,
+ body,
+ **kwargs
+ ):
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (Client): client model
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Client
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.call_123_test_special_tags = Endpoint(
+ settings={
+ 'response_type': (Client,),
+ 'auth': [],
+ 'endpoint_path': '/another-fake/dummy',
+ 'operation_id': 'call_123_test_special_tags',
+ 'http_method': 'PATCH',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (Client,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__call_123_test_special_tags
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method call_123_test_special_tags" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Client",
- }
-
- return self.api_client.call_api(
- '/another-fake/dummy', 'PATCH',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py
index 252a82c0ef44..316c8136ce2a 100644
--- a/samples/client/petstore/python/petstore_api/api/fake_api.py
+++ b/samples/client/petstore/python/petstore_api/api/fake_api.py
@@ -10,18 +10,27 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.animal_farm import AnimalFarm
+from petstore_api.model.client import Client
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+from petstore_api.model.number_with_validations import NumberWithValidations
+from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
+from petstore_api.model.string_enum import StringEnum
+from petstore_api.model.user import User
+from petstore_api.model.xml_item import XmlItem
class FakeApi(object):
@@ -36,2141 +45,2181 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def create_xml_item(self, xml_item, **kwargs): # noqa: E501
- """creates an XmlItem # noqa: E501
-
- this route creates an XmlItem # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.create_xml_item(xml_item, async_req=True)
- >>> result = thread.get()
-
- :param xml_item: XmlItem Body (required)
- :type xml_item: XmlItem
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501
-
- def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501
- """creates an XmlItem # noqa: E501
-
- this route creates an XmlItem # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True)
- >>> result = thread.get()
-
- :param xml_item: XmlItem Body (required)
- :type xml_item: XmlItem
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'xml_item'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __array_model(
+ self,
+ **kwargs
+ ):
+ """array_model # noqa: E501
+
+ Test serialization of ArrayModel # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.array_model(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (AnimalFarm): Input model. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ AnimalFarm
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.array_model = Endpoint(
+ settings={
+ 'response_type': (AnimalFarm,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/arraymodel',
+ 'operation_id': 'array_model',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (AnimalFarm,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ '*/*'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__array_model
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_xml_item" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'xml_item' is set
- if self.api_client.client_side_validation and ('xml_item' not in local_var_params or # noqa: E501
- local_var_params['xml_item'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'xml_item' in local_var_params:
- body_params = local_var_params['xml_item']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/create_xml_item', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501
- """fake_outer_boolean_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_boolean_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input boolean as post body
- :type body: bool
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: bool
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_boolean_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input boolean as post body
- :type body: bool
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __boolean(
+ self,
+ **kwargs
+ ):
+ """boolean # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.boolean(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (bool): Input boolean as post body. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ bool
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.boolean = Endpoint(
+ settings={
+ 'response_type': (bool,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/boolean',
+ 'operation_id': 'boolean',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (bool,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ '*/*'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__boolean
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_boolean_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "bool",
- }
-
- return self.api_client.call_api(
- '/fake/outer/boolean', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_composite_serialize(self, **kwargs): # noqa: E501
- """fake_outer_composite_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_composite_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input composite as post body
- :type body: OuterComposite
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: OuterComposite
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_composite_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input composite as post body
- :type body: OuterComposite
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_xml_item(
+ self,
+ xml_item,
+ **kwargs
+ ):
+ """creates an XmlItem # noqa: E501
+
+ this route creates an XmlItem # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_xml_item(xml_item, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ xml_item (XmlItem): XmlItem Body
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['xml_item'] = \
+ xml_item
+ return self.call_with_http_info(**kwargs)
+
+ self.create_xml_item = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/create_xml_item',
+ 'operation_id': 'create_xml_item',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'xml_item',
+ ],
+ 'required': [
+ 'xml_item',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'xml_item':
+ (XmlItem,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'xml_item': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/xml',
+ 'application/xml; charset=utf-8',
+ 'application/xml; charset=utf-16',
+ 'text/xml',
+ 'text/xml; charset=utf-8',
+ 'text/xml; charset=utf-16'
+ ]
+ },
+ api_client=api_client,
+ callable=__create_xml_item
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_composite_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "OuterComposite",
- }
-
- return self.api_client.call_api(
- '/fake/outer/composite', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_number_serialize(self, **kwargs): # noqa: E501
- """fake_outer_number_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_number_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input number as post body
- :type body: float
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: float
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_number_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input number as post body
- :type body: float
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __number_with_validations(
+ self,
+ **kwargs
+ ):
+ """number_with_validations # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.number_with_validations(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (NumberWithValidations): Input number as post body. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ NumberWithValidations
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.number_with_validations = Endpoint(
+ settings={
+ 'response_type': (NumberWithValidations,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/number',
+ 'operation_id': 'number_with_validations',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (NumberWithValidations,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ '*/*'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__number_with_validations
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_number_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "float",
- }
-
- return self.api_client.call_api(
- '/fake/outer/number', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_string_serialize(self, **kwargs): # noqa: E501
- """fake_outer_string_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_string_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input string as post body
- :type body: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: str
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_string_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input string as post body
- :type body: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __object_model_with_ref_props(
+ self,
+ **kwargs
+ ):
+ """object_model_with_ref_props # noqa: E501
+
+ Test serialization of object with $refed properties # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.object_model_with_ref_props(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (ObjectModelWithRefProps): Input model. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ObjectModelWithRefProps
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.object_model_with_ref_props = Endpoint(
+ settings={
+ 'response_type': (ObjectModelWithRefProps,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/object_model_with_ref_props',
+ 'operation_id': 'object_model_with_ref_props',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (ObjectModelWithRefProps,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ '*/*'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__object_model_with_ref_props
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_string_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "str",
- }
-
- return self.api_client.call_api(
- '/fake/outer/string', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_body_with_file_schema(self, body, **kwargs): # noqa: E501
- """test_body_with_file_schema # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_body_with_file_schema(body, async_req=True)
- >>> result = thread.get()
-
- :param body: (required)
- :type body: FileSchemaTestClass
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501
-
- def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501
- """test_body_with_file_schema # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: (required)
- :type body: FileSchemaTestClass
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __string(
+ self,
+ **kwargs
+ ):
+ """string # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.string(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (str): Input string as post body. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ str
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.string = Endpoint(
+ settings={
+ 'response_type': (str,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/string',
+ 'operation_id': 'string',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (str,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ '*/*'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__string
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_body_with_file_schema" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/body-with-file-schema', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_body_with_query_params(query, body, async_req=True)
- >>> result = thread.get()
-
- :param query: (required)
- :type query: str
- :param body: (required)
- :type body: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501
-
- def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True)
- >>> result = thread.get()
-
- :param query: (required)
- :type query: str
- :param body: (required)
- :type body: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'query',
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __string_enum(
+ self,
+ **kwargs
+ ):
+ """string_enum # noqa: E501
+
+ Test serialization of outer enum # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.string_enum(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (StringEnum): Input enum. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ StringEnum
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.string_enum = Endpoint(
+ settings={
+ 'response_type': (StringEnum,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/enum',
+ 'operation_id': 'string_enum',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (StringEnum,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ '*/*'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__string_enum
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_body_with_query_params" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'query' is set
- if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501
- local_var_params['query'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501
- query_params.append(('query', local_var_params['query'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/body-with-query-params', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_client_model(self, body, **kwargs): # noqa: E501
- """To test \"client\" model # noqa: E501
-
- To test \"client\" model # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_client_model(body, async_req=True)
- >>> result = thread.get()
-
- :param body: client model (required)
- :type body: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Client
- """
- kwargs['_return_http_data_only'] = True
- return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501
-
- def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501
- """To test \"client\" model # noqa: E501
-
- To test \"client\" model # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_client_model_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: client model (required)
- :type body: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_body_with_file_schema(
+ self,
+ body,
+ **kwargs
+ ):
+ """test_body_with_file_schema # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_body_with_file_schema(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (FileSchemaTestClass):
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.test_body_with_file_schema = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/body-with-file-schema',
+ 'operation_id': 'test_body_with_file_schema',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (FileSchemaTestClass,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_body_with_file_schema
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_client_model" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Client",
- }
-
- return self.api_client.call_api(
- '/fake', 'PATCH',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
- """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
- >>> result = thread.get()
-
- :param number: None (required)
- :type number: float
- :param double: None (required)
- :type double: float
- :param pattern_without_delimiter: None (required)
- :type pattern_without_delimiter: str
- :param byte: None (required)
- :type byte: str
- :param integer: None
- :type integer: int
- :param int32: None
- :type int32: int
- :param int64: None
- :type int64: int
- :param float: None
- :type float: float
- :param string: None
- :type string: str
- :param binary: None
- :type binary: file
- :param date: None
- :type date: date
- :param date_time: None
- :type date_time: datetime
- :param password: None
- :type password: str
- :param param_callback: None
- :type param_callback: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
-
- def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
- """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
- >>> result = thread.get()
-
- :param number: None (required)
- :type number: float
- :param double: None (required)
- :type double: float
- :param pattern_without_delimiter: None (required)
- :type pattern_without_delimiter: str
- :param byte: None (required)
- :type byte: str
- :param integer: None
- :type integer: int
- :param int32: None
- :type int32: int
- :param int64: None
- :type int64: int
- :param float: None
- :type float: float
- :param string: None
- :type string: str
- :param binary: None
- :type binary: file
- :param date: None
- :type date: date
- :param date_time: None
- :type date_time: datetime
- :param password: None
- :type password: str
- :param param_callback: None
- :type param_callback: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'byte',
- 'integer',
- 'int32',
- 'int64',
- 'float',
- 'string',
- 'binary',
- 'date',
- 'date_time',
- 'password',
- 'param_callback'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_body_with_query_params(
+ self,
+ query,
+ body,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.test_body_with_query_params(query, body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ query (str):
+ body (User):
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['query'] = \
+ query
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.test_body_with_query_params = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/body-with-query-params',
+ 'operation_id': 'test_body_with_query_params',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'query',
+ 'body',
+ ],
+ 'required': [
+ 'query',
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'query':
+ (str,),
+ 'body':
+ (User,),
+ },
+ 'attribute_map': {
+ 'query': 'query',
+ },
+ 'location_map': {
+ 'query': 'query',
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_body_with_query_params
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_endpoint_parameters" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'number' is set
- if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501
- local_var_params['number'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501
- # verify the required parameter 'double' is set
- if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501
- local_var_params['double'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501
- # verify the required parameter 'pattern_without_delimiter' is set
- if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501
- local_var_params['pattern_without_delimiter'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501
- # verify the required parameter 'byte' is set
- if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501
- local_var_params['byte'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501
-
- if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501
- raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501
- if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501
- raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501
- if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501
- raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501
- if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501
- raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501
- if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501
- raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501
- if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501
- raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501
- if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501
- raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501
- if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501
- raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501
- if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501
- raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501
- if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501
- raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501
- if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501
- raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501
- if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
- len(local_var_params['password']) > 64): # noqa: E501
- raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501
- if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
- len(local_var_params['password']) < 10): # noqa: E501
- raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'integer' in local_var_params:
- form_params.append(('integer', local_var_params['integer'])) # noqa: E501
- if 'int32' in local_var_params:
- form_params.append(('int32', local_var_params['int32'])) # noqa: E501
- if 'int64' in local_var_params:
- form_params.append(('int64', local_var_params['int64'])) # noqa: E501
- if 'number' in local_var_params:
- form_params.append(('number', local_var_params['number'])) # noqa: E501
- if 'float' in local_var_params:
- form_params.append(('float', local_var_params['float'])) # noqa: E501
- if 'double' in local_var_params:
- form_params.append(('double', local_var_params['double'])) # noqa: E501
- if 'string' in local_var_params:
- form_params.append(('string', local_var_params['string'])) # noqa: E501
- if 'pattern_without_delimiter' in local_var_params:
- form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501
- if 'byte' in local_var_params:
- form_params.append(('byte', local_var_params['byte'])) # noqa: E501
- if 'binary' in local_var_params:
- local_var_files['binary'] = local_var_params['binary'] # noqa: E501
- if 'date' in local_var_params:
- form_params.append(('date', local_var_params['date'])) # noqa: E501
- if 'date_time' in local_var_params:
- form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501
- if 'password' in local_var_params:
- form_params.append(('password', local_var_params['password'])) # noqa: E501
- if 'param_callback' in local_var_params:
- form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['http_basic_test'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_enum_parameters(self, **kwargs): # noqa: E501
- """To test enum parameters # noqa: E501
-
- To test enum parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_enum_parameters(async_req=True)
- >>> result = thread.get()
-
- :param enum_header_string_array: Header parameter enum test (string array)
- :type enum_header_string_array: list[str]
- :param enum_header_string: Header parameter enum test (string)
- :type enum_header_string: str
- :param enum_query_string_array: Query parameter enum test (string array)
- :type enum_query_string_array: list[str]
- :param enum_query_string: Query parameter enum test (string)
- :type enum_query_string: str
- :param enum_query_integer: Query parameter enum test (double)
- :type enum_query_integer: int
- :param enum_query_double: Query parameter enum test (double)
- :type enum_query_double: float
- :param enum_form_string_array: Form parameter enum test (string array)
- :type enum_form_string_array: list[str]
- :param enum_form_string: Form parameter enum test (string)
- :type enum_form_string: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
-
- def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501
- """To test enum parameters # noqa: E501
-
- To test enum parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_enum_parameters_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param enum_header_string_array: Header parameter enum test (string array)
- :type enum_header_string_array: list[str]
- :param enum_header_string: Header parameter enum test (string)
- :type enum_header_string: str
- :param enum_query_string_array: Query parameter enum test (string array)
- :type enum_query_string_array: list[str]
- :param enum_query_string: Query parameter enum test (string)
- :type enum_query_string: str
- :param enum_query_integer: Query parameter enum test (double)
- :type enum_query_integer: int
- :param enum_query_double: Query parameter enum test (double)
- :type enum_query_double: float
- :param enum_form_string_array: Form parameter enum test (string array)
- :type enum_form_string_array: list[str]
- :param enum_form_string: Form parameter enum test (string)
- :type enum_form_string: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- 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'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_client_model(
+ self,
+ body,
+ **kwargs
+ ):
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (Client): client model
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Client
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.test_client_model = Endpoint(
+ settings={
+ 'response_type': (Client,),
+ 'auth': [],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_client_model',
+ 'http_method': 'PATCH',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (Client,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_client_model
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_enum_parameters" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501
- query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501
- collection_formats['enum_query_string_array'] = 'csv' # noqa: E501
- if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501
- query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501
- if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501
- query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501
- if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501
- query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501
-
- header_params = {}
- if 'enum_header_string_array' in local_var_params:
- header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501
- collection_formats['enum_header_string_array'] = 'csv' # noqa: E501
- if 'enum_header_string' in local_var_params:
- header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501
-
- form_params = []
- local_var_files = {}
- if 'enum_form_string_array' in local_var_params:
- form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501
- collection_formats['enum_form_string_array'] = 'csv' # noqa: E501
- if 'enum_form_string' in local_var_params:
- form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
- """Fake endpoint to test group parameters (optional) # noqa: E501
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
- >>> result = thread.get()
-
- :param required_string_group: Required String in group parameters (required)
- :type required_string_group: int
- :param required_boolean_group: Required Boolean in group parameters (required)
- :type required_boolean_group: bool
- :param required_int64_group: Required Integer in group parameters (required)
- :type required_int64_group: int
- :param string_group: String in group parameters
- :type string_group: int
- :param boolean_group: Boolean in group parameters
- :type boolean_group: bool
- :param int64_group: Integer in group parameters
- :type int64_group: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
-
- def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
- """Fake endpoint to test group parameters (optional) # noqa: E501
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
- >>> result = thread.get()
-
- :param required_string_group: Required String in group parameters (required)
- :type required_string_group: int
- :param required_boolean_group: Required Boolean in group parameters (required)
- :type required_boolean_group: bool
- :param required_int64_group: Required Integer in group parameters (required)
- :type required_int64_group: int
- :param string_group: String in group parameters
- :type string_group: int
- :param boolean_group: Boolean in group parameters
- :type boolean_group: bool
- :param int64_group: Integer in group parameters
- :type int64_group: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'required_string_group',
- 'required_boolean_group',
- 'required_int64_group',
- 'string_group',
- 'boolean_group',
- 'int64_group'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_endpoint_enums_length_one(
+ self,
+ query_integer=3,
+ query_string="brillig",
+ path_string="hello",
+ path_integer=34,
+ header_number=1.234,
+ **kwargs
+ ):
+ """test_endpoint_enums_length_one # noqa: E501
+
+ This route has required values with enums of 1 # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ query_integer (int): defaults to 3, must be one of [3]
+ query_string (str): defaults to "brillig", must be one of ["brillig"]
+ path_string (str): defaults to "hello", must be one of ["hello"]
+ path_integer (int): defaults to 34, must be one of [34]
+ header_number (float): defaults to 1.234, must be one of [1.234]
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['query_integer'] = \
+ query_integer
+ kwargs['query_string'] = \
+ query_string
+ kwargs['path_string'] = \
+ path_string
+ kwargs['path_integer'] = \
+ path_integer
+ kwargs['header_number'] = \
+ header_number
+ return self.call_with_http_info(**kwargs)
+
+ self.test_endpoint_enums_length_one = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/enums-of-length-one/{path_string}/{path_integer}',
+ 'operation_id': 'test_endpoint_enums_length_one',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'query_integer',
+ 'query_string',
+ 'path_string',
+ 'path_integer',
+ 'header_number',
+ ],
+ 'required': [
+ 'query_integer',
+ 'query_string',
+ 'path_string',
+ 'path_integer',
+ 'header_number',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ 'query_integer',
+ 'query_string',
+ 'path_string',
+ 'path_integer',
+ 'header_number',
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ ('query_integer',): {
+
+ "3": 3
+ },
+ ('query_string',): {
+
+ "BRILLIG": "brillig"
+ },
+ ('path_string',): {
+
+ "HELLO": "hello"
+ },
+ ('path_integer',): {
+
+ "34": 34
+ },
+ ('header_number',): {
+
+ "1.234": 1.234
+ },
+ },
+ 'openapi_types': {
+ 'query_integer':
+ (int,),
+ 'query_string':
+ (str,),
+ 'path_string':
+ (str,),
+ 'path_integer':
+ (int,),
+ 'header_number':
+ (float,),
+ },
+ 'attribute_map': {
+ 'query_integer': 'query_integer',
+ 'query_string': 'query_string',
+ 'path_string': 'path_string',
+ 'path_integer': 'path_integer',
+ 'header_number': 'header_number',
+ },
+ 'location_map': {
+ 'query_integer': 'query',
+ 'query_string': 'query',
+ 'path_string': 'path',
+ 'path_integer': 'path',
+ 'header_number': 'header',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__test_endpoint_enums_length_one
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_group_parameters" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'required_string_group' is set
- if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501
- local_var_params['required_string_group'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
- # verify the required parameter 'required_boolean_group' is set
- if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501
- local_var_params['required_boolean_group'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
- # verify the required parameter 'required_int64_group' is set
- if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501
- local_var_params['required_int64_group'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501
- query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
- if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501
- query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
- if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501
- query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
- if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501
- query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
-
- header_params = {}
- if 'required_boolean_group' in local_var_params:
- header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
- if 'boolean_group' in local_var_params:
- header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_inline_additional_properties(self, param, **kwargs): # noqa: E501
- """test inline additionalProperties # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_inline_additional_properties(param, async_req=True)
- >>> result = thread.get()
-
- :param param: request body (required)
- :type param: dict(str, str)
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501
-
- def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501
- """test inline additionalProperties # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True)
- >>> result = thread.get()
-
- :param param: request body (required)
- :type param: dict(str, str)
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'param'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_endpoint_parameters(
+ self,
+ number,
+ double,
+ pattern_without_delimiter,
+ byte,
+ **kwargs
+ ):
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ number (float): None
+ double (float): None
+ pattern_without_delimiter (str): None
+ byte (str): None
+
+ Keyword Args:
+ integer (int): None. [optional]
+ int32 (int): None. [optional]
+ int64 (int): None. [optional]
+ float (float): None. [optional]
+ string (str): None. [optional]
+ binary (file_type): None. [optional]
+ date (date): None. [optional]
+ date_time (datetime): None. [optional]
+ password (str): None. [optional]
+ param_callback (str): None. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['number'] = \
+ number
+ kwargs['double'] = \
+ double
+ kwargs['pattern_without_delimiter'] = \
+ pattern_without_delimiter
+ kwargs['byte'] = \
+ byte
+ return self.call_with_http_info(**kwargs)
+
+ self.test_endpoint_parameters = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'http_basic_test'
+ ],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_endpoint_parameters',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ 'integer',
+ 'int32',
+ 'int64',
+ 'float',
+ 'string',
+ 'binary',
+ 'date',
+ 'date_time',
+ 'password',
+ 'param_callback',
+ ],
+ 'required': [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'integer',
+ 'int32',
+ 'float',
+ 'string',
+ 'password',
+ ]
+ },
+ root_map={
+ 'validations': {
+ ('number',): {
+
+ 'inclusive_maximum': 543.2,
+ 'inclusive_minimum': 32.1,
+ },
+ ('double',): {
+
+ 'inclusive_maximum': 123.4,
+ 'inclusive_minimum': 67.8,
+ },
+ ('pattern_without_delimiter',): {
+
+ 'regex': {
+ 'pattern': r'^[A-Z].*', # noqa: E501
+ },
+ },
+ ('integer',): {
+
+ 'inclusive_maximum': 100,
+ 'inclusive_minimum': 10,
+ },
+ ('int32',): {
+
+ 'inclusive_maximum': 200,
+ 'inclusive_minimum': 20,
+ },
+ ('float',): {
+
+ 'inclusive_maximum': 987.6,
+ },
+ ('string',): {
+
+ 'regex': {
+ 'pattern': r'[a-z]', # noqa: E501
+ 'flags': (re.IGNORECASE)
+ },
+ },
+ ('password',): {
+ 'max_length': 64,
+ 'min_length': 10,
+ },
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'number':
+ (float,),
+ 'double':
+ (float,),
+ 'pattern_without_delimiter':
+ (str,),
+ 'byte':
+ (str,),
+ 'integer':
+ (int,),
+ 'int32':
+ (int,),
+ 'int64':
+ (int,),
+ 'float':
+ (float,),
+ 'string':
+ (str,),
+ 'binary':
+ (file_type,),
+ 'date':
+ (date,),
+ 'date_time':
+ (datetime,),
+ 'password':
+ (str,),
+ 'param_callback':
+ (str,),
+ },
+ 'attribute_map': {
+ 'number': 'number',
+ 'double': 'double',
+ 'pattern_without_delimiter': 'pattern_without_delimiter',
+ 'byte': 'byte',
+ 'integer': 'integer',
+ 'int32': 'int32',
+ 'int64': 'int64',
+ 'float': 'float',
+ 'string': 'string',
+ 'binary': 'binary',
+ 'date': 'date',
+ 'date_time': 'dateTime',
+ 'password': 'password',
+ 'param_callback': 'callback',
+ },
+ 'location_map': {
+ 'number': 'form',
+ 'double': 'form',
+ 'pattern_without_delimiter': 'form',
+ 'byte': 'form',
+ 'integer': 'form',
+ 'int32': 'form',
+ 'int64': 'form',
+ 'float': 'form',
+ 'string': 'form',
+ 'binary': 'form',
+ 'date': 'form',
+ 'date_time': 'form',
+ 'password': 'form',
+ 'param_callback': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_endpoint_parameters
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_inline_additional_properties" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'param' is set
- if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501
- local_var_params['param'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'param' in local_var_params:
- body_params = local_var_params['param']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/inline-additionalProperties', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_json_form_data(self, param, param2, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_json_form_data(param, param2, async_req=True)
- >>> result = thread.get()
-
- :param param: field1 (required)
- :type param: str
- :param param2: field2 (required)
- :type param2: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
-
- def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
- >>> result = thread.get()
-
- :param param: field1 (required)
- :type param: str
- :param param2: field2 (required)
- :type param2: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'param',
- 'param2'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_enum_parameters(
+ self,
+ **kwargs
+ ):
+ """To test enum parameters # noqa: E501
+
+ To test enum parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_enum_parameters(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ enum_header_string_array ([str]): Header parameter enum test (string array). [optional]
+ enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
+ enum_query_string_array ([str]): Query parameter enum test (string array). [optional]
+ enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
+ enum_query_integer (int): Query parameter enum test (double). [optional]
+ enum_query_double (float): Query parameter enum test (double). [optional]
+ enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$"
+ enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.test_enum_parameters = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_enum_parameters',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ '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',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ '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',
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ ('enum_header_string_array',): {
+
+ ">": ">",
+ "$": "$"
+ },
+ ('enum_header_string',): {
+
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ },
+ ('enum_query_string_array',): {
+
+ ">": ">",
+ "$": "$"
+ },
+ ('enum_query_string',): {
+
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ },
+ ('enum_query_integer',): {
+
+ "1": 1,
+ "-2": -2
+ },
+ ('enum_query_double',): {
+
+ "1.1": 1.1,
+ "-1.2": -1.2
+ },
+ ('enum_form_string_array',): {
+
+ ">": ">",
+ "$": "$"
+ },
+ ('enum_form_string',): {
+
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ },
+ },
+ 'openapi_types': {
+ 'enum_header_string_array':
+ ([str],),
+ 'enum_header_string':
+ (str,),
+ 'enum_query_string_array':
+ ([str],),
+ 'enum_query_string':
+ (str,),
+ 'enum_query_integer':
+ (int,),
+ 'enum_query_double':
+ (float,),
+ 'enum_form_string_array':
+ ([str],),
+ 'enum_form_string':
+ (str,),
+ },
+ 'attribute_map': {
+ 'enum_header_string_array': 'enum_header_string_array',
+ 'enum_header_string': 'enum_header_string',
+ 'enum_query_string_array': 'enum_query_string_array',
+ 'enum_query_string': 'enum_query_string',
+ 'enum_query_integer': 'enum_query_integer',
+ 'enum_query_double': 'enum_query_double',
+ 'enum_form_string_array': 'enum_form_string_array',
+ 'enum_form_string': 'enum_form_string',
+ },
+ 'location_map': {
+ 'enum_header_string_array': 'header',
+ 'enum_header_string': 'header',
+ 'enum_query_string_array': 'query',
+ 'enum_query_string': 'query',
+ 'enum_query_integer': 'query',
+ 'enum_query_double': 'query',
+ 'enum_form_string_array': 'form',
+ 'enum_form_string': 'form',
+ },
+ 'collection_format_map': {
+ 'enum_header_string_array': 'csv',
+ 'enum_query_string_array': 'csv',
+ 'enum_form_string_array': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_enum_parameters
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_json_form_data" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'param' is set
- if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501
- local_var_params['param'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501
- # verify the required parameter 'param2' is set
- if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501
- local_var_params['param2'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'param' in local_var_params:
- form_params.append(('param', local_var_params['param'])) # noqa: E501
- if 'param2' in local_var_params:
- form_params.append(('param2', local_var_params['param2'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/jsonFormData', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
- """test_query_parameter_collection_format # noqa: E501
-
- To test the collection format in query parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True)
- >>> result = thread.get()
-
- :param pipe: (required)
- :type pipe: list[str]
- :param ioutil: (required)
- :type ioutil: list[str]
- :param http: (required)
- :type http: list[str]
- :param url: (required)
- :type url: list[str]
- :param context: (required)
- :type context: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501
-
- def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
- """test_query_parameter_collection_format # noqa: E501
-
- To test the collection format in query parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True)
- >>> result = thread.get()
-
- :param pipe: (required)
- :type pipe: list[str]
- :param ioutil: (required)
- :type ioutil: list[str]
- :param http: (required)
- :type http: list[str]
- :param url: (required)
- :type url: list[str]
- :param context: (required)
- :type context: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pipe',
- 'ioutil',
- 'http',
- 'url',
- 'context'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_group_parameters(
+ self,
+ required_string_group,
+ required_boolean_group,
+ required_int64_group,
+ **kwargs
+ ):
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ required_string_group (int): Required String in group parameters
+ required_boolean_group (bool): Required Boolean in group parameters
+ required_int64_group (int): Required Integer in group parameters
+
+ Keyword Args:
+ string_group (int): String in group parameters. [optional]
+ boolean_group (bool): Boolean in group parameters. [optional]
+ int64_group (int): Integer in group parameters. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['required_string_group'] = \
+ required_string_group
+ kwargs['required_boolean_group'] = \
+ required_boolean_group
+ kwargs['required_int64_group'] = \
+ required_int64_group
+ return self.call_with_http_info(**kwargs)
+
+ self.test_group_parameters = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_group_parameters',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ 'string_group',
+ 'boolean_group',
+ 'int64_group',
+ ],
+ 'required': [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'required_string_group':
+ (int,),
+ 'required_boolean_group':
+ (bool,),
+ 'required_int64_group':
+ (int,),
+ 'string_group':
+ (int,),
+ 'boolean_group':
+ (bool,),
+ 'int64_group':
+ (int,),
+ },
+ 'attribute_map': {
+ 'required_string_group': 'required_string_group',
+ 'required_boolean_group': 'required_boolean_group',
+ 'required_int64_group': 'required_int64_group',
+ 'string_group': 'string_group',
+ 'boolean_group': 'boolean_group',
+ 'int64_group': 'int64_group',
+ },
+ 'location_map': {
+ 'required_string_group': 'query',
+ 'required_boolean_group': 'header',
+ 'required_int64_group': 'query',
+ 'string_group': 'query',
+ 'boolean_group': 'header',
+ 'int64_group': 'query',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__test_group_parameters
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_query_parameter_collection_format" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pipe' is set
- if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501
- local_var_params['pipe'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'ioutil' is set
- if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501
- local_var_params['ioutil'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'http' is set
- if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501
- local_var_params['http'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'url' is set
- if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501
- local_var_params['url'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'context' is set
- if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501
- local_var_params['context'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501
- query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501
- collection_formats['pipe'] = 'csv' # noqa: E501
- if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501
- query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501
- collection_formats['ioutil'] = 'csv' # noqa: E501
- if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501
- query_params.append(('http', local_var_params['http'])) # noqa: E501
- collection_formats['http'] = 'ssv' # noqa: E501
- if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501
- query_params.append(('url', local_var_params['url'])) # noqa: E501
- collection_formats['url'] = 'csv' # noqa: E501
- if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501
- query_params.append(('context', local_var_params['context'])) # noqa: E501
- collection_formats['context'] = 'multi' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/test-query-paramters', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
+ def __test_inline_additional_properties(
+ self,
+ param,
+ **kwargs
+ ):
+ """test inline additionalProperties # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties(param, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ param ({str: (str,)}): request body
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['param'] = \
+ param
+ return self.call_with_http_info(**kwargs)
+
+ self.test_inline_additional_properties = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/inline-additionalProperties',
+ 'operation_id': 'test_inline_additional_properties',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'param',
+ ],
+ 'required': [
+ 'param',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'param':
+ ({str: (str,)},),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'param': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_inline_additional_properties
+ )
+
+ def __test_json_form_data(
+ self,
+ param,
+ param2,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.test_json_form_data(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ param (str): field1
+ param2 (str): field2
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['param'] = \
+ param
+ kwargs['param2'] = \
+ param2
+ return self.call_with_http_info(**kwargs)
+
+ self.test_json_form_data = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/jsonFormData',
+ 'operation_id': 'test_json_form_data',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'param',
+ 'param2',
+ ],
+ 'required': [
+ 'param',
+ 'param2',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'param':
+ (str,),
+ 'param2':
+ (str,),
+ },
+ 'attribute_map': {
+ 'param': 'param',
+ 'param2': 'param2',
+ },
+ 'location_map': {
+ 'param': 'form',
+ 'param2': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_json_form_data
+ )
diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py
index f87835d7a61d..634f9f13103a 100644
--- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py
+++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.client import Client
class FakeClassnameTags123Api(object):
@@ -36,141 +38,122 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def test_classname(self, body, **kwargs): # noqa: E501
- """To test class name in snake case # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_classname(body, async_req=True)
- >>> result = thread.get()
-
- :param body: client model (required)
- :type body: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Client
- """
- kwargs['_return_http_data_only'] = True
- return self.test_classname_with_http_info(body, **kwargs) # noqa: E501
-
- def test_classname_with_http_info(self, body, **kwargs): # noqa: E501
- """To test class name in snake case # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_classname_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: client model (required)
- :type body: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_classname(
+ self,
+ body,
+ **kwargs
+ ):
+ """To test class name in snake case # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_classname(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (Client): client model
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Client
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.test_classname = Endpoint(
+ settings={
+ 'response_type': (Client,),
+ 'auth': [
+ 'api_key_query'
+ ],
+ 'endpoint_path': '/fake_classname_test',
+ 'operation_id': 'test_classname',
+ 'http_method': 'PATCH',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (Client,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_classname
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_classname" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['api_key_query'] # noqa: E501
-
- response_types_map = {
- 200: "Client",
- }
-
- return self.api_client.call_api(
- '/fake_classname_test', 'PATCH',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py
index 5baedc8e6d27..66611a73f3ca 100644
--- a/samples/client/petstore/python/petstore_api/api/pet_api.py
+++ b/samples/client/petstore/python/petstore_api/api/pet_api.py
@@ -10,18 +10,21 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.api_response import ApiResponse
+from petstore_api.model.pet import Pet
class PetApi(object):
@@ -36,1260 +39,1134 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def add_pet(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.add_pet(body, async_req=True)
- >>> result = thread.get()
-
- :param body: Pet object that needs to be added to the store (required)
- :type body: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.add_pet_with_http_info(body, **kwargs) # noqa: E501
-
- def add_pet_with_http_info(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.add_pet_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: Pet object that needs to be added to the store (required)
- :type body: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __add_pet(
+ self,
+ body,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.add_pet(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (Pet): Pet object that needs to be added to the store
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.add_pet = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet',
+ 'operation_id': 'add_pet',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (Pet,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json',
+ 'application/xml'
+ ]
+ },
+ api_client=api_client,
+ callable=__add_pet
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method add_pet" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json', 'application/xml']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def delete_pet(self, pet_id, **kwargs): # noqa: E501
- """Deletes a pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.delete_pet(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: Pet id to delete (required)
- :type pet_id: int
- :param api_key:
- :type api_key: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """Deletes a pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: Pet id to delete (required)
- :type pet_id: int
- :param api_key:
- :type api_key: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'api_key'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __delete_pet(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """Deletes a pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): Pet id to delete
+
+ Keyword Args:
+ api_key (str): [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.delete_pet = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/{petId}',
+ 'operation_id': 'delete_pet',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'api_key',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'api_key':
+ (str,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'api_key': 'api_key',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'api_key': 'header',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__delete_pet
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_pet" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
- if 'api_key' in local_var_params:
- header_params['api_key'] = local_var_params['api_key'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet/{petId}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def find_pets_by_status(self, status, **kwargs): # noqa: E501
- """Finds Pets by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_status(status, async_req=True)
- >>> result = thread.get()
-
- :param status: Status values that need to be considered for filter (required)
- :type status: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: list[Pet]
- """
- kwargs['_return_http_data_only'] = True
- return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
-
- def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501
- """Finds Pets by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
- >>> result = thread.get()
-
- :param status: Status values that need to be considered for filter (required)
- :type status: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'status'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __find_pets_by_status(
+ self,
+ status,
+ **kwargs
+ ):
+ """Finds Pets by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_status(status, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ status ([str]): Status values that need to be considered for filter
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ [Pet]
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['status'] = \
+ status
+ return self.call_with_http_info(**kwargs)
+
+ self.find_pets_by_status = Endpoint(
+ settings={
+ 'response_type': ([Pet],),
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/findByStatus',
+ 'operation_id': 'find_pets_by_status',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'status',
+ ],
+ 'required': [
+ 'status',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ 'status',
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ ('status',): {
+
+ "AVAILABLE": "available",
+ "PENDING": "pending",
+ "SOLD": "sold"
+ },
+ },
+ 'openapi_types': {
+ 'status':
+ ([str],),
+ },
+ 'attribute_map': {
+ 'status': 'status',
+ },
+ 'location_map': {
+ 'status': 'query',
+ },
+ 'collection_format_map': {
+ 'status': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__find_pets_by_status
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method find_pets_by_status" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'status' is set
- if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501
- local_var_params['status'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501
- query_params.append(('status', local_var_params['status'])) # noqa: E501
- collection_formats['status'] = 'csv' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "list[Pet]",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/pet/findByStatus', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def find_pets_by_tags(self, tags, **kwargs): # noqa: E501
- """Finds Pets by tags # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_tags(tags, async_req=True)
- >>> result = thread.get()
-
- :param tags: Tags to filter by (required)
- :type tags: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: list[Pet]
- """
- kwargs['_return_http_data_only'] = True
- return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
-
- def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501
- """Finds Pets by tags # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
- >>> result = thread.get()
-
- :param tags: Tags to filter by (required)
- :type tags: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'tags'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __find_pets_by_tags(
+ self,
+ tags,
+ **kwargs
+ ):
+ """Finds Pets by tags # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_tags(tags, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ tags ([str]): Tags to filter by
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ [Pet]
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['tags'] = \
+ tags
+ return self.call_with_http_info(**kwargs)
+
+ self.find_pets_by_tags = Endpoint(
+ settings={
+ 'response_type': ([Pet],),
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/findByTags',
+ 'operation_id': 'find_pets_by_tags',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'tags',
+ ],
+ 'required': [
+ 'tags',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'tags':
+ ([str],),
+ },
+ 'attribute_map': {
+ 'tags': 'tags',
+ },
+ 'location_map': {
+ 'tags': 'query',
+ },
+ 'collection_format_map': {
+ 'tags': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__find_pets_by_tags
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method find_pets_by_tags" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'tags' is set
- if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501
- local_var_params['tags'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501
- query_params.append(('tags', local_var_params['tags'])) # noqa: E501
- collection_formats['tags'] = 'csv' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "list[Pet]",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/pet/findByTags', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501
- """Find pet by ID # noqa: E501
-
- Returns a single pet # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.get_pet_by_id(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet to return (required)
- :type pet_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Pet
- """
- kwargs['_return_http_data_only'] = True
- return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """Find pet by ID # noqa: E501
-
- Returns a single pet # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- 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 pet_id: ID of pet to return (required)
- :type pet_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_pet_by_id(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): ID of pet to return
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Pet
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.get_pet_by_id = Endpoint(
+ settings={
+ 'response_type': (Pet,),
+ 'auth': [
+ 'api_key'
+ ],
+ 'endpoint_path': '/pet/{petId}',
+ 'operation_id': 'get_pet_by_id',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_pet_by_id
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_pet_by_id" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['api_key'] # noqa: E501
-
- response_types_map = {
- 200: "Pet",
- 400: None,
- 404: None,
- }
-
- return self.api_client.call_api(
- '/pet/{petId}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def update_pet(self, body, **kwargs): # noqa: E501
- """Update an existing pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.update_pet(body, async_req=True)
- >>> result = thread.get()
-
- :param body: Pet object that needs to be added to the store (required)
- :type body: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.update_pet_with_http_info(body, **kwargs) # noqa: E501
-
- def update_pet_with_http_info(self, body, **kwargs): # noqa: E501
- """Update an existing pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.update_pet_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: Pet object that needs to be added to the store (required)
- :type body: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __update_pet(
+ self,
+ body,
+ **kwargs
+ ):
+ """Update an existing pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (Pet): Pet object that needs to be added to the store
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.update_pet = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet',
+ 'operation_id': 'update_pet',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (Pet,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json',
+ 'application/xml'
+ ]
+ },
+ api_client=api_client,
+ callable=__update_pet
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_pet" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json', 'application/xml']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.update_pet_with_form(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet that needs to be updated (required)
- :type pet_id: int
- :param name: Updated name of the pet
- :type name: str
- :param status: Updated status of the pet
- :type status: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet that needs to be updated (required)
- :type pet_id: int
- :param name: Updated name of the pet
- :type name: str
- :param status: Updated status of the pet
- :type status: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'name',
- 'status'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __update_pet_with_form(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.update_pet_with_form(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): ID of pet that needs to be updated
+
+ Keyword Args:
+ name (str): Updated name of the pet. [optional]
+ status (str): Updated status of the pet. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.update_pet_with_form = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/{petId}',
+ 'operation_id': 'update_pet_with_form',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'name',
+ 'status',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'name':
+ (str,),
+ 'status':
+ (str,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'name': 'name',
+ 'status': 'status',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'name': 'form',
+ 'status': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__update_pet_with_form
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_pet_with_form" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'name' in local_var_params:
- form_params.append(('name', local_var_params['name'])) # noqa: E501
- if 'status' in local_var_params:
- form_params.append(('status', local_var_params['status'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet/{petId}', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def upload_file(self, pet_id, **kwargs): # noqa: E501
- """uploads an image # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.upload_file(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet to update (required)
- :type pet_id: int
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param file: file to upload
- :type file: file
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: ApiResponse
- """
- kwargs['_return_http_data_only'] = True
- return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """uploads an image # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet to update (required)
- :type pet_id: int
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param file: file to upload
- :type file: file
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'additional_metadata',
- 'file'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __upload_file(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """uploads an image # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): ID of pet to update
+
+ Keyword Args:
+ additional_metadata (str): Additional data to pass to server. [optional]
+ file (file_type): file to upload. [optional]
+ files ([file_type]): files to upload. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ApiResponse
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.upload_file = Endpoint(
+ settings={
+ 'response_type': (ApiResponse,),
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/{petId}/uploadImage',
+ 'operation_id': 'upload_file',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'additional_metadata',
+ 'file',
+ 'files',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'additional_metadata':
+ (str,),
+ 'file':
+ (file_type,),
+ 'files':
+ ([file_type],),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'additional_metadata': 'additionalMetadata',
+ 'file': 'file',
+ 'files': 'files',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'additional_metadata': 'form',
+ 'file': 'form',
+ 'files': 'form',
+ },
+ 'collection_format_map': {
+ 'files': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'multipart/form-data'
+ ]
+ },
+ api_client=api_client,
+ callable=__upload_file
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method upload_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'additional_metadata' in local_var_params:
- form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'file' in local_var_params:
- local_var_files['file'] = local_var_params['file'] # noqa: E501
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['multipart/form-data']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "ApiResponse",
- }
-
- return self.api_client.call_api(
- '/pet/{petId}/uploadImage', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
- """uploads an image (required) # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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 pet_id: ID of pet to update (required)
- :type pet_id: int
- :param required_file: file to upload (required)
- :type required_file: file
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: ApiResponse
- """
- kwargs['_return_http_data_only'] = True
- return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
-
- def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
- """uploads an image (required) # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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 pet_id: ID of pet to update (required)
- :type pet_id: int
- :param required_file: file to upload (required)
- :type required_file: file
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'required_file',
- 'additional_metadata'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __upload_file_with_required_file(
+ self,
+ pet_id,
+ required_file,
+ **kwargs
+ ):
+ """uploads an image (required) # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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()
+
+ Args:
+ pet_id (int): ID of pet to update
+ required_file (file_type): file to upload
+
+ Keyword Args:
+ additional_metadata (str): Additional data to pass to server. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ApiResponse
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ kwargs['required_file'] = \
+ required_file
+ return self.call_with_http_info(**kwargs)
+
+ self.upload_file_with_required_file = Endpoint(
+ settings={
+ 'response_type': (ApiResponse,),
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile',
+ 'operation_id': 'upload_file_with_required_file',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'required_file',
+ 'additional_metadata',
+ ],
+ 'required': [
+ 'pet_id',
+ 'required_file',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'required_file':
+ (file_type,),
+ 'additional_metadata':
+ (str,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'required_file': 'requiredFile',
+ 'additional_metadata': 'additionalMetadata',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'required_file': 'form',
+ 'additional_metadata': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'multipart/form-data'
+ ]
+ },
+ api_client=api_client,
+ callable=__upload_file_with_required_file
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method upload_file_with_required_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
- # verify the required parameter 'required_file' is set
- if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501
- local_var_params['required_file'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'additional_metadata' in local_var_params:
- form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'required_file' in local_var_params:
- local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['multipart/form-data']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "ApiResponse",
- }
-
- return self.api_client.call_api(
- '/fake/{petId}/uploadImageWithRequiredFile', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py
index 734d8e17dc93..7e6b6cba1c8c 100644
--- a/samples/client/petstore/python/petstore_api/api/store_api.py
+++ b/samples/client/petstore/python/petstore_api/api/store_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.order import Order
class StoreApi(object):
@@ -36,530 +38,464 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def delete_order(self, order_id, **kwargs): # noqa: E501
- """Delete purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_order(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of the order that needs to be deleted (required)
- :type order_id: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
-
- def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501
- """Delete purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_order_with_http_info(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of the order that needs to be deleted (required)
- :type order_id: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'order_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __delete_order(
+ self,
+ order_id,
+ **kwargs
+ ):
+ """Delete purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_order(order_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ order_id (str): ID of the order that needs to be deleted
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['order_id'] = \
+ order_id
+ return self.call_with_http_info(**kwargs)
+
+ self.delete_order = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/store/order/{order_id}',
+ 'operation_id': 'delete_order',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'order_id',
+ ],
+ 'required': [
+ 'order_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'order_id':
+ (str,),
+ },
+ 'attribute_map': {
+ 'order_id': 'order_id',
+ },
+ 'location_map': {
+ 'order_id': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__delete_order
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_order" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'order_id' is set
- if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
- local_var_params['order_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'order_id' in local_var_params:
- path_params['order_id'] = local_var_params['order_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/store/order/{order_id}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_inventory(self, **kwargs): # noqa: E501
- """Returns pet inventories by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_inventory(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: dict(str, int)
- """
- kwargs['_return_http_data_only'] = True
- return self.get_inventory_with_http_info(**kwargs) # noqa: E501
-
- def get_inventory_with_http_info(self, **kwargs): # noqa: E501
- """Returns pet inventories by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_inventory_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_inventory(
+ self,
+ **kwargs
+ ):
+ """Returns pet inventories by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_inventory(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ {str: (int,)}
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.get_inventory = Endpoint(
+ settings={
+ 'response_type': ({str: (int,)},),
+ 'auth': [
+ 'api_key'
+ ],
+ 'endpoint_path': '/store/inventory',
+ 'operation_id': 'get_inventory',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_inventory
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_inventory" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['api_key'] # noqa: E501
-
- response_types_map = {
- 200: "dict(str, int)",
- }
-
- return self.api_client.call_api(
- '/store/inventory', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_order_by_id(self, order_id, **kwargs): # noqa: E501
- """Find purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_order_by_id(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of pet that needs to be fetched (required)
- :type order_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Order
- """
- kwargs['_return_http_data_only'] = True
- return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
-
- def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501
- """Find purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of pet that needs to be fetched (required)
- :type order_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'order_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_order_by_id(
+ self,
+ order_id,
+ **kwargs
+ ):
+ """Find purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_order_by_id(order_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ order_id (int): ID of pet that needs to be fetched
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Order
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['order_id'] = \
+ order_id
+ return self.call_with_http_info(**kwargs)
+
+ self.get_order_by_id = Endpoint(
+ settings={
+ 'response_type': (Order,),
+ 'auth': [],
+ 'endpoint_path': '/store/order/{order_id}',
+ 'operation_id': 'get_order_by_id',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'order_id',
+ ],
+ 'required': [
+ 'order_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ 'order_id',
+ ]
+ },
+ root_map={
+ 'validations': {
+ ('order_id',): {
+
+ 'inclusive_maximum': 5,
+ 'inclusive_minimum': 1,
+ },
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'order_id':
+ (int,),
+ },
+ 'attribute_map': {
+ 'order_id': 'order_id',
+ },
+ 'location_map': {
+ 'order_id': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_order_by_id
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_order_by_id" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'order_id' is set
- if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
- local_var_params['order_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
-
- if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501
- raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
- if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501
- raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
- collection_formats = {}
-
- path_params = {}
- if 'order_id' in local_var_params:
- path_params['order_id'] = local_var_params['order_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Order",
- 400: None,
- 404: None,
- }
-
- return self.api_client.call_api(
- '/store/order/{order_id}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def place_order(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.place_order(body, async_req=True)
- >>> result = thread.get()
-
- :param body: order placed for purchasing the pet (required)
- :type body: Order
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Order
- """
- kwargs['_return_http_data_only'] = True
- return self.place_order_with_http_info(body, **kwargs) # noqa: E501
-
- def place_order_with_http_info(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.place_order_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: order placed for purchasing the pet (required)
- :type body: Order
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __place_order(
+ self,
+ body,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.place_order(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (Order): order placed for purchasing the pet
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Order
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.place_order = Endpoint(
+ settings={
+ 'response_type': (Order,),
+ 'auth': [],
+ 'endpoint_path': '/store/order',
+ 'operation_id': 'place_order',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (Order,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__place_order
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method place_order" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Order",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/store/order', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py
index 9f8be84771ae..92dae02b424f 100644
--- a/samples/client/petstore/python/petstore_api/api/user_api.py
+++ b/samples/client/petstore/python/petstore_api/api/user_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.user import User
class UserApi(object):
@@ -36,1050 +38,927 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def create_user(self, body, **kwargs): # noqa: E501
- """Create user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.create_user(body, async_req=True)
- >>> result = thread.get()
-
- :param body: Created user object (required)
- :type body: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_user_with_http_info(body, **kwargs) # noqa: E501
-
- def create_user_with_http_info(self, body, **kwargs): # noqa: E501
- """Create user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.create_user_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: Created user object (required)
- :type body: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_user(
+ self,
+ body,
+ **kwargs
+ ):
+ """Create user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.create_user(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body (User): Created user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.create_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user',
+ 'operation_id': 'create_user',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (User,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__create_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def create_users_with_array_input(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_array_input(body, async_req=True)
- >>> result = thread.get()
-
- :param body: List of user object (required)
- :type body: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501
-
- def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: List of user object (required)
- :type body: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_users_with_array_input(
+ self,
+ body,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.create_users_with_array_input(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body ([User]): List of user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.create_users_with_array_input = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/createWithArray',
+ 'operation_id': 'create_users_with_array_input',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ ([User],),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__create_users_with_array_input
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_users_with_array_input" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/createWithArray', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def create_users_with_list_input(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_list_input(body, async_req=True)
- >>> result = thread.get()
-
- :param body: List of user object (required)
- :type body: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501
-
- def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param body: List of user object (required)
- :type body: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_users_with_list_input(
+ self,
+ body,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.create_users_with_list_input(body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ body ([User]): List of user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.create_users_with_list_input = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/createWithList',
+ 'operation_id': 'create_users_with_list_input',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ ([User],),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__create_users_with_list_input
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_users_with_list_input" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/createWithList', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def delete_user(self, username, **kwargs): # noqa: E501
- """Delete user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_user(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be deleted (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
-
- def delete_user_with_http_info(self, username, **kwargs): # noqa: E501
- """Delete user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_user_with_http_info(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be deleted (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __delete_user(
+ self,
+ username,
+ **kwargs
+ ):
+ """Delete user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_user(username, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): The name that needs to be deleted
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ return self.call_with_http_info(**kwargs)
+
+ self.delete_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/{username}',
+ 'operation_id': 'delete_user',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ ],
+ 'required': [
+ 'username',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ },
+ 'location_map': {
+ 'username': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__delete_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'username' in local_var_params:
- path_params['username'] = local_var_params['username'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/{username}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_user_by_name(self, username, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.get_user_by_name(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be fetched. Use user1 for testing. (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: User
- """
- kwargs['_return_http_data_only'] = True
- return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
-
- def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be fetched. Use user1 for testing. (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_user_by_name(
+ self,
+ username,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.get_user_by_name(username, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): The name that needs to be fetched. Use user1 for testing.
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ User
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ return self.call_with_http_info(**kwargs)
+
+ self.get_user_by_name = Endpoint(
+ settings={
+ 'response_type': (User,),
+ 'auth': [],
+ 'endpoint_path': '/user/{username}',
+ 'operation_id': 'get_user_by_name',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ ],
+ 'required': [
+ 'username',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ },
+ 'location_map': {
+ 'username': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_user_by_name
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_user_by_name" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'username' in local_var_params:
- path_params['username'] = local_var_params['username'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "User",
- 400: None,
- 404: None,
- }
-
- return self.api_client.call_api(
- '/user/{username}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def login_user(self, username, password, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.login_user(username, password, async_req=True)
- >>> result = thread.get()
-
- :param username: The user name for login (required)
- :type username: str
- :param password: The password for login in clear text (required)
- :type password: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: str
- """
- kwargs['_return_http_data_only'] = True
- return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
-
- def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.login_user_with_http_info(username, password, async_req=True)
- >>> result = thread.get()
-
- :param username: The user name for login (required)
- :type username: str
- :param password: The password for login in clear text (required)
- :type password: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username',
- 'password'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __login_user(
+ self,
+ username,
+ password,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.login_user(username, password, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): The user name for login
+ password (str): The password for login in clear text
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ str
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ kwargs['password'] = \
+ password
+ return self.call_with_http_info(**kwargs)
+
+ self.login_user = Endpoint(
+ settings={
+ 'response_type': (str,),
+ 'auth': [],
+ 'endpoint_path': '/user/login',
+ 'operation_id': 'login_user',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ 'password',
+ ],
+ 'required': [
+ 'username',
+ 'password',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ 'password':
+ (str,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ 'password': 'password',
+ },
+ 'location_map': {
+ 'username': 'query',
+ 'password': 'query',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__login_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method login_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501
- # verify the required parameter 'password' is set
- if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501
- local_var_params['password'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501
- query_params.append(('username', local_var_params['username'])) # noqa: E501
- if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501
- query_params.append(('password', local_var_params['password'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "str",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/user/login', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def logout_user(self, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.logout_user(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.logout_user_with_http_info(**kwargs) # noqa: E501
-
- def logout_user_with_http_info(self, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.logout_user_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __logout_user(
+ self,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.logout_user(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.logout_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/logout',
+ 'operation_id': 'logout_user',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__logout_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method logout_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/logout', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def update_user(self, username, body, **kwargs): # noqa: E501
- """Updated user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.update_user(username, body, async_req=True)
- >>> result = thread.get()
-
- :param username: name that need to be deleted (required)
- :type username: str
- :param body: Updated user object (required)
- :type body: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501
-
- def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501
- """Updated user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.update_user_with_http_info(username, body, async_req=True)
- >>> result = thread.get()
-
- :param username: name that need to be deleted (required)
- :type username: str
- :param body: Updated user object (required)
- :type body: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username',
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __update_user(
+ self,
+ username,
+ body,
+ **kwargs
+ ):
+ """Updated user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.update_user(username, body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): name that need to be deleted
+ body (User): Updated user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ kwargs['body'] = \
+ body
+ return self.call_with_http_info(**kwargs)
+
+ self.update_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/{username}',
+ 'operation_id': 'update_user',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ 'body',
+ ],
+ 'required': [
+ 'username',
+ 'body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ 'body':
+ (User,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ },
+ 'location_map': {
+ 'username': 'path',
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__update_user
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'username' in local_var_params:
- path_params['username'] = local_var_params['username'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/{username}', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py
index 52c58e68a08f..11aa326965b8 100644
--- a/samples/client/petstore/python/petstore_api/api_client.py
+++ b/samples/client/petstore/python/petstore_api/api_client.py
@@ -8,26 +8,35 @@
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-import atexit
-import datetime
-from dateutil.parser import parse
import json
+import atexit
import mimetypes
from multiprocessing.pool import ThreadPool
+import io
import os
import re
-import tempfile
+import typing
+from urllib.parse import quote
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import quote
-from petstore_api.configuration import Configuration
-import petstore_api.models
from petstore_api import rest
-from petstore_api.exceptions import ApiValueError, ApiException
+from petstore_api.configuration import Configuration
+from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException
+from petstore_api.model_utils import (
+ ModelNormal,
+ ModelSimple,
+ ModelComposed,
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ deserialize_file,
+ file_type,
+ model_to_dict,
+ none_type,
+ validate_and_convert_types
+)
class ApiClient(object):
@@ -52,23 +61,12 @@ class ApiClient(object):
to the API. More threads means more concurrent API requests.
"""
- PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
- NATIVE_TYPES_MAPPING = {
- 'int': int,
- 'long': int if six.PY3 else long, # noqa: F821
- 'float': float,
- 'str': str,
- 'bool': bool,
- 'date': datetime.date,
- 'datetime': datetime.datetime,
- 'object': object,
- }
_pool = None
def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None, pool_threads=1):
if configuration is None:
- configuration = Configuration.get_default_copy()
+ configuration = Configuration()
self.configuration = configuration
self.pool_threads = pool_threads
@@ -79,7 +77,6 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
- self.client_side_validation = configuration.client_side_validation
def __enter__(self):
return self
@@ -118,12 +115,24 @@ def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
def __call_api(
- self, resource_path, method, path_params=None,
- query_params=None, header_params=None, body=None, post_params=None,
- files=None, response_types_map=None, auth_settings=None,
- _return_http_data_only=None, collection_formats=None,
- _preload_content=True, _request_timeout=None, _host=None,
- _request_auth=None):
+ self,
+ resource_path: str,
+ method: str,
+ path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ body: typing.Optional[typing.Any] = None,
+ post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
+ response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
+ auth_settings: typing.Optional[typing.List[str]] = None,
+ _return_http_data_only: typing.Optional[bool] = None,
+ collection_formats: typing.Optional[typing.Dict[str, str]] = None,
+ _preload_content: bool = True,
+ _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
+ _host: typing.Optional[str] = None,
+ _check_type: typing.Optional[bool] = None
+ ):
config = self.configuration
@@ -163,15 +172,14 @@ def __call_api(
collection_formats)
post_params.extend(self.files_parameters(files))
- # auth setting
- self.update_params_for_auth(
- header_params, query_params, auth_settings,
- request_auth=_request_auth)
-
# body
if body:
body = self.sanitize_for_serialization(body)
+ # auth setting
+ self.update_params_for_auth(header_params, query_params,
+ auth_settings, resource_path, method, body)
+
# request url
if _host is None:
url = self.configuration.host + resource_path
@@ -187,30 +195,33 @@ def __call_api(
_preload_content=_preload_content,
_request_timeout=_request_timeout)
except ApiException as e:
- e.body = e.body.decode('utf-8') if six.PY3 else e.body
+ e.body = e.body.decode('utf-8')
raise e
+ content_type = response_data.getheader('content-type')
+
self.last_response = response_data
return_data = response_data
if not _preload_content:
+ return (return_data)
return return_data
-
- response_type = response_types_map.get(response_data.status, None)
- if six.PY3 and response_type not in ["file", "bytes"]:
+ if response_type not in ["file", "bytes"]:
match = None
- content_type = response_data.getheader('content-type')
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
encoding = match.group(1) if match else "utf-8"
response_data.data = response_data.data.decode(encoding)
# deserialize response data
-
if response_type:
- return_data = self.deserialize(response_data, response_type)
+ return_data = self.deserialize(
+ response_data,
+ response_type,
+ _check_type
+ )
else:
return_data = None
@@ -220,9 +231,9 @@ def __call_api(
return (return_data, response_data.status,
response_data.getheaders())
- def sanitize_for_serialization(self, obj):
+ @classmethod
+ def sanitize_for_serialization(cls, obj):
"""Builds a JSON POST object.
-
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
@@ -230,106 +241,90 @@ def sanitize_for_serialization(self, obj):
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is OpenAPI model, return the properties dict.
-
:param obj: The data to serialize.
:return: The serialized form of data.
"""
- if obj is None:
- return None
- elif isinstance(obj, self.PRIMITIVE_TYPES):
+ if isinstance(obj, (ModelNormal, ModelComposed)):
+ return {
+ key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()
+ }
+ elif isinstance(obj, (str, int, float, none_type, bool)):
return obj
- elif isinstance(obj, list):
- return [self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj]
- elif isinstance(obj, tuple):
- return tuple(self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj)
- elif isinstance(obj, (datetime.datetime, datetime.date)):
+ elif isinstance(obj, (datetime, date)):
return obj.isoformat()
-
+ elif isinstance(obj, ModelSimple):
+ return cls.sanitize_for_serialization(obj.value)
+ elif isinstance(obj, (list, tuple)):
+ return [cls.sanitize_for_serialization(item) for item in obj]
if isinstance(obj, dict):
- obj_dict = obj
- else:
- # Convert model obj to dict except
- # attributes `openapi_types`, `attribute_map`
- # and attributes which value is not None.
- # Convert attribute name to json key in
- # model definition for request.
- obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
- for attr, _ in six.iteritems(obj.openapi_types)
- if getattr(obj, attr) is not None}
-
- return {key: self.sanitize_for_serialization(val)
- for key, val in six.iteritems(obj_dict)}
-
- def deserialize(self, response, response_type):
+ return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
+ raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))
+
+ def deserialize(self, response, response_type, _check_type):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
- :param response_type: class literal for
- deserialized object, or string of class name.
+ :param response_type: For the response, a tuple containing:
+ valid classes
+ a list containing valid classes (for list schemas)
+ a dict containing a tuple of valid classes as the value
+ Example values:
+ (str,)
+ (Pet,)
+ (float, none_type)
+ ([int, none_type],)
+ ({str: (bool, str, int, float, date, datetime, str, none_type)},)
+ :param _check_type: boolean, whether to check the types of the data
+ received from the server
+ :type _check_type: bool
:return: deserialized object.
"""
# handle file downloading
# save response body into a tmp file and return the instance
- if response_type == "file":
- return self.__deserialize_file(response)
+ if response_type == (file_type,):
+ content_disposition = response.getheader("Content-Disposition")
+ return deserialize_file(response.data, self.configuration,
+ content_disposition=content_disposition)
# fetch data from response object
try:
- data = json.loads(response.data)
+ received_data = json.loads(response.data)
except ValueError:
- data = response.data
-
- return self.__deserialize(data, response_type)
-
- def __deserialize(self, data, klass):
- """Deserializes dict, list, str into an object.
-
- :param data: dict, list or str.
- :param klass: class literal, or string of class name.
-
- :return: object.
- """
- if data is None:
- return None
-
- if type(klass) == str:
- if klass.startswith('list['):
- sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
- return [self.__deserialize(sub_data, sub_kls)
- for sub_data in data]
-
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
- return {k: self.__deserialize(v, sub_kls)
- for k, v in six.iteritems(data)}
-
- # convert str to class
- if klass in self.NATIVE_TYPES_MAPPING:
- klass = self.NATIVE_TYPES_MAPPING[klass]
- else:
- klass = getattr(petstore_api.models, klass)
-
- if klass in self.PRIMITIVE_TYPES:
- return self.__deserialize_primitive(data, klass)
- elif klass == object:
- return self.__deserialize_object(data)
- elif klass == datetime.date:
- return self.__deserialize_date(data)
- elif klass == datetime.datetime:
- return self.__deserialize_datetime(data)
- else:
- return self.__deserialize_model(data, klass)
-
- def call_api(self, resource_path, method,
- path_params=None, query_params=None, header_params=None,
- body=None, post_params=None, files=None,
- response_types_map=None, auth_settings=None,
- async_req=None, _return_http_data_only=None,
- collection_formats=None,_preload_content=True,
- _request_timeout=None, _host=None, _request_auth=None):
+ received_data = response.data
+
+ # store our data under the key of 'received_data' so users have some
+ # context if they are deserializing a string and the data type is wrong
+ deserialized_data = validate_and_convert_types(
+ received_data,
+ response_type,
+ ['received_data'],
+ True,
+ _check_type,
+ configuration=self.configuration
+ )
+ return deserialized_data
+
+ def call_api(
+ self,
+ resource_path: str,
+ method: str,
+ path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ body: typing.Optional[typing.Any] = None,
+ post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
+ response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
+ auth_settings: typing.Optional[typing.List[str]] = None,
+ async_req: typing.Optional[bool] = None,
+ _return_http_data_only: typing.Optional[bool] = None,
+ collection_formats: typing.Optional[typing.Dict[str, str]] = None,
+ _preload_content: bool = True,
+ _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
+ _host: typing.Optional[str] = None,
+ _check_type: typing.Optional[bool] = None
+ ):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async_req request, set the async_req parameter.
@@ -344,25 +339,38 @@ def call_api(self, resource_path, method,
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
- :param response: Response data type.
- :param files dict: key -> filename, value -> filepath,
- for `multipart/form-data`.
+ :param response_type: For the response, a tuple containing:
+ valid classes
+ a list containing valid classes (for list schemas)
+ a dict containing a tuple of valid classes as the value
+ Example values:
+ (str,)
+ (Pet,)
+ (float, none_type)
+ ([int, none_type],)
+ ({str: (bool, str, int, float, date, datetime, str, none_type)},)
+ :param files: key -> field name, value -> a list of open file
+ objects for `multipart/form-data`.
+ :type files: dict
:param async_req bool: execute request asynchronously
+ :type async_req: bool, optional
:param _return_http_data_only: response data without head status code
and headers
+ :type _return_http_data_only: bool, optional
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
+ :type collection_formats: dict, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
+ :type _preload_content: bool, optional
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_token: dict, optional
+ :param _check_type: boolean describing if the data back from the server
+ should have its type checked.
+ :type _check_type: bool, optional
:return:
If async_req parameter is True,
the request will be called asynchronously.
@@ -374,23 +382,23 @@ def call_api(self, resource_path, method,
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
- response_types_map, auth_settings,
+ response_type, auth_settings,
_return_http_data_only, collection_formats,
_preload_content, _request_timeout, _host,
- _request_auth)
+ _check_type)
return self.pool.apply_async(self.__call_api, (resource_path,
method, path_params,
query_params,
header_params, body,
post_params, files,
- response_types_map,
+ response_type,
auth_settings,
_return_http_data_only,
collection_formats,
_preload_content,
_request_timeout,
- _host, _request_auth))
+ _host, _check_type))
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True,
@@ -412,8 +420,10 @@ def request(self, method, url, query_params=None, headers=None,
return self.rest_client.OPTIONS(url,
query_params=query_params,
headers=headers,
+ post_params=post_params,
_preload_content=_preload_content,
- _request_timeout=_request_timeout)
+ _request_timeout=_request_timeout,
+ body=body)
elif method == "POST":
return self.rest_client.POST(url,
query_params=query_params,
@@ -461,7 +471,7 @@ def parameters_to_tuples(self, params, collection_formats):
new_params = []
if collection_formats is None:
collection_formats = {}
- for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
@@ -481,27 +491,37 @@ def parameters_to_tuples(self, params, collection_formats):
new_params.append((k, v))
return new_params
- def files_parameters(self, files=None):
+ def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
"""Builds form parameters.
- :param files: File parameters.
- :return: Form parameters with files.
+ :param files: None or a dict with key=param_name and
+ value is a list of open file objects
+ :return: List of tuples of form parameters with file data
"""
- params = []
+ if files is None:
+ return []
- if files:
- for k, v in six.iteritems(files):
- if not v:
+ params = []
+ for param_name, file_instances in files.items():
+ if file_instances is None:
+ # if the file field is nullable, skip None values
+ continue
+ for file_instance in file_instances:
+ if file_instance is None:
+ # if the file field is nullable, skip None values
continue
- file_names = v if type(v) is list else [v]
- for n in file_names:
- with open(n, 'rb') as f:
- filename = os.path.basename(f.name)
- filedata = f.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([k, tuple([filename, filedata, mimetype])]))
+ if file_instance.closed is True:
+ raise ApiValueError(
+ "Cannot read a closed file. The passed in file_type "
+ "for %s must be open." % param_name
+ )
+ filename = os.path.basename(file_instance.name)
+ filedata = file_instance.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([param_name, tuple([filename, filedata, mimetype])]))
+ file_instance.close()
return params
@@ -538,156 +558,261 @@ def select_header_content_type(self, content_types):
return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings,
- request_auth=None):
+ resource_path, method, body):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
- :param request_auth: if set, the provided settings will
- override the token in the configuration.
+ :param resource_path: A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method.
+ :param body: A object representing the body of the HTTP request.
+ The object type is the return value of _encoder.default().
"""
if not auth_settings:
return
- if request_auth:
- self._apply_auth_params(headers, querys, request_auth)
- return
-
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
- self._apply_auth_params(headers, querys, auth_setting)
-
- def _apply_auth_params(self, headers, querys, auth_setting):
- """Updates the request parameters based on a single auth_setting
-
- :param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
- :param auth_setting: auth settings for the endpoint
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ elif auth_setting['in'] == 'query':
+ querys.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+
+class Endpoint(object):
+ def __init__(self, settings=None, params_map=None, root_map=None,
+ headers_map=None, api_client=None, callable=None):
+ """Creates an endpoint
+
+ Args:
+ settings (dict): see below key value pairs
+ 'response_type' (tuple/None): response type
+ 'auth' (list): a list of auth type keys
+ 'endpoint_path' (str): the endpoint path
+ 'operation_id' (str): endpoint string identifier
+ 'http_method' (str): POST/PUT/PATCH/GET etc
+ 'servers' (list): list of str servers that this endpoint is at
+ params_map (dict): see below key value pairs
+ 'all' (list): list of str endpoint parameter names
+ 'required' (list): list of required parameter names
+ 'nullable' (list): list of nullable parameter names
+ 'enum' (list): list of parameters with enum values
+ 'validation' (list): list of parameters with validations
+ root_map
+ 'validations' (dict): the dict mapping endpoint parameter tuple
+ paths to their validation dictionaries
+ 'allowed_values' (dict): the dict mapping endpoint parameter
+ tuple paths to their allowed_values (enum) dictionaries
+ 'openapi_types' (dict): param_name to openapi type
+ 'attribute_map' (dict): param_name to camelCase name
+ 'location_map' (dict): param_name to 'body', 'file', 'form',
+ 'header', 'path', 'query'
+ collection_format_map (dict): param_name to `csv` etc.
+ headers_map (dict): see below key value pairs
+ 'accept' (list): list of Accept header strings
+ 'content_type' (list): list of Content-Type header strings
+ api_client (ApiClient) api client instance
+ callable (function): the function which is invoked when the
+ Endpoint is called
"""
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- headers[auth_setting['key']] = auth_setting['value']
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
-
- def __deserialize_file(self, response):
- """Deserializes body to file
-
- Saves response body into a file in a temporary folder,
- using the filename from the `Content-Disposition` header if provided.
+ self.settings = settings
+ self.params_map = params_map
+ self.params_map['all'].extend([
+ 'async_req',
+ '_host_index',
+ '_preload_content',
+ '_request_timeout',
+ '_return_http_data_only',
+ '_check_input_type',
+ '_check_return_type'
+ ])
+ self.params_map['nullable'].extend(['_request_timeout'])
+ self.validations = root_map['validations']
+ self.allowed_values = root_map['allowed_values']
+ self.openapi_types = root_map['openapi_types']
+ extra_types = {
+ 'async_req': (bool,),
+ '_host_index': (none_type, int),
+ '_preload_content': (bool,),
+ '_request_timeout': (none_type, int, (int,), [int]),
+ '_return_http_data_only': (bool,),
+ '_check_input_type': (bool,),
+ '_check_return_type': (bool,)
+ }
+ self.openapi_types.update(extra_types)
+ self.attribute_map = root_map['attribute_map']
+ self.location_map = root_map['location_map']
+ self.collection_format_map = root_map['collection_format_map']
+ self.headers_map = headers_map
+ self.api_client = api_client
+ self.callable = callable
+
+ def __validate_inputs(self, kwargs):
+ for param in self.params_map['enum']:
+ if param in kwargs:
+ check_allowed_values(
+ self.allowed_values,
+ (param,),
+ kwargs[param]
+ )
- :param response: RESTResponse.
- :return: file path.
- """
- fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
- os.close(fd)
- os.remove(path)
+ for param in self.params_map['validation']:
+ if param in kwargs:
+ check_validations(
+ self.validations,
+ (param,),
+ kwargs[param],
+ configuration=self.api_client.configuration
+ )
- content_disposition = response.getheader("Content-Disposition")
- if content_disposition:
- filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
- content_disposition).group(1)
- path = os.path.join(os.path.dirname(path), filename)
+ if kwargs['_check_input_type'] is False:
+ return
- with open(path, "wb") as f:
- f.write(response.data)
+ for key, value in kwargs.items():
+ fixed_val = validate_and_convert_types(
+ value,
+ self.openapi_types[key],
+ [key],
+ False,
+ kwargs['_check_input_type'],
+ configuration=self.api_client.configuration
+ )
+ kwargs[key] = fixed_val
+
+ def __gather_params(self, kwargs):
+ params = {
+ 'body': None,
+ 'collection_format': {},
+ 'file': {},
+ 'form': [],
+ 'header': {},
+ 'path': {},
+ 'query': []
+ }
+
+ for param_name, param_value in kwargs.items():
+ param_location = self.location_map.get(param_name)
+ if param_location is None:
+ continue
+ if param_location:
+ if param_location == 'body':
+ params['body'] = param_value
+ continue
+ base_name = self.attribute_map[param_name]
+ if (param_location == 'form' and
+ self.openapi_types[param_name] == (file_type,)):
+ params['file'][param_name] = [param_value]
+ elif (param_location == 'form' and
+ self.openapi_types[param_name] == ([file_type],)):
+ # param_value is already a list
+ params['file'][param_name] = param_value
+ elif param_location in {'form', 'query'}:
+ param_value_full = (base_name, param_value)
+ params[param_location].append(param_value_full)
+ if param_location not in {'form', 'query'}:
+ params[param_location][base_name] = param_value
+ collection_format = self.collection_format_map.get(param_name)
+ if collection_format:
+ params['collection_format'][base_name] = collection_format
- return path
+ return params
- def __deserialize_primitive(self, data, klass):
- """Deserializes string to primitive type.
+ def __call__(self, *args, **kwargs):
+ """ This method is invoked when endpoints are called
+ Example:
- :param data: str.
- :param klass: class literal.
+ api_instance = AnotherFakeApi()
+ api_instance.call_123_test_special_tags # this is an instance of the class Endpoint
+ api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__()
+ which then invokes the callable functions stored in that endpoint at
+ api_instance.call_123_test_special_tags.callable or self.callable in this class
- :return: int, long, float, str, bool.
"""
- try:
- return klass(data)
- except UnicodeEncodeError:
- return six.text_type(data)
- except TypeError:
- return data
+ return self.callable(self, *args, **kwargs)
- def __deserialize_object(self, value):
- """Return an original value.
-
- :return: object.
- """
- return value
+ def call_with_http_info(self, **kwargs):
- def __deserialize_date(self, string):
- """Deserializes string to date.
-
- :param string: str.
- :return: date.
- """
try:
- return parse(string).date()
- except ImportError:
- return string
- except ValueError:
- raise rest.ApiException(
- status=0,
- reason="Failed to parse `{0}` as date object".format(string)
+ index = self.api_client.configuration.server_operation_index.get(
+ self.settings['operation_id'], self.api_client.configuration.server_index
+ ) if kwargs['_host_index'] is None else kwargs['_host_index']
+ server_variables = self.api_client.configuration.server_operation_variables.get(
+ self.settings['operation_id'], self.api_client.configuration.server_variables
)
-
- def __deserialize_datetime(self, string):
- """Deserializes string to datetime.
-
- The string should be in iso8601 datetime format.
-
- :param string: str.
- :return: datetime.
- """
- try:
- return parse(string)
- except ImportError:
- return string
- except ValueError:
- raise rest.ApiException(
- status=0,
- reason=(
- "Failed to parse `{0}` as datetime object"
- .format(string)
- )
+ _host = self.api_client.configuration.get_host_from_settings(
+ index, variables=server_variables, servers=self.settings['servers']
)
+ except IndexError:
+ if self.settings['servers']:
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s" %
+ len(self.settings['servers'])
+ )
+ _host = None
+
+ for key, value in kwargs.items():
+ if key not in self.params_map['all']:
+ raise ApiTypeError(
+ "Got an unexpected parameter '%s'"
+ " to method `%s`" %
+ (key, self.settings['operation_id'])
+ )
+ # only throw this nullable ApiValueError if _check_input_type
+ # is False, if _check_input_type==True we catch this case
+ # in self.__validate_inputs
+ if (key not in self.params_map['nullable'] and value is None
+ and kwargs['_check_input_type'] is False):
+ raise ApiValueError(
+ "Value may not be None for non-nullable parameter `%s`"
+ " when calling `%s`" %
+ (key, self.settings['operation_id'])
+ )
- def __deserialize_model(self, data, klass):
- """Deserializes list or dict to model.
+ for key in self.params_map['required']:
+ if key not in kwargs.keys():
+ raise ApiValueError(
+ "Missing the required parameter `%s` when calling "
+ "`%s`" % (key, self.settings['operation_id'])
+ )
- :param data: dict, list.
- :param klass: class literal.
- :return: model object.
- """
- has_discriminator = False
- if (hasattr(klass, 'get_real_child_model')
- and klass.discriminator_value_class_map):
- has_discriminator = True
-
- if not klass.openapi_types and has_discriminator is False:
- return data
-
- kwargs = {}
- if (data is not None and
- klass.openapi_types is not None and
- isinstance(data, (list, dict))):
- for attr, attr_type in six.iteritems(klass.openapi_types):
- if klass.attribute_map[attr] in data:
- value = data[klass.attribute_map[attr]]
- kwargs[attr] = self.__deserialize(value, attr_type)
-
- instance = klass(**kwargs)
-
- if has_discriminator:
- klass_name = instance.get_real_child_model(data)
- if klass_name:
- instance = self.__deserialize(data, klass_name)
- return instance
+ self.__validate_inputs(kwargs)
+
+ params = self.__gather_params(kwargs)
+
+ accept_headers_list = self.headers_map['accept']
+ if accept_headers_list:
+ params['header']['Accept'] = self.api_client.select_header_accept(
+ accept_headers_list)
+
+ content_type_headers_list = self.headers_map['content_type']
+ if content_type_headers_list:
+ header_list = self.api_client.select_header_content_type(
+ content_type_headers_list)
+ params['header']['Content-Type'] = header_list
+
+ return self.api_client.call_api(
+ self.settings['endpoint_path'], self.settings['http_method'],
+ params['path'],
+ params['query'],
+ params['header'],
+ body=params['body'],
+ post_params=params['form'],
+ files=params['file'],
+ response_type=self.settings['response_type'],
+ auth_settings=self.settings['auth'],
+ async_req=kwargs['async_req'],
+ _check_type=kwargs['_check_return_type'],
+ _return_http_data_only=kwargs['_return_http_data_only'],
+ _preload_content=kwargs['_preload_content'],
+ _request_timeout=kwargs['_request_timeout'],
+ _host=_host,
+ collection_formats=params['collection_format'])
diff --git a/samples/client/petstore/python-experimental/petstore_api/apis/__init__.py b/samples/client/petstore/python/petstore_api/apis/__init__.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/apis/__init__.py
rename to samples/client/petstore/python/petstore_api/apis/__init__.py
diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py
index 71e6a7117f8f..516b0339732b 100644
--- a/samples/client/petstore/python/petstore_api/configuration.py
+++ b/samples/client/petstore/python/petstore_api/configuration.py
@@ -10,16 +10,13 @@
"""
-from __future__ import absolute_import
-
import copy
import logging
import multiprocessing
import sys
import urllib3
-import six
-from six.moves import http_client as httplib
+from http import client as http_client
from petstore_api.exceptions import ApiValueError
@@ -230,9 +227,8 @@ def __init__(self, host=None,
# Enable client side validation
self.client_side_validation = True
+ # Options to pass down to the underlying urllib3 socket
self.socket_options = None
- """Options to pass down to the underlying urllib3 socket
- """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -311,7 +307,7 @@ def logger_file(self, value):
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
@@ -333,17 +329,17 @@ def debug(self, value):
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
- # turn on httplib debug
- httplib.HTTPConnection.debuglevel = 1
+ # turn on http_client debug
+ http_client.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
- # turn off httplib debug
- httplib.HTTPConnection.debuglevel = 0
+ # turn off http_client debug
+ http_client.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
diff --git a/samples/client/petstore/python/petstore_api/exceptions.py b/samples/client/petstore/python/petstore_api/exceptions.py
index 08181d4775db..fecd2081b818 100644
--- a/samples/client/petstore/python/petstore_api/exceptions.py
+++ b/samples/client/petstore/python/petstore_api/exceptions.py
@@ -10,8 +10,6 @@
"""
-import six
-
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -128,35 +126,11 @@ def __str__(self):
return error_message
-class NotFoundException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(NotFoundException, self).__init__(status, reason, http_resp)
-
-
-class UnauthorizedException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(UnauthorizedException, self).__init__(status, reason, http_resp)
-
-
-class ForbiddenException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(ForbiddenException, self).__init__(status, reason, http_resp)
-
-
-class ServiceException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(ServiceException, self).__init__(status, reason, http_resp)
-
-
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, six.integer_types):
+ if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/__init__.py b/samples/client/petstore/python/petstore_api/model/__init__.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/__init__.py
rename to samples/client/petstore/python/petstore_api/model/__init__.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python/petstore_api/model/additional_properties_array.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_array.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python/petstore_api/model/additional_properties_class.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_class.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python/petstore_api/model/additional_properties_integer.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_integer.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python/petstore_api/model/additional_properties_number.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_number.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python/petstore_api/model/additional_properties_object.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_object.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python/petstore_api/model/additional_properties_string.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py
rename to samples/client/petstore/python/petstore_api/model/additional_properties_string.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/client/petstore/python/petstore_api/model/animal.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/animal.py
rename to samples/client/petstore/python/petstore_api/model/animal.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/client/petstore/python/petstore_api/model/animal_farm.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py
rename to samples/client/petstore/python/petstore_api/model/animal_farm.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/client/petstore/python/petstore_api/model/api_response.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/api_response.py
rename to samples/client/petstore/python/petstore_api/model/api_response.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py
rename to samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python/petstore_api/model/array_of_number_only.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py
rename to samples/client/petstore/python/petstore_api/model/array_of_number_only.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/client/petstore/python/petstore_api/model/array_test.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/array_test.py
rename to samples/client/petstore/python/petstore_api/model/array_test.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/client/petstore/python/petstore_api/model/capitalization.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/capitalization.py
rename to samples/client/petstore/python/petstore_api/model/capitalization.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/client/petstore/python/petstore_api/model/cat.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/cat.py
rename to samples/client/petstore/python/petstore_api/model/cat.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/client/petstore/python/petstore_api/model/cat_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py
rename to samples/client/petstore/python/petstore_api/model/cat_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/category.py b/samples/client/petstore/python/petstore_api/model/category.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/category.py
rename to samples/client/petstore/python/petstore_api/model/category.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child.py b/samples/client/petstore/python/petstore_api/model/child.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child.py
rename to samples/client/petstore/python/petstore_api/model/child.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py b/samples/client/petstore/python/petstore_api/model/child_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py
rename to samples/client/petstore/python/petstore_api/model/child_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/client/petstore/python/petstore_api/model/child_cat.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_cat.py
rename to samples/client/petstore/python/petstore_api/model/child_cat.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py
rename to samples/client/petstore/python/petstore_api/model/child_cat_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py b/samples/client/petstore/python/petstore_api/model/child_dog.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_dog.py
rename to samples/client/petstore/python/petstore_api/model/child_dog.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py
rename to samples/client/petstore/python/petstore_api/model/child_dog_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py b/samples/client/petstore/python/petstore_api/model/child_lizard.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py
rename to samples/client/petstore/python/petstore_api/model/child_lizard.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py
rename to samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/client/petstore/python/petstore_api/model/class_model.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/class_model.py
rename to samples/client/petstore/python/petstore_api/model/class_model.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/client.py b/samples/client/petstore/python/petstore_api/model/client.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/client.py
rename to samples/client/petstore/python/petstore_api/model/client.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/client/petstore/python/petstore_api/model/dog.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/dog.py
rename to samples/client/petstore/python/petstore_api/model/dog.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/client/petstore/python/petstore_api/model/dog_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py
rename to samples/client/petstore/python/petstore_api/model/dog_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/client/petstore/python/petstore_api/model/enum_arrays.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py
rename to samples/client/petstore/python/petstore_api/model/enum_arrays.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/client/petstore/python/petstore_api/model/enum_class.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/enum_class.py
rename to samples/client/petstore/python/petstore_api/model/enum_class.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/client/petstore/python/petstore_api/model/enum_test.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/enum_test.py
rename to samples/client/petstore/python/petstore_api/model/enum_test.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file.py b/samples/client/petstore/python/petstore_api/model/file.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/file.py
rename to samples/client/petstore/python/petstore_api/model/file.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py
rename to samples/client/petstore/python/petstore_api/model/file_schema_test_class.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/client/petstore/python/petstore_api/model/format_test.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/format_test.py
rename to samples/client/petstore/python/petstore_api/model/format_test.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py b/samples/client/petstore/python/petstore_api/model/grandparent.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/grandparent.py
rename to samples/client/petstore/python/petstore_api/model/grandparent.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python/petstore_api/model/grandparent_animal.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py
rename to samples/client/petstore/python/petstore_api/model/grandparent_animal.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python/petstore_api/model/has_only_read_only.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py
rename to samples/client/petstore/python/petstore_api/model/has_only_read_only.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/list.py b/samples/client/petstore/python/petstore_api/model/list.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/list.py
rename to samples/client/petstore/python/petstore_api/model/list.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/client/petstore/python/petstore_api/model/map_test.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/map_test.py
rename to samples/client/petstore/python/petstore_api/model/map_test.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py
rename to samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/client/petstore/python/petstore_api/model/model200_response.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/model200_response.py
rename to samples/client/petstore/python/petstore_api/model/model200_response.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/client/petstore/python/petstore_api/model/model_return.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/model_return.py
rename to samples/client/petstore/python/petstore_api/model/model_return.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/name.py b/samples/client/petstore/python/petstore_api/model/name.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/name.py
rename to samples/client/petstore/python/petstore_api/model/name.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/client/petstore/python/petstore_api/model/number_only.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/number_only.py
rename to samples/client/petstore/python/petstore_api/model/number_only.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/client/petstore/python/petstore_api/model/number_with_validations.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py
rename to samples/client/petstore/python/petstore_api/model/number_with_validations.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py
rename to samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/order.py b/samples/client/petstore/python/petstore_api/model/order.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/order.py
rename to samples/client/petstore/python/petstore_api/model/order.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent.py b/samples/client/petstore/python/petstore_api/model/parent.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/parent.py
rename to samples/client/petstore/python/petstore_api/model/parent.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py b/samples/client/petstore/python/petstore_api/model/parent_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py
rename to samples/client/petstore/python/petstore_api/model/parent_all_of.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/client/petstore/python/petstore_api/model/parent_pet.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py
rename to samples/client/petstore/python/petstore_api/model/parent_pet.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/client/petstore/python/petstore_api/model/pet.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/pet.py
rename to samples/client/petstore/python/petstore_api/model/pet.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/player.py b/samples/client/petstore/python/petstore_api/model/player.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/player.py
rename to samples/client/petstore/python/petstore_api/model/player.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/client/petstore/python/petstore_api/model/read_only_first.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py
rename to samples/client/petstore/python/petstore_api/model/read_only_first.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/client/petstore/python/petstore_api/model/special_model_name.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py
rename to samples/client/petstore/python/petstore_api/model/special_model_name.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python/petstore_api/model/string_boolean_map.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py
rename to samples/client/petstore/python/petstore_api/model/string_boolean_map.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/client/petstore/python/petstore_api/model/string_enum.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/string_enum.py
rename to samples/client/petstore/python/petstore_api/model/string_enum.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/client/petstore/python/petstore_api/model/tag.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/tag.py
rename to samples/client/petstore/python/petstore_api/model/tag.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py b/samples/client/petstore/python/petstore_api/model/type_holder_default.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py
rename to samples/client/petstore/python/petstore_api/model/type_holder_default.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py b/samples/client/petstore/python/petstore_api/model/type_holder_example.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py
rename to samples/client/petstore/python/petstore_api/model/type_holder_example.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/user.py b/samples/client/petstore/python/petstore_api/model/user.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/user.py
rename to samples/client/petstore/python/petstore_api/model/user.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py b/samples/client/petstore/python/petstore_api/model/xml_item.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model/xml_item.py
rename to samples/client/petstore/python/petstore_api/model/xml_item.py
diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python/petstore_api/model_utils.py
similarity index 100%
rename from samples/client/petstore/python-experimental/petstore_api/model_utils.py
rename to samples/client/petstore/python/petstore_api/model_utils.py
diff --git a/samples/client/petstore/python/petstore_api/models/__init__.py b/samples/client/petstore/python/petstore_api/models/__init__.py
index ddef3dea4fdb..fcd25ce643ca 100644
--- a/samples/client/petstore/python/petstore_api/models/__init__.py
+++ b/samples/client/petstore/python/petstore_api/models/__init__.py
@@ -1,64 +1,76 @@
# coding: utf-8
# flake8: noqa
-"""
- OpenAPI Petstore
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+# import all models into this package
+# if you have many models here with many references from one model to another this may
+# raise a RecursionError
+# to avoid this, import only the models that you directly need like:
+# from from petstore_api.model.pet import Pet
+# or import this package, but before doing it, use:
+# import sys
+# sys.setrecursionlimit(n)
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-
-# import models into model package
-from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
-from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
-from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
-from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
-from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
-from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
-from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
-from petstore_api.models.additional_properties_string import AdditionalPropertiesString
-from petstore_api.models.animal import Animal
-from petstore_api.models.api_response import ApiResponse
-from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
-from petstore_api.models.array_test import ArrayTest
-from petstore_api.models.big_cat import BigCat
-from petstore_api.models.big_cat_all_of import BigCatAllOf
-from petstore_api.models.capitalization import Capitalization
-from petstore_api.models.cat import Cat
-from petstore_api.models.cat_all_of import CatAllOf
-from petstore_api.models.category import Category
-from petstore_api.models.class_model import ClassModel
-from petstore_api.models.client import Client
-from petstore_api.models.dog import Dog
-from petstore_api.models.dog_all_of import DogAllOf
-from petstore_api.models.enum_arrays import EnumArrays
-from petstore_api.models.enum_class import EnumClass
-from petstore_api.models.enum_test import EnumTest
-from petstore_api.models.file import File
-from petstore_api.models.file_schema_test_class import FileSchemaTestClass
-from petstore_api.models.format_test import FormatTest
-from petstore_api.models.has_only_read_only import HasOnlyReadOnly
-from petstore_api.models.list import List
-from petstore_api.models.map_test import MapTest
-from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-from petstore_api.models.model200_response import Model200Response
-from petstore_api.models.model_return import ModelReturn
-from petstore_api.models.name import Name
-from petstore_api.models.number_only import NumberOnly
-from petstore_api.models.order import Order
-from petstore_api.models.outer_composite import OuterComposite
-from petstore_api.models.outer_enum import OuterEnum
-from petstore_api.models.pet import Pet
-from petstore_api.models.read_only_first import ReadOnlyFirst
-from petstore_api.models.special_model_name import SpecialModelName
-from petstore_api.models.tag import Tag
-from petstore_api.models.type_holder_default import TypeHolderDefault
-from petstore_api.models.type_holder_example import TypeHolderExample
-from petstore_api.models.user import User
-from petstore_api.models.xml_item import XmlItem
+from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType
+from petstore_api.model.additional_properties_array import AdditionalPropertiesArray
+from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean
+from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger
+from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber
+from petstore_api.model.additional_properties_object import AdditionalPropertiesObject
+from petstore_api.model.additional_properties_string import AdditionalPropertiesString
+from petstore_api.model.animal import Animal
+from petstore_api.model.animal_farm import AnimalFarm
+from petstore_api.model.api_response import ApiResponse
+from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.model.array_test import ArrayTest
+from petstore_api.model.capitalization import Capitalization
+from petstore_api.model.cat import Cat
+from petstore_api.model.cat_all_of import CatAllOf
+from petstore_api.model.category import Category
+from petstore_api.model.child import Child
+from petstore_api.model.child_all_of import ChildAllOf
+from petstore_api.model.child_cat import ChildCat
+from petstore_api.model.child_cat_all_of import ChildCatAllOf
+from petstore_api.model.child_dog import ChildDog
+from petstore_api.model.child_dog_all_of import ChildDogAllOf
+from petstore_api.model.child_lizard import ChildLizard
+from petstore_api.model.child_lizard_all_of import ChildLizardAllOf
+from petstore_api.model.class_model import ClassModel
+from petstore_api.model.client import Client
+from petstore_api.model.dog import Dog
+from petstore_api.model.dog_all_of import DogAllOf
+from petstore_api.model.enum_arrays import EnumArrays
+from petstore_api.model.enum_class import EnumClass
+from petstore_api.model.enum_test import EnumTest
+from petstore_api.model.file import File
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+from petstore_api.model.format_test import FormatTest
+from petstore_api.model.grandparent import Grandparent
+from petstore_api.model.grandparent_animal import GrandparentAnimal
+from petstore_api.model.has_only_read_only import HasOnlyReadOnly
+from petstore_api.model.list import List
+from petstore_api.model.map_test import MapTest
+from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.model.model200_response import Model200Response
+from petstore_api.model.model_return import ModelReturn
+from petstore_api.model.name import Name
+from petstore_api.model.number_only import NumberOnly
+from petstore_api.model.number_with_validations import NumberWithValidations
+from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
+from petstore_api.model.order import Order
+from petstore_api.model.parent import Parent
+from petstore_api.model.parent_all_of import ParentAllOf
+from petstore_api.model.parent_pet import ParentPet
+from petstore_api.model.pet import Pet
+from petstore_api.model.player import Player
+from petstore_api.model.read_only_first import ReadOnlyFirst
+from petstore_api.model.special_model_name import SpecialModelName
+from petstore_api.model.string_boolean_map import StringBooleanMap
+from petstore_api.model.string_enum import StringEnum
+from petstore_api.model.tag import Tag
+from petstore_api.model.type_holder_default import TypeHolderDefault
+from petstore_api.model.type_holder_example import TypeHolderExample
+from petstore_api.model.user import User
+from petstore_api.model.xml_item import XmlItem
diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py
index 17e85148bb30..9537cea6b1af 100644
--- a/samples/client/petstore/python/petstore_api/rest.py
+++ b/samples/client/petstore/python/petstore_api/rest.py
@@ -10,21 +10,17 @@
"""
-from __future__ import absolute_import
-
import io
import json
import logging
import re
import ssl
+from urllib.parse import urlencode
import certifi
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import urlencode
import urllib3
-from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
+from petstore_api.exceptions import ApiException, ApiValueError
logger = logging.getLogger(__name__)
@@ -144,7 +140,7 @@ def request(self, method, url, query_params=None, headers=None,
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
+ if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
@@ -224,18 +220,6 @@ def request(self, method, url, query_params=None, headers=None,
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
- if r.status == 401:
- raise UnauthorizedException(http_resp=r)
-
- if r.status == 403:
- raise ForbiddenException(http_resp=r)
-
- if r.status == 404:
- raise NotFoundException(http_resp=r)
-
- if 500 <= r.status <= 599:
- raise ServiceException(http_resp=r)
-
raise ApiException(http_resp=r)
return r
diff --git a/samples/client/petstore/python/pom.xml b/samples/client/petstore/python/pom.xml
index 71814d4388d9..9dc399cc8089 100644
--- a/samples/client/petstore/python/pom.xml
+++ b/samples/client/petstore/python/pom.xml
@@ -1,10 +1,10 @@
4.0.0
org.openapitools
- PythonPetstoreClientTests
+ PythonExperimentalPetstoreClientTests
pom
1.0-SNAPSHOT
- Python OpenAPI Petstore Client
+ Python Experimental OpenAPI Petstore Client
@@ -35,7 +35,7 @@
make
- test-all
+ test
diff --git a/samples/client/petstore/python/requirements.txt b/samples/client/petstore/python/requirements.txt
index eb358efd5bd3..2c2f00fcb27b 100644
--- a/samples/client/petstore/python/requirements.txt
+++ b/samples/client/petstore/python/requirements.txt
@@ -1,6 +1,5 @@
+nulltype
certifi >= 14.05.14
-future; python_version<="2.7"
-six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
diff --git a/samples/client/petstore/python/setup.py b/samples/client/petstore/python/setup.py
index 2a3ca48e06ba..56811ec079bd 100644
--- a/samples/client/petstore/python/setup.py
+++ b/samples/client/petstore/python/setup.py
@@ -21,7 +21,12 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
+REQUIRES = [
+ "urllib3 >= 1.15",
+ "certifi",
+ "python-dateutil",
+ "nulltype",
+]
setup(
name=NAME,
@@ -31,6 +36,7 @@
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
+ python_requires=">=3.5",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
diff --git a/samples/client/petstore/python/test-requirements.txt b/samples/client/petstore/python/test-requirements.txt
index 4ed3991cbec1..2d88b0341921 100644
--- a/samples/client/petstore/python/test-requirements.txt
+++ b/samples/client/petstore/python/test-requirements.txt
@@ -1,3 +1,3 @@
-pytest~=4.6.7 # needed for python 2.7+3.4
+pytest~=4.6.7 # needed for python 3.4
pytest-cov>=2.8.1
-pytest-randomly==1.2.3 # needed for python 2.7+3.4
+pytest-randomly==1.2.3 # needed for python 3.4
diff --git a/samples/client/petstore/python/test/test_additional_properties_any_type.py b/samples/client/petstore/python/test/test_additional_properties_any_type.py
index 4b6739a1faf3..ce985f76ed9e 100644
--- a/samples/client/petstore/python/test/test_additional_properties_any_type.py
+++ b/samples/client/petstore/python/test/test_additional_properties_any_type.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType
class TestAdditionalPropertiesAnyType(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testAdditionalPropertiesAnyType(self):
"""Test AdditionalPropertiesAnyType"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
+ # model = AdditionalPropertiesAnyType() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_additional_properties_array.py b/samples/client/petstore/python/test/test_additional_properties_array.py
index c4cf43499cfa..f63ca82f6c22 100644
--- a/samples/client/petstore/python/test/test_additional_properties_array.py
+++ b/samples/client/petstore/python/test/test_additional_properties_array.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_array import AdditionalPropertiesArray # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_array import AdditionalPropertiesArray
class TestAdditionalPropertiesArray(unittest.TestCase):
@@ -30,9 +29,21 @@ def tearDown(self):
def testAdditionalPropertiesArray(self):
"""Test AdditionalPropertiesArray"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_array.AdditionalPropertiesArray() # noqa: E501
- pass
+ # can make model without additional properties
+ model = AdditionalPropertiesArray()
+
+ # can make one with additional properties
+ import datetime
+ some_val = []
+ model = AdditionalPropertiesArray(some_key=some_val)
+ assert model['some_key'] == some_val
+ some_val = [True, datetime.date(1970,1,1), datetime.datetime(1970,1,1), {}, 3.1, 1, [], 'hello']
+ model = AdditionalPropertiesArray(some_key=some_val)
+ assert model['some_key'] == some_val
+
+ # type checking works on additional properties
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ model = AdditionalPropertiesArray(some_key='some string')
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_additional_properties_boolean.py b/samples/client/petstore/python/test/test_additional_properties_boolean.py
index cc3cecc8522f..e5a13891c098 100644
--- a/samples/client/petstore/python/test/test_additional_properties_boolean.py
+++ b/samples/client/petstore/python/test/test_additional_properties_boolean.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean
class TestAdditionalPropertiesBoolean(unittest.TestCase):
@@ -30,9 +29,16 @@ def tearDown(self):
def testAdditionalPropertiesBoolean(self):
"""Test AdditionalPropertiesBoolean"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_boolean.AdditionalPropertiesBoolean() # noqa: E501
- pass
+ # can make model without additional properties
+ model = AdditionalPropertiesBoolean()
+
+ # can make one with additional properties
+ model = AdditionalPropertiesBoolean(some_key=True)
+ assert model['some_key'] == True
+
+ # type checking works on additional properties
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ model = AdditionalPropertiesBoolean(some_key='True')
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_additional_properties_class.py b/samples/client/petstore/python/test/test_additional_properties_class.py
index fc9df3bbb505..befc14455da2 100644
--- a/samples/client/petstore/python/test/test_additional_properties_class.py
+++ b/samples/client/petstore/python/test/test_additional_properties_class.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
class TestAdditionalPropertiesClass(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testAdditionalPropertiesClass(self):
"""Test AdditionalPropertiesClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
+ # model = AdditionalPropertiesClass() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_additional_properties_integer.py b/samples/client/petstore/python/test/test_additional_properties_integer.py
index 774c367b2109..0e08b8f87706 100644
--- a/samples/client/petstore/python/test/test_additional_properties_integer.py
+++ b/samples/client/petstore/python/test/test_additional_properties_integer.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger
class TestAdditionalPropertiesInteger(unittest.TestCase):
@@ -30,9 +29,16 @@ def tearDown(self):
def testAdditionalPropertiesInteger(self):
"""Test AdditionalPropertiesInteger"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_integer.AdditionalPropertiesInteger() # noqa: E501
- pass
+ # can make model without additional properties
+ model = AdditionalPropertiesInteger()
+
+ # can make one with additional properties
+ model = AdditionalPropertiesInteger(some_key=3)
+ assert model['some_key'] == 3
+
+ # type checking works on additional properties
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ model = AdditionalPropertiesInteger(some_key=11.3)
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_additional_properties_number.py b/samples/client/petstore/python/test/test_additional_properties_number.py
index 0d370e781b36..90f4429e989f 100644
--- a/samples/client/petstore/python/test/test_additional_properties_number.py
+++ b/samples/client/petstore/python/test/test_additional_properties_number.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber
class TestAdditionalPropertiesNumber(unittest.TestCase):
@@ -30,9 +29,16 @@ def tearDown(self):
def testAdditionalPropertiesNumber(self):
"""Test AdditionalPropertiesNumber"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_number.AdditionalPropertiesNumber() # noqa: E501
- pass
+ # can make model without additional properties
+ model = AdditionalPropertiesNumber()
+
+ # can make one with additional properties
+ model = AdditionalPropertiesNumber(some_key=11.3)
+ assert model['some_key'] == 11.3
+
+ # type checking works on additional properties
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ model = AdditionalPropertiesNumber(some_key=10)
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_additional_properties_object.py b/samples/client/petstore/python/test/test_additional_properties_object.py
index 6e718b28cdef..ded4a8e8a124 100644
--- a/samples/client/petstore/python/test/test_additional_properties_object.py
+++ b/samples/client/petstore/python/test/test_additional_properties_object.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_object import AdditionalPropertiesObject
class TestAdditionalPropertiesObject(unittest.TestCase):
@@ -30,9 +29,21 @@ def tearDown(self):
def testAdditionalPropertiesObject(self):
"""Test AdditionalPropertiesObject"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
- pass
+ # can make model without additional properties
+ model = AdditionalPropertiesObject()
+
+ # can make one with additional properties
+ some_val = {}
+ model = AdditionalPropertiesObject(some_key=some_val)
+ assert model['some_key'] == some_val
+ import datetime
+ some_val = {'a': True, 'b': datetime.date(1970,1,1), 'c': datetime.datetime(1970,1,1), 'd': {}, 'e': 3.1, 'f': 1, 'g': [], 'h': 'hello'}
+ model = AdditionalPropertiesObject(some_key=some_val)
+ assert model['some_key'] == some_val
+
+ # type checking works on additional properties
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ model = AdditionalPropertiesObject(some_key='some string')
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_additional_properties_string.py b/samples/client/petstore/python/test/test_additional_properties_string.py
index a46cb3e256dc..cff2c31921fe 100644
--- a/samples/client/petstore/python/test/test_additional_properties_string.py
+++ b/samples/client/petstore/python/test/test_additional_properties_string.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_string import AdditionalPropertiesString # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_string import AdditionalPropertiesString
class TestAdditionalPropertiesString(unittest.TestCase):
@@ -30,9 +29,16 @@ def tearDown(self):
def testAdditionalPropertiesString(self):
"""Test AdditionalPropertiesString"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_string.AdditionalPropertiesString() # noqa: E501
- pass
+ # can make model without additional properties
+ model = AdditionalPropertiesString()
+
+ # can make one with additional properties
+ model = AdditionalPropertiesString(some_key='some_val')
+ assert model['some_key'] == 'some_val'
+
+ # type checking works on additional properties
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ model = AdditionalPropertiesString(some_key=True)
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py
index 88d0693a1003..958f303f13e3 100644
--- a/samples/client/petstore/python/test/test_animal.py
+++ b/samples/client/petstore/python/test/test_animal.py
@@ -11,13 +11,22 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.animal import Animal # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import cat
+except ImportError:
+ cat = sys.modules[
+ 'petstore_api.model.cat']
+try:
+ from petstore_api.model import dog
+except ImportError:
+ dog = sys.modules[
+ 'petstore_api.model.dog']
+from petstore_api.model.animal import Animal
+
class TestAnimal(unittest.TestCase):
"""Animal unit test stubs"""
@@ -28,26 +37,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test Animal
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.animal.Animal() # noqa: E501
- if include_optional :
- return Animal(
- class_name = '0',
- color = 'red'
- )
- else :
- return Animal(
- class_name = '0',
- )
-
def testAnimal(self):
"""Test Animal"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = Animal() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python-experimental/test/test_animal_farm.py b/samples/client/petstore/python/test/test_animal_farm.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_animal_farm.py
rename to samples/client/petstore/python/test/test_animal_farm.py
diff --git a/samples/client/petstore/python/test/test_another_fake_api.py b/samples/client/petstore/python/test/test_another_fake_api.py
index 4b80dc4eda52..f79966a26961 100644
--- a/samples/client/petstore/python/test/test_another_fake_api.py
+++ b/samples/client/petstore/python/test/test_another_fake_api.py
@@ -5,7 +5,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
@@ -16,20 +16,19 @@
import petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
-from petstore_api.rest import ApiException
class TestAnotherFakeApi(unittest.TestCase):
"""AnotherFakeApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
+ self.api = AnotherFakeApi() # noqa: E501
def tearDown(self):
pass
- def test_test_special_tags(self):
- """Test case for test_special_tags
+ def test_call_123_test_special_tags(self):
+ """Test case for call_123_test_special_tags
To test special tags # noqa: E501
"""
diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python/test/test_api_response.py
index 5031b458a0db..9db92633f626 100644
--- a/samples/client/petstore/python/test/test_api_response.py
+++ b/samples/client/petstore/python/test/test_api_response.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.api_response import ApiResponse # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.api_response import ApiResponse
class TestApiResponse(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testApiResponse(self):
"""Test ApiResponse"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
+ # model = ApiResponse() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py
index a02233045421..4980ad17afb5 100644
--- a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py
+++ b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testArrayOfArrayOfNumberOnly(self):
"""Test ArrayOfArrayOfNumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
+ # model = ArrayOfArrayOfNumberOnly() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_number_only.py
index 1a928bf7d2e0..479c537cada7 100644
--- a/samples/client/petstore/python/test/test_array_of_number_only.py
+++ b/samples/client/petstore/python/test/test_array_of_number_only.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
class TestArrayOfNumberOnly(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testArrayOfNumberOnly(self):
"""Test ArrayOfNumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
+ # model = ArrayOfNumberOnly() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_array_test.py b/samples/client/petstore/python/test/test_array_test.py
index c56b77b77ee3..2426b27b7e46 100644
--- a/samples/client/petstore/python/test/test_array_test.py
+++ b/samples/client/petstore/python/test/test_array_test.py
@@ -5,18 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.array_test import ArrayTest # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import read_only_first
+except ImportError:
+ read_only_first = sys.modules[
+ 'petstore_api.model.read_only_first']
+from petstore_api.model.array_test import ArrayTest
class TestArrayTest(unittest.TestCase):
@@ -31,7 +35,7 @@ def tearDown(self):
def testArrayTest(self):
"""Test ArrayTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
+ # model = ArrayTest() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_capitalization.py b/samples/client/petstore/python/test/test_capitalization.py
index 2ae7725b3f09..20d2649c01eb 100644
--- a/samples/client/petstore/python/test/test_capitalization.py
+++ b/samples/client/petstore/python/test/test_capitalization.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.capitalization import Capitalization # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.capitalization import Capitalization
class TestCapitalization(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testCapitalization(self):
"""Test Capitalization"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
+ # model = Capitalization() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py
index a835b6af736b..64b525aaf118 100644
--- a/samples/client/petstore/python/test/test_cat.py
+++ b/samples/client/petstore/python/test/test_cat.py
@@ -11,13 +11,22 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.cat import Cat # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import animal
+except ImportError:
+ animal = sys.modules[
+ 'petstore_api.model.animal']
+try:
+ from petstore_api.model import cat_all_of
+except ImportError:
+ cat_all_of = sys.modules[
+ 'petstore_api.model.cat_all_of']
+from petstore_api.model.cat import Cat
+
class TestCat(unittest.TestCase):
"""Cat unit test stubs"""
@@ -28,24 +37,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test Cat
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.cat.Cat() # noqa: E501
- if include_optional :
- return Cat(
- declawed = True
- )
- else :
- return Cat(
- )
-
def testCat(self):
"""Test Cat"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = Cat() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_cat_all_of.py b/samples/client/petstore/python/test/test_cat_all_of.py
index 531443380c6e..a5bb91ac864e 100644
--- a/samples/client/petstore/python/test/test_cat_all_of.py
+++ b/samples/client/petstore/python/test/test_cat_all_of.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.cat_all_of import CatAllOf # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.cat_all_of import CatAllOf
class TestCatAllOf(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testCatAllOf(self):
"""Test CatAllOf"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501
+ # model = CatAllOf() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py
index 05b4714fe9f3..59b64e5924a8 100644
--- a/samples/client/petstore/python/test/test_category.py
+++ b/samples/client/petstore/python/test/test_category.py
@@ -11,13 +11,12 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.category import Category # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.category import Category
+
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@@ -28,26 +27,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test Category
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.category.Category() # noqa: E501
- if include_optional :
- return Category(
- id = 56,
- name = 'default-name'
- )
- else :
- return Category(
- name = 'default-name',
- )
-
def testCategory(self):
"""Test Category"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = Category() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python-experimental/test/test_child.py b/samples/client/petstore/python/test/test_child.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child.py
rename to samples/client/petstore/python/test/test_child.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_all_of.py b/samples/client/petstore/python/test/test_child_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_all_of.py
rename to samples/client/petstore/python/test/test_child_all_of.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_cat.py b/samples/client/petstore/python/test/test_child_cat.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_cat.py
rename to samples/client/petstore/python/test/test_child_cat.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/client/petstore/python/test/test_child_cat_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_cat_all_of.py
rename to samples/client/petstore/python/test/test_child_cat_all_of.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_dog.py b/samples/client/petstore/python/test/test_child_dog.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_dog.py
rename to samples/client/petstore/python/test/test_child_dog.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py b/samples/client/petstore/python/test/test_child_dog_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_dog_all_of.py
rename to samples/client/petstore/python/test/test_child_dog_all_of.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard.py b/samples/client/petstore/python/test/test_child_lizard.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_lizard.py
rename to samples/client/petstore/python/test/test_child_lizard.py
diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py b/samples/client/petstore/python/test/test_child_lizard_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py
rename to samples/client/petstore/python/test/test_child_lizard_all_of.py
diff --git a/samples/client/petstore/python/test/test_class_model.py b/samples/client/petstore/python/test/test_class_model.py
index 12b7fb99402e..060df39e4b5e 100644
--- a/samples/client/petstore/python/test/test_class_model.py
+++ b/samples/client/petstore/python/test/test_class_model.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.class_model import ClassModel # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.class_model import ClassModel
class TestClassModel(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testClassModel(self):
"""Test ClassModel"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.class_model.ClassModel() # noqa: E501
+ # model = ClassModel() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_client.py b/samples/client/petstore/python/test/test_client.py
index 9e18c4310d96..ab5e3a80d377 100644
--- a/samples/client/petstore/python/test/test_client.py
+++ b/samples/client/petstore/python/test/test_client.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.client import Client # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.client import Client
class TestClient(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testClient(self):
"""Test Client"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.client.Client() # noqa: E501
+ # model = Client() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py
index dc151f998ddd..0b95c0a4c83a 100644
--- a/samples/client/petstore/python/test/test_dog.py
+++ b/samples/client/petstore/python/test/test_dog.py
@@ -5,18 +5,27 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.dog import Dog # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import animal
+except ImportError:
+ animal = sys.modules[
+ 'petstore_api.model.animal']
+try:
+ from petstore_api.model import dog_all_of
+except ImportError:
+ dog_all_of = sys.modules[
+ 'petstore_api.model.dog_all_of']
+from petstore_api.model.dog import Dog
class TestDog(unittest.TestCase):
@@ -30,10 +39,113 @@ def tearDown(self):
def testDog(self):
"""Test Dog"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.dog.Dog() # noqa: E501
- pass
+ # make an instance of dog, a composed schema model
+ class_name = 'Dog'
+ color = 'white'
+ breed = 'Jack Russel Terrier'
+ dog = Dog(
+ class_name=class_name,
+ color=color,
+ breed=breed
+ )
+
+ # check its properties
+ self.assertEqual(dog.class_name, class_name)
+ self.assertEqual(dog.color, color)
+ self.assertEqual(dog.breed, breed)
+ # access them with keys
+ self.assertEqual(dog['class_name'], class_name)
+ self.assertEqual(dog['color'], color)
+ self.assertEqual(dog['breed'], breed)
+ # access them with getattr
+ self.assertEqual(getattr(dog, 'class_name'), class_name)
+ self.assertEqual(getattr(dog, 'color'), color)
+ self.assertEqual(getattr(dog, 'breed'), breed)
+
+ # check the model's to_dict result
+ self.assertEqual(
+ dog.to_dict(),
+ {
+ 'class_name': class_name,
+ 'color': color,
+ 'breed': breed,
+ }
+ )
+
+ # setting a value that doesn't exist raises an exception
+ # with a key
+ with self.assertRaises(AttributeError):
+ dog['invalid_variable'] = 'some value'
+ # with setattr
+ with self.assertRaises(AttributeError):
+ setattr(dog, 'invalid_variable', 'some value')
+
+ # getting a value that doesn't exist raises an exception
+ # with a key
+ with self.assertRaises(AttributeError):
+ invalid_variable = dog['invalid_variable']
+ # with getattr
+ self.assertEqual(getattr(dog, 'invalid_variable', 'some value'), 'some value')
+
+ with self.assertRaises(AttributeError):
+ invalid_variable = getattr(dog, 'invalid_variable')
+
+ # make sure that the ModelComposed class properties are correct
+ # model.composed_schemas() stores the anyOf/allOf/oneOf info
+ self.assertEqual(
+ dog._composed_schemas,
+ {
+ 'anyOf': [],
+ 'allOf': [
+ animal.Animal,
+ dog_all_of.DogAllOf,
+ ],
+ 'oneOf': [],
+ }
+ )
+ # model._composed_instances is a list of the instances that were
+ # made from the anyOf/allOf/OneOf classes in model._composed_schemas()
+ for composed_instance in dog._composed_instances:
+ if composed_instance.__class__ == animal.Animal:
+ animal_instance = composed_instance
+ elif composed_instance.__class__ == dog_all_of.DogAllOf:
+ dog_allof_instance = composed_instance
+ self.assertEqual(
+ dog._composed_instances,
+ [animal_instance, dog_allof_instance]
+ )
+ # model._var_name_to_model_instances maps the variable name to the
+ # model instances which store that variable
+ self.assertEqual(
+ dog._var_name_to_model_instances,
+ {
+ 'breed': [dog, dog_allof_instance],
+ 'class_name': [dog, animal_instance],
+ 'color': [dog, animal_instance]
+ }
+ )
+ # model._additional_properties_model_instances stores a list of
+ # models which have the property additional_properties_type != None
+ self.assertEqual(
+ dog._additional_properties_model_instances, []
+ )
+
+ # if we modify one of the properties owned by multiple
+ # model_instances we get an exception when we try to access that
+ # property because the retrieved values are not all the same
+ dog_allof_instance.breed = 'Golden Retriever'
+ with self.assertRaises(petstore_api.ApiValueError):
+ breed = dog.breed
+
+ # including extra parameters raises an exception
+ with self.assertRaises(petstore_api.ApiValueError):
+ dog = Dog(
+ class_name=class_name,
+ color=color,
+ breed=breed,
+ unknown_property='some value'
+ )
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/petstore/python/test/test_dog_all_of.py b/samples/client/petstore/python/test/test_dog_all_of.py
index 3d79f2888c96..7ab4e8ae79d8 100644
--- a/samples/client/petstore/python/test/test_dog_all_of.py
+++ b/samples/client/petstore/python/test/test_dog_all_of.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.dog_all_of import DogAllOf # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.dog_all_of import DogAllOf
class TestDogAllOf(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testDogAllOf(self):
"""Test DogAllOf"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501
+ # model = DogAllOf() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_enum_arrays.py b/samples/client/petstore/python/test/test_enum_arrays.py
index be572508ef22..64ad5fd7dc08 100644
--- a/samples/client/petstore/python/test/test_enum_arrays.py
+++ b/samples/client/petstore/python/test/test_enum_arrays.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.enum_arrays import EnumArrays
class TestEnumArrays(unittest.TestCase):
@@ -28,12 +27,136 @@ def setUp(self):
def tearDown(self):
pass
- def testEnumArrays(self):
- """Test EnumArrays"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
- pass
+ def test_enumarrays_init(self):
+ #
+ # Check various combinations of valid values.
+ #
+ fish_or_crab = EnumArrays(just_symbol=">=")
+ self.assertEqual(fish_or_crab.just_symbol, ">=")
+ # if optional property is unset we raise an exception
+ with self.assertRaises(petstore_api.ApiAttributeError) as exc:
+ self.assertEqual(fish_or_crab.array_enum, None)
+
+ fish_or_crab = EnumArrays(just_symbol="$", array_enum=["fish"])
+ self.assertEqual(fish_or_crab.just_symbol, "$")
+ self.assertEqual(fish_or_crab.array_enum, ["fish"])
+
+ fish_or_crab = EnumArrays(just_symbol=">=", array_enum=["fish"])
+ self.assertEqual(fish_or_crab.just_symbol, ">=")
+ self.assertEqual(fish_or_crab.array_enum, ["fish"])
+
+ fish_or_crab = EnumArrays(just_symbol="$", array_enum=["crab"])
+ self.assertEqual(fish_or_crab.just_symbol, "$")
+ self.assertEqual(fish_or_crab.array_enum, ["crab"])
+
+
+ #
+ # Check if setting invalid values fails
+ #
+ with self.assertRaises(petstore_api.ApiValueError) as exc:
+ fish_or_crab = EnumArrays(just_symbol="<=")
+
+ with self.assertRaises(petstore_api.ApiValueError) as exc:
+ fish_or_crab = EnumArrays(just_symbol="$", array_enum=["dog"])
+
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ fish_or_crab = EnumArrays(just_symbol=["$"], array_enum=["crab"])
+
+
+ def test_enumarrays_setter(self):
+
+ #
+ # Check various combinations of valid values
+ #
+ fish_or_crab = EnumArrays()
+
+ fish_or_crab.just_symbol = ">="
+ self.assertEqual(fish_or_crab.just_symbol, ">=")
+
+ fish_or_crab.just_symbol = "$"
+ self.assertEqual(fish_or_crab.just_symbol, "$")
+
+ fish_or_crab.array_enum = []
+ self.assertEqual(fish_or_crab.array_enum, [])
+
+ fish_or_crab.array_enum = ["fish"]
+ self.assertEqual(fish_or_crab.array_enum, ["fish"])
+
+ fish_or_crab.array_enum = ["fish", "fish", "fish"]
+ self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"])
+
+ fish_or_crab.array_enum = ["crab"]
+ self.assertEqual(fish_or_crab.array_enum, ["crab"])
+
+ fish_or_crab.array_enum = ["crab", "fish"]
+ self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"])
+
+ fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"]
+ self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"])
+
+ #
+ # Check if setting invalid values fails
+ #
+ fish_or_crab = EnumArrays()
+ with self.assertRaises(petstore_api.ApiValueError) as exc:
+ fish_or_crab.just_symbol = "!="
+
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ fish_or_crab.just_symbol = ["fish"]
+
+ with self.assertRaises(petstore_api.ApiValueError) as exc:
+ fish_or_crab.array_enum = ["cat"]
+
+ with self.assertRaises(petstore_api.ApiValueError) as exc:
+ fish_or_crab.array_enum = ["fish", "crab", "dog"]
+
+ with self.assertRaises(petstore_api.ApiTypeError) as exc:
+ fish_or_crab.array_enum = "fish"
+
+
+ def test_todict(self):
+ #
+ # Check if dictionary serialization works
+ #
+ dollar_fish_crab_dict = {
+ 'just_symbol': "$",
+ 'array_enum': ["fish", "crab"]
+ }
+
+ dollar_fish_crab = EnumArrays(
+ just_symbol="$", array_enum=["fish", "crab"])
+
+ self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict())
+
+ #
+ # Sanity check for different arrays
+ #
+ dollar_crab_fish_dict = {
+ 'just_symbol': "$",
+ 'array_enum': ["crab", "fish"]
+ }
+
+ dollar_fish_crab = EnumArrays(
+ just_symbol="$", array_enum=["fish", "crab"])
+
+ self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict())
+
+
+ def test_equals(self):
+ #
+ # Check if object comparison works
+ #
+ fish1 = EnumArrays(just_symbol="$", array_enum=["fish"])
+ fish2 = EnumArrays(just_symbol="$", array_enum=["fish"])
+ self.assertEqual(fish1, fish2)
+
+ fish = EnumArrays(just_symbol="$", array_enum=["fish"])
+ crab = EnumArrays(just_symbol="$", array_enum=["crab"])
+ self.assertNotEqual(fish, crab)
+ dollar = EnumArrays(just_symbol="$")
+ greater = EnumArrays(just_symbol=">=")
+ self.assertNotEqual(dollar, greater)
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python/test/test_enum_class.py
index f092ab776424..f910231c9d02 100644
--- a/samples/client/petstore/python/test/test_enum_class.py
+++ b/samples/client/petstore/python/test/test_enum_class.py
@@ -11,13 +11,12 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.enum_class import EnumClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.enum_class import EnumClass
+
class TestEnumClass(unittest.TestCase):
"""EnumClass unit test stubs"""
@@ -28,23 +27,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test EnumClass
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.enum_class.EnumClass() # noqa: E501
- if include_optional :
- return EnumClass(
- )
- else :
- return EnumClass(
- )
-
def testEnumClass(self):
"""Test EnumClass"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = EnumClass() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_enum_test.py b/samples/client/petstore/python/test/test_enum_test.py
index ecd43afc709d..7b4c1b6b66ac 100644
--- a/samples/client/petstore/python/test/test_enum_test.py
+++ b/samples/client/petstore/python/test/test_enum_test.py
@@ -5,18 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.enum_test import EnumTest # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import string_enum
+except ImportError:
+ string_enum = sys.modules[
+ 'petstore_api.model.string_enum']
+from petstore_api.model.enum_test import EnumTest
class TestEnumTest(unittest.TestCase):
@@ -31,7 +35,7 @@ def tearDown(self):
def testEnumTest(self):
"""Test EnumTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
+ # model = EnumTest() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py
index fc2cbef35f1c..34d207f3c71d 100644
--- a/samples/client/petstore/python/test/test_fake_api.py
+++ b/samples/client/petstore/python/test/test_fake_api.py
@@ -5,7 +5,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
@@ -16,38 +16,78 @@
import petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
-from petstore_api.rest import ApiException
class TestFakeApi(unittest.TestCase):
"""FakeApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
+ self.api = FakeApi() # noqa: E501
def tearDown(self):
pass
- def test_fake_outer_boolean_serialize(self):
- """Test case for fake_outer_boolean_serialize
+ def test_create_xml_item(self):
+ """Test case for create_xml_item
+ creates an XmlItem # noqa: E501
"""
pass
- def test_fake_outer_composite_serialize(self):
- """Test case for fake_outer_composite_serialize
+ def test_boolean(self):
+ """Test case for boolean
"""
- pass
+ endpoint = self.api.boolean
+ assert endpoint.openapi_types['body'] == (bool,)
+ assert endpoint.settings['response_type'] == (bool,)
- def test_fake_outer_number_serialize(self):
- """Test case for fake_outer_number_serialize
+ def test_string(self):
+ """Test case for string
"""
- pass
+ endpoint = self.api.string
+ assert endpoint.openapi_types['body'] == (str,)
+ assert endpoint.settings['response_type'] == (str,)
+
+ def test_object_model_with_ref_props(self):
+ """Test case for object_model_with_ref_props
+
+ """
+ from petstore_api.model import object_model_with_ref_props
+ endpoint = self.api.object_model_with_ref_props
+ assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,)
+ assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,)
- def test_fake_outer_string_serialize(self):
- """Test case for fake_outer_string_serialize
+ def test_string_enum(self):
+ """Test case for string_enum
+
+ """
+ from petstore_api.model import string_enum
+ endpoint = self.api.string_enum
+ assert endpoint.openapi_types['body'] == (string_enum.StringEnum,)
+ assert endpoint.settings['response_type'] == (string_enum.StringEnum,)
+
+ def test_array_model(self):
+ """Test case for array_model
+
+ """
+ from petstore_api.model import animal_farm
+ endpoint = self.api.array_model
+ assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,)
+ assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,)
+
+ def test_number_with_validations(self):
+ """Test case for number_with_validations
+
+ """
+ from petstore_api.model import number_with_validations
+ endpoint = self.api.number_with_validations
+ assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,)
+ assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,)
+
+ def test_test_body_with_file_schema(self):
+ """Test case for test_body_with_file_schema
"""
pass
@@ -65,18 +105,77 @@ def test_test_client_model(self):
"""
pass
+ def test_test_endpoint_enums_length_one(self):
+ """Test case for test_endpoint_enums_length_one
+
+ """
+ # when we omit the required enums of length one, they are still set
+ endpoint = self.api.test_endpoint_enums_length_one
+ import six
+ if six.PY3:
+ from unittest.mock import patch
+ else:
+ from mock import patch
+ with patch.object(endpoint, 'call_with_http_info') as call_with_http_info:
+ endpoint()
+ call_with_http_info.assert_called_with(
+ _check_input_type=True,
+ _check_return_type=True,
+ _host_index=None,
+ _preload_content=True,
+ _request_timeout=None,
+ _return_http_data_only=True,
+ async_req=False,
+ header_number=1.234,
+ path_integer=34,
+ path_string='hello',
+ query_integer=3,
+ query_string='brillig'
+ )
+
def test_test_endpoint_parameters(self):
"""Test case for test_endpoint_parameters
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
"""
- pass
+ # check that we can access the endpoint's validations
+ endpoint = self.api.test_endpoint_parameters
+ assert endpoint.validations[('number',)] == {
+ 'inclusive_maximum': 543.2,
+ 'inclusive_minimum': 32.1,
+ }
+ # make sure that an exception is thrown on an invalid value
+ keyword_args = dict(
+ number=544, # invalid
+ double=100,
+ pattern_without_delimiter="abc",
+ byte='sample string'
+ )
+ with self.assertRaises(petstore_api.ApiValueError):
+ self.api.test_endpoint_parameters(**keyword_args)
def test_test_enum_parameters(self):
"""Test case for test_enum_parameters
To test enum parameters # noqa: E501
"""
+ # check that we can access the endpoint's allowed_values
+ endpoint = self.api.test_enum_parameters
+ assert endpoint.allowed_values[('enum_query_string',)] == {
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ }
+ # make sure that an exception is thrown on an invalid value
+ keyword_args = dict(enum_query_string="bad value")
+ with self.assertRaises(petstore_api.ApiValueError):
+ self.api.test_enum_parameters(**keyword_args)
+
+ def test_test_group_parameters(self):
+ """Test case for test_group_parameters
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ """
pass
def test_test_inline_additional_properties(self):
diff --git a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py
index 87cac0b9ef85..1ade31405a62 100644
--- a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py
+++ b/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py
@@ -5,25 +5,24 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
-from petstore_api.rest import ApiException
class TestFakeClassnameTags123Api(unittest.TestCase):
"""FakeClassnameTags123Api unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
+ self.api = FakeClassnameTags123Api() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/client/petstore/python/test/test_file.py b/samples/client/petstore/python/test/test_file.py
index bc51bffba560..8d60f64e01cc 100644
--- a/samples/client/petstore/python/test/test_file.py
+++ b/samples/client/petstore/python/test/test_file.py
@@ -11,13 +11,12 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.file import File # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.file import File
+
class TestFile(unittest.TestCase):
"""File unit test stubs"""
@@ -28,24 +27,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test File
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.file.File() # noqa: E501
- if include_optional :
- return File(
- source_uri = '0'
- )
- else :
- return File(
- )
-
def testFile(self):
"""Test File"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = File() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_file_schema_test_class.py b/samples/client/petstore/python/test/test_file_schema_test_class.py
index 182a1b0a5537..9a4f6d38dfef 100644
--- a/samples/client/petstore/python/test/test_file_schema_test_class.py
+++ b/samples/client/petstore/python/test/test_file_schema_test_class.py
@@ -11,13 +11,17 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import file
+except ImportError:
+ file = sys.modules[
+ 'petstore_api.model.file']
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+
class TestFileSchemaTestClass(unittest.TestCase):
"""FileSchemaTestClass unit test stubs"""
@@ -28,29 +32,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test FileSchemaTestClass
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
- if include_optional :
- return FileSchemaTestClass(
- file = petstore_api.models.file.File(
- source_uri = '0', ),
- files = [
- petstore_api.models.file.File(
- source_uri = '0', )
- ]
- )
- else :
- return FileSchemaTestClass(
- )
-
def testFileSchemaTestClass(self):
"""Test FileSchemaTestClass"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = FileSchemaTestClass() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py
index e64c47b385d7..ca37b005fd96 100644
--- a/samples/client/petstore/python/test/test_format_test.py
+++ b/samples/client/petstore/python/test/test_format_test.py
@@ -11,59 +11,143 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.format_test import FormatTest # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.format_test import FormatTest
+
class TestFormatTest(unittest.TestCase):
"""FormatTest unit test stubs"""
def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def make_instance(self, include_optional):
- """Test FormatTest
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.format_test.FormatTest() # noqa: E501
- if include_optional :
- return FormatTest(
- integer = 1E+1,
- int32 = 2E+1,
- int64 = 56,
- number = 32.1,
- float = 54.3,
- double = 67.8,
- string = 'a',
- byte = 'YQ==',
- binary = 'bytes',
- date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
- date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
- uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
- password = '0123456789',
- big_decimal = 1
- )
- else :
- return FormatTest(
- number = 32.1,
- byte = 'YQ==',
- date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
- password = '0123456789',
+ import datetime
+ self.required_named_args = dict(
+ number=40.1,
+ byte='what',
+ date=datetime.date(2019, 3, 23),
+ password='rainbowtable'
)
- def testFormatTest(self):
- """Test FormatTest"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ def test_integer(self):
+ var_name = 'integer'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
+ for key, adder in key_adder_pairs:
+ # value outside the bounds throws an error
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = validations[key] + adder
+ FormatTest(**keyword_args)
+
+ # value inside the bounds works
+ keyword_args[var_name] = validations[key]
+ assert (getattr(FormatTest(**keyword_args), var_name) ==
+ validations[key])
+
+ def test_int32(self):
+ var_name = 'int32'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
+ for key, adder in key_adder_pairs:
+ # value outside the bounds throws an error
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = validations[key] + adder
+ FormatTest(**keyword_args)
+
+ # value inside the bounds works
+ keyword_args[var_name] = validations[key]
+ assert (getattr(FormatTest(**keyword_args), var_name) ==
+ validations[key])
+
+ def test_number(self):
+ var_name = 'number'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
+ for key, adder in key_adder_pairs:
+ # value outside the bounds throws an error
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = validations[key] + adder
+ FormatTest(**keyword_args)
+
+ # value inside the bounds works
+ keyword_args[var_name] = validations[key]
+ assert (getattr(FormatTest(**keyword_args), var_name) ==
+ validations[key])
+
+ def test_float(self):
+ var_name = 'float'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
+ for key, adder in key_adder_pairs:
+ # value outside the bounds throws an error
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = validations[key] + adder
+ FormatTest(**keyword_args)
+
+ # value inside the bounds works
+ keyword_args[var_name] = validations[key]
+ assert (getattr(FormatTest(**keyword_args), var_name) ==
+ validations[key])
+
+ def test_double(self):
+ var_name = 'double'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)]
+ for key, adder in key_adder_pairs:
+ # value outside the bounds throws an error
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = validations[key] + adder
+ FormatTest(**keyword_args)
+
+ # value inside the bounds works
+ keyword_args[var_name] = validations[key]
+ assert (getattr(FormatTest(**keyword_args), var_name) ==
+ validations[key])
+
+ def test_password(self):
+ var_name = 'password'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ key_adder_pairs = [('max_length', 1), ('min_length', -1)]
+ for key, adder in key_adder_pairs:
+ # value outside the bounds throws an error
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = 'a'*(validations[key] + adder)
+ FormatTest(**keyword_args)
+
+ # value inside the bounds works
+ keyword_args[var_name] = 'a'*validations[key]
+ assert (getattr(FormatTest(**keyword_args), var_name) ==
+ 'a'*validations[key])
+
+ def test_string(self):
+ var_name = 'string'
+ validations = FormatTest.validations[(var_name,)]
+ keyword_args = {}
+ keyword_args.update(self.required_named_args)
+ values_invalid = ['abc3', '1', '.', ' ', 'مرحبا', '']
+ for value_invalid in values_invalid:
+ # invalid values throw exceptions
+ with self.assertRaises(petstore_api.ApiValueError):
+ keyword_args[var_name] = value_invalid
+ FormatTest(**keyword_args)
+ # valid value works
+ value_valid = 'abcdz'
+ keyword_args[var_name] = value_valid
+ assert getattr(FormatTest(**keyword_args), var_name) == value_valid
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_grandparent.py b/samples/client/petstore/python/test/test_grandparent.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_grandparent.py
rename to samples/client/petstore/python/test/test_grandparent.py
diff --git a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/client/petstore/python/test/test_grandparent_animal.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_grandparent_animal.py
rename to samples/client/petstore/python/test/test_grandparent_animal.py
diff --git a/samples/client/petstore/python/test/test_has_only_read_only.py b/samples/client/petstore/python/test/test_has_only_read_only.py
index 2dc052a328a0..9ebd7683b398 100644
--- a/samples/client/petstore/python/test/test_has_only_read_only.py
+++ b/samples/client/petstore/python/test/test_has_only_read_only.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.has_only_read_only import HasOnlyReadOnly
class TestHasOnlyReadOnly(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testHasOnlyReadOnly(self):
"""Test HasOnlyReadOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
+ # model = HasOnlyReadOnly() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_list.py b/samples/client/petstore/python/test/test_list.py
index a538a6b1ad36..52156adfed2e 100644
--- a/samples/client/petstore/python/test/test_list.py
+++ b/samples/client/petstore/python/test/test_list.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.list import List # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.list import List
class TestList(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testList(self):
"""Test List"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.list.List() # noqa: E501
+ # model = List() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_map_test.py b/samples/client/petstore/python/test/test_map_test.py
index 40eb0a42e6ea..3feda0f688df 100644
--- a/samples/client/petstore/python/test/test_map_test.py
+++ b/samples/client/petstore/python/test/test_map_test.py
@@ -11,13 +11,17 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.map_test import MapTest # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import string_boolean_map
+except ImportError:
+ string_boolean_map = sys.modules[
+ 'petstore_api.model.string_boolean_map']
+from petstore_api.model.map_test import MapTest
+
class TestMapTest(unittest.TestCase):
"""MapTest unit test stubs"""
@@ -28,38 +32,94 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test MapTest
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.map_test.MapTest() # noqa: E501
- if include_optional :
- return MapTest(
- map_map_of_string = {
- 'key' : {
- 'key' : '0'
- }
- },
- map_of_enum_string = {
- 'UPPER' : 'UPPER'
- },
- direct_map = {
- 'key' : True
- },
- indirect_map = {
- 'key' : True
- }
- )
- else :
- return MapTest(
- )
-
- def testMapTest(self):
- """Test MapTest"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ def test_maptest_init(self):
+ #
+ # Test MapTest construction with valid values
+ #
+ up_or_low_dict = {
+ 'UPPER': "UP",
+ 'lower': "low"
+ }
+ map_enum_test = MapTest(map_of_enum_string=up_or_low_dict)
+
+ self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+
+ map_of_map_of_strings = {
+ 'valueDict': up_or_low_dict
+ }
+ map_enum_test = MapTest(map_map_of_string=map_of_map_of_strings)
+
+ self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
+
+ #
+ # Make sure that the init fails for invalid enum values
+ #
+ black_or_white_dict = {
+ 'black': "UP",
+ 'white': "low"
+ }
+ with self.assertRaises(petstore_api.ApiValueError):
+ MapTest(map_of_enum_string=black_or_white_dict)
+
+ def test_maptest_setter(self):
+ #
+ # Check with some valid values
+ #
+ map_enum_test = MapTest()
+ up_or_low_dict = {
+ 'UPPER': "UP",
+ 'lower': "low"
+ }
+ map_enum_test.map_of_enum_string = up_or_low_dict
+ self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+
+ #
+ # Check if the setter fails for invalid enum values
+ #
+ map_enum_test = MapTest()
+ black_or_white_dict = {
+ 'black': "UP",
+ 'white': "low"
+ }
+ with self.assertRaises(petstore_api.ApiValueError):
+ map_enum_test.map_of_enum_string = black_or_white_dict
+
+ def test_todict(self):
+ #
+ # Check dictionary serialization
+ #
+ map_enum_test = MapTest()
+ up_or_low_dict = {
+ 'UPPER': "UP",
+ 'lower': "low"
+ }
+ map_of_map_of_strings = {
+ 'valueDict': up_or_low_dict
+ }
+ indirect_map = string_boolean_map.StringBooleanMap(**{
+ 'option1': True
+ })
+ direct_map = {
+ 'option2': False
+ }
+ map_enum_test.map_of_enum_string = up_or_low_dict
+ map_enum_test.map_map_of_string = map_of_map_of_strings
+ map_enum_test.indirect_map = indirect_map
+ map_enum_test.direct_map = direct_map
+
+ self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+ self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
+ self.assertEqual(map_enum_test.indirect_map, indirect_map)
+ self.assertEqual(map_enum_test.direct_map, direct_map)
+
+ expected_dict = {
+ 'map_of_enum_string': up_or_low_dict,
+ 'map_map_of_string': map_of_map_of_strings,
+ 'indirect_map': indirect_map.to_dict(),
+ 'direct_map': direct_map
+ }
+ self.assertEqual(map_enum_test.to_dict(), expected_dict)
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py
index ef77830aa192..4dcb5ad4268c 100644
--- a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py
+++ b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py
@@ -11,13 +11,17 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import animal
+except ImportError:
+ animal = sys.modules[
+ 'petstore_api.model.animal']
+from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
"""MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
@@ -28,30 +32,11 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test MixedPropertiesAndAdditionalPropertiesClass
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
- if include_optional :
- return MixedPropertiesAndAdditionalPropertiesClass(
- uuid = '0',
- date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
- map = {
- 'key' : petstore_api.models.animal.Animal(
- class_name = '0',
- color = 'red', )
- }
- )
- else :
- return MixedPropertiesAndAdditionalPropertiesClass(
- )
-
def testMixedPropertiesAndAdditionalPropertiesClass(self):
"""Test MixedPropertiesAndAdditionalPropertiesClass"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ # FIXME: construct object with mandatory attributes with example values
+ # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
+ pass
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_model200_response.py b/samples/client/petstore/python/test/test_model200_response.py
index fab761f4edba..4012eaae3362 100644
--- a/samples/client/petstore/python/test/test_model200_response.py
+++ b/samples/client/petstore/python/test/test_model200_response.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.model200_response import Model200Response # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.model200_response import Model200Response
class TestModel200Response(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testModel200Response(self):
"""Test Model200Response"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.model200_response.Model200Response() # noqa: E501
+ # model = Model200Response() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python/test/test_model_return.py
index ae3f15ee6b83..54c98b33cd66 100644
--- a/samples/client/petstore/python/test/test_model_return.py
+++ b/samples/client/petstore/python/test/test_model_return.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.model_return import ModelReturn # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.model_return import ModelReturn
class TestModelReturn(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testModelReturn(self):
"""Test ModelReturn"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.model_return.ModelReturn() # noqa: E501
+ # model = ModelReturn() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python/test/test_name.py
index d6c72563991f..6a9be99d1a57 100644
--- a/samples/client/petstore/python/test/test_name.py
+++ b/samples/client/petstore/python/test/test_name.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.name import Name # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.name import Name
class TestName(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testName(self):
"""Test Name"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.name.Name() # noqa: E501
+ # model = Name() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_number_only.py b/samples/client/petstore/python/test/test_number_only.py
index 7f6df65c8058..07aab1d78af7 100644
--- a/samples/client/petstore/python/test/test_number_only.py
+++ b/samples/client/petstore/python/test/test_number_only.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.number_only import NumberOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.number_only import NumberOnly
class TestNumberOnly(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testNumberOnly(self):
"""Test NumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.number_only.NumberOnly() # noqa: E501
+ # model = NumberOnly() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/client/petstore/python/test/test_number_with_validations.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_number_with_validations.py
rename to samples/client/petstore/python/test/test_number_with_validations.py
diff --git a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/client/petstore/python/test/test_object_model_with_ref_props.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py
rename to samples/client/petstore/python/test/test_object_model_with_ref_props.py
diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python/test/test_order.py
index 3e7d517d5c79..ee6988e28ccd 100644
--- a/samples/client/petstore/python/test/test_order.py
+++ b/samples/client/petstore/python/test/test_order.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.order import Order # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.order import Order
class TestOrder(unittest.TestCase):
@@ -30,9 +29,12 @@ def tearDown(self):
def testOrder(self):
"""Test Order"""
- # FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.order.Order() # noqa: E501
- pass
+ order = Order()
+ order.status = "placed"
+ self.assertEqual("placed", order.status)
+ with self.assertRaises(petstore_api.ApiValueError):
+ order.status = "invalid"
+
if __name__ == '__main__':
diff --git a/samples/client/petstore/python-experimental/test/test_parent.py b/samples/client/petstore/python/test/test_parent.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_parent.py
rename to samples/client/petstore/python/test/test_parent.py
diff --git a/samples/client/petstore/python-experimental/test/test_parent_all_of.py b/samples/client/petstore/python/test/test_parent_all_of.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_parent_all_of.py
rename to samples/client/petstore/python/test/test_parent_all_of.py
diff --git a/samples/client/petstore/python-experimental/test/test_parent_pet.py b/samples/client/petstore/python/test/test_parent_pet.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_parent_pet.py
rename to samples/client/petstore/python/test/test_parent_pet.py
diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py
index 2e4a40d78b31..b072cff5e9ad 100644
--- a/samples/client/petstore/python/test/test_pet.py
+++ b/samples/client/petstore/python/test/test_pet.py
@@ -11,13 +11,22 @@
from __future__ import absolute_import
-
+import sys
import unittest
-import datetime
import petstore_api
-from petstore_api.models.pet import Pet # noqa: E501
-from petstore_api.rest import ApiException
+try:
+ from petstore_api.model import category
+except ImportError:
+ category = sys.modules[
+ 'petstore_api.model.category']
+try:
+ from petstore_api.models import tag
+except ImportError:
+ tag = sys.modules[
+ 'petstore_api.model.tag']
+from petstore_api.model.pet import Pet
+
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@@ -28,41 +37,52 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
- """Test Pet
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # model = petstore_api.models.pet.Pet() # noqa: E501
- if include_optional :
- return Pet(
- id = 56,
- category = petstore_api.models.category.Category(
- id = 56,
- name = 'default-name', ),
- name = 'doggie',
- photo_urls = [
- '0'
- ],
- tags = [
- petstore_api.models.tag.Tag(
- id = 56,
- name = '0', )
- ],
- status = 'available'
- )
- else :
- return Pet(
- name = 'doggie',
- photo_urls = [
- '0'
- ],
- )
-
- def testPet(self):
- """Test Pet"""
- inst_req_only = self.make_instance(include_optional=False)
- inst_req_and_optional = self.make_instance(include_optional=True)
+ def test_to_str(self):
+ pet = Pet(name="test name", photo_urls=["string"])
+ pet.id = 1
+ pet.status = "available"
+ cate = category.Category()
+ cate.id = 1
+ cate.name = "dog"
+ pet.category = cate
+ tag1 = tag.Tag()
+ tag1.id = 1
+ pet.tags = [tag1]
+
+ data = ("{'category': {'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photo_urls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'id': 1}]}")
+ self.assertEqual(data, pet.to_str())
+
+ def test_equal(self):
+ pet1 = Pet(name="test name", photo_urls=["string"])
+ pet1.id = 1
+ pet1.status = "available"
+ cate1 = category.Category()
+ cate1.id = 1
+ cate1.name = "dog"
+ tag1 = tag.Tag()
+ tag1.id = 1
+ pet1.tags = [tag1]
+
+ pet2 = Pet(name="test name", photo_urls=["string"])
+ pet2.id = 1
+ pet2.status = "available"
+ cate2 = category.Category()
+ cate2.id = 1
+ cate2.name = "dog"
+ tag2 = tag.Tag()
+ tag2.id = 1
+ pet2.tags = [tag2]
+
+ self.assertTrue(pet1 == pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ pet1.tags = []
+ self.assertFalse(pet1 == pet2)
if __name__ == '__main__':
diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python/test/test_pet_api.py
index ffd3e25c4c64..091b30cf8ac0 100644
--- a/samples/client/petstore/python/test/test_pet_api.py
+++ b/samples/client/petstore/python/test/test_pet_api.py
@@ -5,25 +5,24 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
from petstore_api.api.pet_api import PetApi # noqa: E501
-from petstore_api.rest import ApiException
class TestPetApi(unittest.TestCase):
"""PetApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
+ self.api = PetApi() # noqa: E501
def tearDown(self):
pass
@@ -84,6 +83,13 @@ def test_upload_file(self):
"""
pass
+ def test_upload_file_with_required_file(self):
+ """Test case for upload_file_with_required_file
+
+ uploads an image (required) # noqa: E501
+ """
+ pass
+
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_player.py b/samples/client/petstore/python/test/test_player.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_player.py
rename to samples/client/petstore/python/test/test_player.py
diff --git a/samples/client/petstore/python/test/test_read_only_first.py b/samples/client/petstore/python/test/test_read_only_first.py
index 2b647b83fc89..c2dcde240e77 100644
--- a/samples/client/petstore/python/test/test_read_only_first.py
+++ b/samples/client/petstore/python/test/test_read_only_first.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.read_only_first import ReadOnlyFirst
class TestReadOnlyFirst(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testReadOnlyFirst(self):
"""Test ReadOnlyFirst"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
+ # model = ReadOnlyFirst() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python/test/test_special_model_name.py
index 4edfec164f7d..6124525f5170 100644
--- a/samples/client/petstore/python/test/test_special_model_name.py
+++ b/samples/client/petstore/python/test/test_special_model_name.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.special_model_name import SpecialModelName
class TestSpecialModelName(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testSpecialModelName(self):
"""Test SpecialModelName"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
+ # model = SpecialModelName() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python/test/test_store_api.py
index 37bf771d13a6..0d9cc3dd36ea 100644
--- a/samples/client/petstore/python/test/test_store_api.py
+++ b/samples/client/petstore/python/test/test_store_api.py
@@ -5,7 +5,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
@@ -16,14 +16,13 @@
import petstore_api
from petstore_api.api.store_api import StoreApi # noqa: E501
-from petstore_api.rest import ApiException
class TestStoreApi(unittest.TestCase):
"""StoreApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
+ self.api = StoreApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python/test/test_string_boolean_map.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_string_boolean_map.py
rename to samples/client/petstore/python/test/test_string_boolean_map.py
diff --git a/samples/client/petstore/python-experimental/test/test_string_enum.py b/samples/client/petstore/python/test/test_string_enum.py
similarity index 100%
rename from samples/client/petstore/python-experimental/test/test_string_enum.py
rename to samples/client/petstore/python/test/test_string_enum.py
diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python/test/test_tag.py
index 2c3c5157e718..68a3b9046bf4 100644
--- a/samples/client/petstore/python/test/test_tag.py
+++ b/samples/client/petstore/python/test/test_tag.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.tag import Tag # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.tag import Tag
class TestTag(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testTag(self):
"""Test Tag"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.tag.Tag() # noqa: E501
+ # model = Tag() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_type_holder_default.py b/samples/client/petstore/python/test/test_type_holder_default.py
index e23ab2a32fc7..f9c050b81a82 100644
--- a/samples/client/petstore/python/test/test_type_holder_default.py
+++ b/samples/client/petstore/python/test/test_type_holder_default.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.type_holder_default import TypeHolderDefault # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.type_holder_default import TypeHolderDefault
class TestTypeHolderDefault(unittest.TestCase):
@@ -32,15 +31,8 @@ def testTypeHolderDefault(self):
"""Test TypeHolderDefault"""
# required_vars are set to None now until swagger-parser/swagger-core fixes
# https://github.com/swagger-api/swagger-parser/issues/971
- required_vars = ['number_item', 'integer_item', 'array_item']
- sample_values = [5.67, 4, [-5, 2, -6]]
- assigned_variables = {}
- for index, required_var in enumerate(required_vars):
- with self.assertRaises(ValueError):
- model = TypeHolderDefault(**assigned_variables)
- assigned_variables[required_var] = sample_values[index]
- # assigned_variables is fully set, all required variables passed in
- model = TypeHolderDefault(**assigned_variables)
+ array_item = [1, 2, 3]
+ model = TypeHolderDefault(array_item=array_item)
self.assertEqual(model.string_item, 'what')
self.assertEqual(model.bool_item, True)
diff --git a/samples/client/petstore/python/test/test_type_holder_example.py b/samples/client/petstore/python/test/test_type_holder_example.py
index 7a2621494857..e1ee7c368628 100644
--- a/samples/client/petstore/python/test/test_type_holder_example.py
+++ b/samples/client/petstore/python/test/test_type_holder_example.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.type_holder_example import TypeHolderExample # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.type_holder_example import TypeHolderExample
class TestTypeHolderExample(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testTypeHolderExample(self):
"""Test TypeHolderExample"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.type_holder_example.TypeHolderExample() # noqa: E501
+ # model = TypeHolderExample() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python/test/test_user.py
index ad9386b6908e..7241bb589c52 100644
--- a/samples/client/petstore/python/test/test_user.py
+++ b/samples/client/petstore/python/test/test_user.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.user import User # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.user import User
class TestUser(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testUser(self):
"""Test User"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.user.User() # noqa: E501
+ # model = User() # noqa: E501
pass
diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python/test/test_user_api.py
index 6e8aed4f18c7..df306da07761 100644
--- a/samples/client/petstore/python/test/test_user_api.py
+++ b/samples/client/petstore/python/test/test_user_api.py
@@ -5,7 +5,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
@@ -16,14 +16,13 @@
import petstore_api
from petstore_api.api.user_api import UserApi # noqa: E501
-from petstore_api.rest import ApiException
class TestUserApi(unittest.TestCase):
"""UserApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.user_api.UserApi() # noqa: E501
+ self.api = UserApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/client/petstore/python/test/test_xml_item.py b/samples/client/petstore/python/test/test_xml_item.py
index 121f1ccb6623..4354664815ff 100644
--- a/samples/client/petstore/python/test/test_xml_item.py
+++ b/samples/client/petstore/python/test/test_xml_item.py
@@ -5,18 +5,17 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.xml_item import XmlItem # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.xml_item import XmlItem
class TestXmlItem(unittest.TestCase):
@@ -31,7 +30,7 @@ def tearDown(self):
def testXmlItem(self):
"""Test XmlItem"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.xml_item.XmlItem() # noqa: E501
+ # model = XmlItem() # noqa: E501
pass
diff --git a/samples/client/petstore/python-experimental/test_python.sh b/samples/client/petstore/python/test_python.sh
similarity index 100%
rename from samples/client/petstore/python-experimental/test_python.sh
rename to samples/client/petstore/python/test_python.sh
diff --git a/samples/client/petstore/python-experimental/testfiles/1px_pic1.png b/samples/client/petstore/python/testfiles/1px_pic1.png
similarity index 100%
rename from samples/client/petstore/python-experimental/testfiles/1px_pic1.png
rename to samples/client/petstore/python/testfiles/1px_pic1.png
diff --git a/samples/client/petstore/python-experimental/testfiles/1px_pic2.png b/samples/client/petstore/python/testfiles/1px_pic2.png
similarity index 100%
rename from samples/client/petstore/python-experimental/testfiles/1px_pic2.png
rename to samples/client/petstore/python/testfiles/1px_pic2.png
diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py
index 216e1f9ec1b4..c249bf1fc5e8 100644
--- a/samples/client/petstore/python/tests/test_api_client.py
+++ b/samples/client/petstore/python/tests/test_api_client.py
@@ -29,6 +29,7 @@ def setUp(self):
def test_configuration(self):
config = petstore_api.Configuration()
+ config.host = 'http://localhost/'
config.api_key['api_key'] = '123456'
config.api_key_prefix['api_key'] = 'PREFIX'
@@ -45,7 +46,7 @@ def test_configuration(self):
self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key'])
# update parameters based on auth setting
- client.update_params_for_auth(header_params, query_params, auth_settings)
+ client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
# test api key auth
self.assertEqual(header_params['test1'], 'value1')
@@ -56,6 +57,29 @@ def test_configuration(self):
self.assertEqual('test_username', client.configuration.username)
self.assertEqual('test_password', client.configuration.password)
+ # test api key without prefix
+ config.api_key['api_key'] = '123456'
+ config.api_key_prefix['api_key'] = None
+ # update parameters based on auth setting
+ client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
+ self.assertEqual(header_params['api_key'], '123456')
+
+ # test api key with empty prefix
+ config.api_key['api_key'] = '123456'
+ config.api_key_prefix['api_key'] = ''
+ # update parameters based on auth setting
+ client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
+ self.assertEqual(header_params['api_key'], '123456')
+
+ # test api key with prefix specified in the api_key, useful when the prefix
+ # must include '=' sign followed by the API key secret without space.
+ config.api_key['api_key'] = 'PREFIX=123456'
+ config.api_key_prefix['api_key'] = None
+ # update parameters based on auth setting
+ client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
+ self.assertEqual(header_params['api_key'], 'PREFIX=123456')
+
+
def test_select_header_accept(self):
accepts = ['APPLICATION/JSON', 'APPLICATION/XML']
accept = self.api_client.select_header_accept(accepts)
@@ -142,23 +166,27 @@ def test_sanitize_for_serialization(self):
# model
pet_dict = {"id": 1, "name": "monkey",
"category": {"id": 1, "name": "test category"},
- "tags": [{"id": 1, "name": "test tag1"},
- {"id": 2, "name": "test tag2"}],
+ "tags": [{"id": 1, "fullName": "test tag1"},
+ {"id": 2, "fullName": "test tag2"}],
"status": "available",
"photoUrls": ["http://foo.bar.com/3",
"http://foo.bar.com/4"]}
- pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"])
+ from petstore_api.model.pet import Pet
+ from petstore_api.model.category import Category
+ from petstore_api.model.tag import Tag
+ from petstore_api.model.string_boolean_map import StringBooleanMap
+ pet = Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"])
pet.id = pet_dict["id"]
- cate = petstore_api.Category()
+ cate = Category()
cate.id = pet_dict["category"]["id"]
cate.name = pet_dict["category"]["name"]
pet.category = cate
- tag1 = petstore_api.Tag()
+ tag1 = Tag()
tag1.id = pet_dict["tags"][0]["id"]
- tag1.name = pet_dict["tags"][0]["name"]
- tag2 = petstore_api.Tag()
+ tag1.full_name = pet_dict["tags"][0]["fullName"]
+ tag2 = Tag()
tag2.id = pet_dict["tags"][1]["id"]
- tag2.name = pet_dict["tags"][1]["name"]
+ tag2.full_name = pet_dict["tags"][1]["fullName"]
pet.tags = [tag1, tag2]
pet.status = pet_dict["status"]
@@ -172,6 +200,12 @@ def test_sanitize_for_serialization(self):
result = self.api_client.sanitize_for_serialization(data)
self.assertEqual(result, list_of_pet_dict)
+ # model with additional proerties
+ model_dict = {'some_key': True}
+ model = StringBooleanMap(**model_dict)
+ result = self.api_client.sanitize_for_serialization(model)
+ self.assertEqual(result, model_dict)
+
def test_context_manager_closes_threadpool(self):
with petstore_api.ApiClient() as client:
self.assertIsNotNone(client.pool)
diff --git a/samples/client/petstore/python/tests/test_api_exception.py b/samples/client/petstore/python/tests/test_api_exception.py
index b076628c0a0b..0d0771b57850 100644
--- a/samples/client/petstore/python/tests/test_api_exception.py
+++ b/samples/client/petstore/python/tests/test_api_exception.py
@@ -15,7 +15,6 @@
import unittest
import petstore_api
-from petstore_api.rest import ApiException
from .util import id_gen
@@ -23,17 +22,19 @@ class ApiExceptionTests(unittest.TestCase):
def setUp(self):
self.api_client = petstore_api.ApiClient()
- self.pet_api = petstore_api.PetApi(self.api_client)
+ from petstore_api.api.pet_api import PetApi
+ self.pet_api = PetApi(self.api_client)
self.setUpModels()
def setUpModels(self):
- self.category = petstore_api.Category()
+ from petstore_api.model import category, tag, pet
+ self.category = category.Category()
self.category.id = id_gen()
self.category.name = "dog"
- self.tag = petstore_api.Tag()
+ self.tag = tag.Tag()
self.tag.id = id_gen()
- self.tag.name = "blank"
- self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.tag.full_name = "blank"
+ self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
self.pet.id = id_gen()
self.pet.status = "sold"
self.pet.category = self.category
@@ -43,12 +44,12 @@ def test_404_error(self):
self.pet_api.add_pet(self.pet)
self.pet_api.delete_pet(pet_id=self.pet.id)
- with self.checkRaiseRegex(ApiException, "Pet not found"):
+ with self.checkRaiseRegex(petstore_api.ApiException, "Pet not found"):
self.pet_api.get_pet_by_id(pet_id=self.pet.id)
try:
self.pet_api.get_pet_by_id(pet_id=self.pet.id)
- except ApiException as e:
+ except petstore_api.ApiException as e:
self.assertEqual(e.status, 404)
self.assertEqual(e.reason, "Not Found")
self.checkRegex(e.body, "Pet not found")
@@ -56,20 +57,18 @@ def test_404_error(self):
def test_500_error(self):
self.pet_api.add_pet(self.pet)
- with self.checkRaiseRegex(ApiException, "Internal Server Error"):
+ with self.checkRaiseRegex(petstore_api.ApiException, "Internal Server Error"):
self.pet_api.upload_file(
pet_id=self.pet.id,
- additional_metadata="special",
- file=None
+ additional_metadata="special"
)
try:
self.pet_api.upload_file(
pet_id=self.pet.id,
- additional_metadata="special",
- file=None
+ additional_metadata="special"
)
- except ApiException as e:
+ except petstore_api.ApiException as e:
self.assertEqual(e.status, 500)
self.assertEqual(e.reason, "Internal Server Error")
self.checkRegex(e.body, "Error 500 Internal Server Error")
diff --git a/samples/client/petstore/python/tests/test_deserialization.py b/samples/client/petstore/python/tests/test_deserialization.py
index 6c4e083d1cd7..e9ef8951fa2d 100644
--- a/samples/client/petstore/python/tests/test_deserialization.py
+++ b/samples/client/petstore/python/tests/test_deserialization.py
@@ -15,12 +15,36 @@
import unittest
import datetime
+import six
+
import petstore_api
+from petstore_api.exceptions import (
+ ApiTypeError,
+ ApiKeyError,
+ ApiValueError,
+)
+from petstore_api.model import (
+ enum_test,
+ pet,
+ animal,
+ dog,
+ parent_pet,
+ child_lizard,
+ category,
+ string_enum,
+ number_with_validations,
+ string_boolean_map,
+)
+from petstore_api.model_utils import (
+ file_type,
+ model_to_dict,
+)
+
+from petstore_api.rest import RESTResponse
MockResponse = namedtuple('MockResponse', 'data')
-
class DeserializationTests(unittest.TestCase):
def setUp(self):
@@ -35,20 +59,27 @@ def test_enum_test(self):
"enum_string_required": "lower",
"enum_integer": 1,
"enum_number": 1.1,
- "outerEnum": "placed"
+ "stringEnum": "placed"
}
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, EnumTest)')
+ deserialized = self.deserialize(response,
+ ({str: (enum_test.EnumTest,)},), True)
self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest))
- self.assertEqual(deserialized['enum_test'],
- petstore_api.EnumTest(enum_string="UPPER",
- enum_string_required="lower",
- enum_integer=1,
- enum_number=1.1,
- outer_enum=petstore_api.OuterEnum.PLACED))
+ self.assertTrue(
+ isinstance(deserialized['enum_test'], enum_test.EnumTest))
+ value = (
+ string_enum.StringEnum.allowed_values[('value',)]["PLACED"])
+ string_enum_val = string_enum.StringEnum(value)
+ sample_instance = enum_test.EnumTest(
+ enum_string="UPPER",
+ enum_string_required="lower",
+ enum_integer=1,
+ enum_number=1.1,
+ string_enum=string_enum_val
+ )
+ self.assertEqual(deserialized['enum_test'], sample_instance)
def test_deserialize_dict_str_pet(self):
""" deserialize dict(str, Pet) """
@@ -66,7 +97,7 @@ def test_deserialize_dict_str_pet(self):
"tags": [
{
"id": 0,
- "name": "string"
+ "fullName": "string"
}
],
"status": "available"
@@ -74,25 +105,44 @@ def test_deserialize_dict_str_pet(self):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, Pet)')
+ deserialized = self.deserialize(response,
+ ({str: (pet.Pet,)},), True)
self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet))
+ self.assertTrue(isinstance(deserialized['pet'], pet.Pet))
def test_deserialize_dict_str_dog(self):
""" deserialize dict(str, Dog), use discriminator"""
data = {
'dog': {
- "id": 0,
"className": "Dog",
"color": "white",
- "bread": "Jack Russel Terrier"
+ "breed": "Jack Russel Terrier"
}
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, Animal)')
+ deserialized = self.deserialize(response,
+ ({str: (animal.Animal,)},), True)
self.assertTrue(isinstance(deserialized, dict))
- self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog))
+ dog_inst = deserialized['dog']
+ self.assertTrue(isinstance(dog_inst, dog.Dog))
+ self.assertEqual(dog_inst.class_name, "Dog")
+ self.assertEqual(dog_inst.color, "white")
+ self.assertEqual(dog_inst.breed, "Jack Russel Terrier")
+
+ def test_deserialize_lizard(self):
+ """ deserialize ChildLizard, use discriminator"""
+ data = {
+ "pet_type": "ChildLizard",
+ "lovesRocks": True
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ lizard = self.deserialize(response,
+ (parent_pet.ParentPet,), True)
+ self.assertTrue(isinstance(lizard, child_lizard.ChildLizard))
+ self.assertEqual(lizard.pet_type, "ChildLizard")
+ self.assertEqual(lizard.loves_rocks, True)
def test_deserialize_dict_str_int(self):
""" deserialize dict(str, int) """
@@ -101,7 +151,7 @@ def test_deserialize_dict_str_int(self):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, int)')
+ deserialized = self.deserialize(response, ({str: (int,)},), True)
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized['integer'], int))
@@ -110,7 +160,7 @@ def test_deserialize_str(self):
data = "test str"
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "str")
+ deserialized = self.deserialize(response, (str,), True)
self.assertTrue(isinstance(deserialized, str))
def test_deserialize_date(self):
@@ -118,7 +168,7 @@ def test_deserialize_date(self):
data = "1997-07-16"
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "date")
+ deserialized = self.deserialize(response, (datetime.date,), True)
self.assertTrue(isinstance(deserialized, datetime.date))
def test_deserialize_datetime(self):
@@ -126,7 +176,7 @@ def test_deserialize_datetime(self):
data = "1997-07-16T19:20:30.45+01:00"
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "datetime")
+ deserialized = self.deserialize(response, (datetime.datetime,), True)
self.assertTrue(isinstance(deserialized, datetime.datetime))
def test_deserialize_pet(self):
@@ -144,21 +194,21 @@ def test_deserialize_pet(self):
"tags": [
{
"id": 0,
- "name": "string"
+ "fullName": "string"
}
],
"status": "available"
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "Pet")
- self.assertTrue(isinstance(deserialized, petstore_api.Pet))
+ deserialized = self.deserialize(response, (pet.Pet,), True)
+ self.assertTrue(isinstance(deserialized, pet.Pet))
self.assertEqual(deserialized.id, 0)
self.assertEqual(deserialized.name, "doggie")
- self.assertTrue(isinstance(deserialized.category, petstore_api.Category))
+ self.assertTrue(isinstance(deserialized.category, category.Category))
self.assertEqual(deserialized.category.name, "string")
self.assertTrue(isinstance(deserialized.tags, list))
- self.assertEqual(deserialized.tags[0].name, "string")
+ self.assertEqual(deserialized.tags[0].full_name, "string")
def test_deserialize_list_of_pet(self):
""" deserialize list[Pet] """
@@ -176,7 +226,7 @@ def test_deserialize_list_of_pet(self):
"tags": [
{
"id": 0,
- "name": "string"
+ "fullName": "string"
}
],
"status": "available"
@@ -194,16 +244,17 @@ def test_deserialize_list_of_pet(self):
"tags": [
{
"id": 0,
- "name": "string"
+ "fullName": "string"
}
],
"status": "available"
}]
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "list[Pet]")
+ deserialized = self.deserialize(response,
+ ([pet.Pet],), True)
self.assertTrue(isinstance(deserialized, list))
- self.assertTrue(isinstance(deserialized[0], petstore_api.Pet))
+ self.assertTrue(isinstance(deserialized[0], pet.Pet))
self.assertEqual(deserialized[0].id, 0)
self.assertEqual(deserialized[1].id, 1)
self.assertEqual(deserialized[0].name, "doggie0")
@@ -218,7 +269,8 @@ def test_deserialize_nested_dict(self):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "dict(str, dict(str, int))")
+ deserialized = self.deserialize(response,
+ ({str: ({str: (int,)},)},), True)
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized["foo"], dict))
self.assertTrue(isinstance(deserialized["foo"]["bar"], int))
@@ -228,7 +280,7 @@ def test_deserialize_nested_list(self):
data = [["foo"]]
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "list[list[str]]")
+ deserialized = self.deserialize(response, ([[str]],), True)
self.assertTrue(isinstance(deserialized, list))
self.assertTrue(isinstance(deserialized[0], list))
self.assertTrue(isinstance(deserialized[0][0], str))
@@ -237,5 +289,153 @@ def test_deserialize_none(self):
""" deserialize None """
response = MockResponse(data=json.dumps(None))
- deserialized = self.deserialize(response, "datetime")
- self.assertIsNone(deserialized)
+ error_msg = (
+ "Invalid type for variable 'received_data'. Required value type is "
+ "datetime and passed type was NoneType at ['received_data']"
+ )
+ with self.assertRaises(ApiTypeError) as exc:
+ deserialized = self.deserialize(response, (datetime.datetime,), True)
+ self.assertEqual(str(exc.exception), error_msg)
+
+ def test_deserialize_OuterEnum(self):
+ """ deserialize OuterEnum """
+ # make sure that an exception is thrown on an invalid value
+ with self.assertRaises(ApiValueError):
+ self.deserialize(
+ MockResponse(data=json.dumps("test str")),
+ (string_enum.StringEnum,),
+ True
+ )
+
+ # valid value works
+ placed_str = (
+ string_enum.StringEnum.allowed_values[('value',)]["PLACED"]
+ )
+ response = MockResponse(data=json.dumps(placed_str))
+ deserialized = self.deserialize(response,
+ (string_enum.StringEnum,), True)
+ self.assertTrue(isinstance(deserialized, string_enum.StringEnum))
+ self.assertTrue(deserialized.value == placed_str)
+
+ def test_deserialize_NumberWithValidations(self):
+ """ deserialize NumberWithValidations """
+ # make sure that an exception is thrown on an invalid type value
+ with self.assertRaises(ApiTypeError):
+ deserialized = self.deserialize(
+ MockResponse(data=json.dumps("test str")),
+ (number_with_validations.NumberWithValidations,),
+ True
+ )
+
+ # make sure that an exception is thrown on an invalid value
+ with self.assertRaises(ApiValueError):
+ deserialized = self.deserialize(
+ MockResponse(data=json.dumps(21.0)),
+ (number_with_validations.NumberWithValidations,),
+ True
+ )
+
+ # valid value works
+ number_val = 11.0
+ response = MockResponse(data=json.dumps(number_val))
+ number = self.deserialize(response,
+ (number_with_validations.NumberWithValidations,), True)
+ self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations))
+ self.assertTrue(number.value == number_val)
+
+ def test_deserialize_file(self):
+ """Ensures that file deserialization works"""
+ response_types_mixed = (file_type,)
+
+ # sample from http://www.jtricks.com/download-text
+ HTTPResponse = namedtuple(
+ 'urllib3_response_HTTPResponse',
+ ['status', 'reason', 'data', 'getheaders', 'getheader']
+ )
+ headers = {'Content-Disposition': 'attachment; filename=content.txt'}
+ def get_headers():
+ return headers
+ def get_header(name, default=None):
+ return headers.get(name, default)
+ file_data = (
+ "You are reading text file that was supposed to be downloaded\r\n"
+ "to your hard disk. If your browser offered to save you the file,"
+ "\r\nthen it handled the Content-Disposition header correctly."
+ )
+ http_response = HTTPResponse(
+ status=200,
+ reason='OK',
+ data=file_data,
+ getheaders=get_headers,
+ getheader=get_header
+ )
+ # response which is deserialized to a file
+ mock_response = RESTResponse(http_response)
+ file_path = None
+ try:
+ file_object = self.deserialize(
+ mock_response, response_types_mixed, True)
+ self.assertTrue(isinstance(file_object, file_type))
+ file_path = file_object.name
+ self.assertFalse(file_object.closed)
+ file_object.close()
+ if six.PY3:
+ file_data = file_data.encode('utf-8')
+ with open(file_path, 'rb') as other_file_object:
+ self.assertEqual(other_file_object.read(), file_data)
+ finally:
+ os.unlink(file_path)
+
+ def test_deserialize_binary_to_str(self):
+ """Ensures that bytes deserialization works"""
+ response_types_mixed = (str,)
+
+ # sample from http://www.jtricks.com/download-text
+ HTTPResponse = namedtuple(
+ 'urllib3_response_HTTPResponse',
+ ['status', 'reason', 'data', 'getheaders', 'getheader']
+ )
+ headers = {}
+ def get_headers():
+ return headers
+ def get_header(name, default=None):
+ return headers.get(name, default)
+ data = "str"
+
+ http_response = HTTPResponse(
+ status=200,
+ reason='OK',
+ data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data),
+ getheaders=get_headers,
+ getheader=get_header
+ )
+
+ mock_response = RESTResponse(http_response)
+
+ result = self.deserialize(mock_response, response_types_mixed, True)
+ self.assertEqual(isinstance(result, str), True)
+ self.assertEqual(result, data)
+
+ def test_deserialize_string_boolean_map(self):
+ """
+ Ensures that string boolean (additional properties)
+ deserialization works
+ """
+ # make sure that an exception is thrown on an invalid type
+ with self.assertRaises(ApiTypeError):
+ deserialized = self.deserialize(
+ MockResponse(data=json.dumps("test str")),
+ (string_boolean_map.StringBooleanMap,),
+ True
+ )
+
+ # valid value works
+ item_val = {'some_key': True}
+ response = MockResponse(data=json.dumps(item_val))
+ model = string_boolean_map.StringBooleanMap(**item_val)
+ deserialized = self.deserialize(response,
+ (string_boolean_map.StringBooleanMap,), True)
+ self.assertTrue(isinstance(deserialized, string_boolean_map.StringBooleanMap))
+ self.assertTrue(deserialized['some_key'] == True)
+ self.assertTrue(deserialized == model)
+
diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py
index a7b47bdc5670..38d7a1cc0b82 100644
--- a/samples/client/petstore/python/tests/test_pet_api.py
+++ b/samples/client/petstore/python/tests/test_pet_api.py
@@ -11,20 +11,37 @@
$ nosetests -v
"""
+from collections import namedtuple
+import json
import os
import unittest
import petstore_api
from petstore_api import Configuration
-from petstore_api.rest import ApiException
-
+from petstore_api.rest import (
+ RESTClientObject,
+ RESTResponse
+)
+
+import six
+
+from petstore_api.exceptions import (
+ ApiException,
+ ApiValueError,
+ ApiTypeError,
+)
+from petstore_api.api.pet_api import PetApi
+from petstore_api.model import pet
from .util import id_gen
-import json
-
import urllib3
-HOST = 'http://petstore.swagger.io/v2'
+if six.PY3:
+ from unittest.mock import patch
+else:
+ from mock import patch
+
+HOST = 'http://localhost/v2'
class TimeoutWithEqual(urllib3.Timeout):
@@ -59,18 +76,19 @@ def setUp(self):
config.host = HOST
config.access_token = 'ACCESS_TOKEN'
self.api_client = petstore_api.ApiClient(config)
- self.pet_api = petstore_api.PetApi(self.api_client)
+ self.pet_api = PetApi(self.api_client)
self.setUpModels()
self.setUpFiles()
def setUpModels(self):
- self.category = petstore_api.Category()
+ from petstore_api.model import category, tag
+ self.category = category.Category()
self.category.id = id_gen()
self.category.name = "dog"
- self.tag = petstore_api.Tag()
+ self.tag = tag.Tag()
self.tag.id = id_gen()
self.tag.name = "python-pet-tag"
- self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
self.pet.id = id_gen()
self.pet.status = "sold"
self.pet.category = self.category
@@ -79,7 +97,6 @@ def setUpModels(self):
def setUpFiles(self):
self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
self.test_file_dir = os.path.realpath(self.test_file_dir)
- self.foo = os.path.join(self.test_file_dir, "foo.png")
def test_preload_content_flag(self):
self.pet_api.add_pet(self.pet)
@@ -101,17 +118,42 @@ def test_preload_content_flag(self):
resp.close()
resp.release_conn()
+ def test_config(self):
+ config = Configuration(host=HOST)
+ self.assertIsNotNone(config.get_host_settings())
+ self.assertEqual(config.get_basic_auth_token(),
+ urllib3.util.make_headers(basic_auth=":").get('authorization'))
+ # No authentication scheme has been configured at this point, so auth_settings()
+ # should return an empty list.
+ self.assertEqual(len(config.auth_settings()), 0)
+ # Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters.
+ config.access_token = 'MY-ACCESS_TOKEN'
+ self.assertEqual(len(config.auth_settings()), 1)
+ self.assertIn("petstore_auth", config.auth_settings().keys())
+ config.username = "user"
+ config.password = "password"
+ self.assertEqual(
+ config.get_basic_auth_token(),
+ urllib3.util.make_headers(basic_auth="user:password").get('authorization'))
+ self.assertEqual(len(config.auth_settings()), 2)
+ self.assertIn("petstore_auth", config.auth_settings().keys())
+ self.assertIn("http_basic_test", config.auth_settings().keys())
+ config.username = None
+ config.password = None
+ self.assertEqual(len(config.auth_settings()), 1)
+ self.assertIn("petstore_auth", config.auth_settings().keys())
+
def test_timeout(self):
mock_pool = MockPoolManager(self)
self.api_client.rest_client.pool_manager = mock_pool
- mock_pool.expect_request('POST', HOST + '/pet',
+ mock_pool.expect_request('POST', 'http://localhost/v2/pet',
body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
headers={'Content-Type': 'application/json',
'Authorization': 'Bearer ACCESS_TOKEN',
'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
preload_content=True, timeout=TimeoutWithEqual(total=5))
- mock_pool.expect_request('POST', HOST + '/pet',
+ mock_pool.expect_request('POST', 'http://localhost/v2/pet',
body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
headers={'Content-Type': 'application/json',
'Authorization': 'Bearer ACCESS_TOKEN',
@@ -121,33 +163,9 @@ def test_timeout(self):
self.pet_api.add_pet(self.pet, _request_timeout=5)
self.pet_api.add_pet(self.pet, _request_timeout=(1, 2))
- def test_auth_settings(self):
- mock_pool = MockPoolManager(self)
- self.api_client.rest_client.pool_manager = mock_pool
-
- mock_pool.expect_request('POST', HOST + '/pet',
- body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
- headers={'Content-Type': 'application/json',
- 'Authorization': 'Bearer ACCESS_TOKEN',
- 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
- preload_content=True, timeout=None)
- mock_pool.expect_request('POST', HOST + '/pet',
- body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
- headers={'Content-Type': 'application/json',
- 'Authorization': 'Prefix ANOTHER_TOKEN',
- 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
- preload_content=True, timeout=None)
-
- self.pet_api.add_pet(self.pet, _request_auth=None)
- self.pet_api.add_pet(self.pet, _request_auth={
- 'in': 'header',
- 'key': 'Authorization',
- 'value': 'Prefix ANOTHER_TOKEN'
- })
-
def test_separate_default_client_instances(self):
- pet_api = petstore_api.PetApi()
- pet_api2 = petstore_api.PetApi()
+ pet_api = PetApi()
+ pet_api2 = PetApi()
self.assertNotEqual(pet_api.api_client, pet_api2.api_client)
pet_api.api_client.user_agent = 'api client 3'
@@ -156,8 +174,8 @@ def test_separate_default_client_instances(self):
self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent)
def test_separate_default_config_instances(self):
- pet_api = petstore_api.PetApi()
- pet_api2 = petstore_api.PetApi()
+ pet_api = PetApi()
+ pet_api2 = PetApi()
self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration)
pet_api.api_client.configuration.host = 'somehost'
@@ -171,7 +189,7 @@ def test_async_request(self):
thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
result = thread.get()
- self.assertIsInstance(result, petstore_api.Pet)
+ self.assertIsInstance(result, pet.Pet)
def test_async_with_result(self):
self.pet_api.add_pet(self.pet, async_req=False)
@@ -188,16 +206,17 @@ def test_async_with_result(self):
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_req=True)
+ thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True,
+ _return_http_data_only=False)
data, status, headers = thread.get()
- self.assertIsInstance(data, petstore_api.Pet)
+ self.assertIsInstance(data, pet.Pet)
self.assertEqual(status, 200)
def test_async_exception(self):
self.pet_api.add_pet(self.pet)
- thread = self.pet_api.get_pet_by_id("-9999999999999", async_req=True)
+ thread = self.pet_api.get_pet_by_id(-9999999999999, async_req=True)
exception = None
try:
@@ -220,7 +239,10 @@ def test_add_pet_and_get_pet_by_id(self):
def test_add_pet_and_get_pet_by_id_with_http_info(self):
self.pet_api.add_pet(self.pet)
- fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id)
+ fetched = self.pet_api.get_pet_by_id(
+ pet_id=self.pet.id,
+ _return_http_data_only=False
+ )
self.assertIsNotNone(fetched)
self.assertEqual(self.pet.id, fetched[0].id)
self.assertIsNotNone(fetched[0].category)
@@ -267,21 +289,108 @@ def test_update_pet_with_form(self):
def test_upload_file(self):
# upload file with form parameter
+ file_path1 = os.path.join(self.test_file_dir, "1px_pic1.png")
+ file_path2 = os.path.join(self.test_file_dir, "1px_pic2.png")
try:
+ file = open(file_path1, "rb")
additional_metadata = "special"
self.pet_api.upload_file(
pet_id=self.pet.id,
additional_metadata=additional_metadata,
- file=self.foo
+ file=file
)
except ApiException as e:
self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+ finally:
+ file.close()
+
+ # upload only one file
+ try:
+ file = open(file_path1, "rb")
+ self.pet_api.upload_file(pet_id=self.pet.id, file=file)
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+ finally:
+ file.close()
- # upload only file
+ # upload multiple files
+ HTTPResponse = namedtuple(
+ 'urllib3_response_HTTPResponse',
+ ['status', 'reason', 'data', 'getheaders', 'getheader']
+ )
+ headers = {}
+ def get_headers():
+ return headers
+ def get_header(name, default=None):
+ return headers.get(name, default)
+ api_respponse = {
+ 'code': 200,
+ 'type': 'blah',
+ 'message': 'file upload succeeded'
+ }
+ http_response = HTTPResponse(
+ status=200,
+ reason='OK',
+ data=json.dumps(api_respponse).encode('utf-8'),
+ getheaders=get_headers,
+ getheader=get_header
+ )
+ mock_response = RESTResponse(http_response)
try:
- self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo)
+ file1 = open(file_path1, "rb")
+ file2 = open(file_path2, "rb")
+ with patch.object(RESTClientObject, 'request') as mock_method:
+ mock_method.return_value = mock_response
+ res = self.pet_api.upload_file(
+ pet_id=684696917, files=[file1, file2])
+ mock_method.assert_called_with(
+ 'POST',
+ 'http://localhost/v2/pet/684696917/uploadImage',
+ _preload_content=True,
+ _request_timeout=None,
+ body=None,
+ headers={
+ 'Accept': 'application/json',
+ 'Content-Type': 'multipart/form-data',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python',
+ 'Authorization': 'Bearer ACCESS_TOKEN'
+ },
+ post_params=[
+ ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')),
+ ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png'))
+ ],
+ query_params=[]
+ )
except ApiException as e:
self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+ finally:
+ file1.close()
+ file2.close()
+
+ # passing in an array of files to when file only allows one
+ # raises an exceptions
+ try:
+ file = open(file_path1, "rb")
+ with self.assertRaises(ApiTypeError) as exc:
+ self.pet_api.upload_file(pet_id=self.pet.id, file=[file])
+ finally:
+ file.close()
+
+ # passing in a single file when an array of file is required
+ # raises an exception
+ try:
+ file = open(file_path1, "rb")
+ with self.assertRaises(ApiTypeError) as exc:
+ self.pet_api.upload_file(pet_id=self.pet.id, files=file)
+ finally:
+ file.close()
+
+ # passing in a closed file raises an exception
+ with self.assertRaises(ApiValueError) as exc:
+ file = open(file_path1, "rb")
+ file.close()
+ self.pet_api.upload_file(pet_id=self.pet.id, file=file)
+
def test_delete_pet(self):
self.pet_api.add_pet(self.pet)
diff --git a/samples/client/petstore/python-experimental/tests/test_serialization.py b/samples/client/petstore/python/tests/test_serialization.py
similarity index 100%
rename from samples/client/petstore/python-experimental/tests/test_serialization.py
rename to samples/client/petstore/python/tests/test_serialization.py
diff --git a/samples/client/petstore/python/tests/test_store_api.py b/samples/client/petstore/python/tests/test_store_api.py
index 1817477aba69..a7c1d5dd6670 100644
--- a/samples/client/petstore/python/tests/test_store_api.py
+++ b/samples/client/petstore/python/tests/test_store_api.py
@@ -14,13 +14,13 @@
import unittest
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api.store_api import StoreApi
class StoreApiTests(unittest.TestCase):
def setUp(self):
- self.store_api = petstore_api.StoreApi()
+ self.store_api = StoreApi()
def tearDown(self):
# sleep 1 sec between two every 2 tests
diff --git a/samples/client/petstore/python/tox.ini b/samples/client/petstore/python/tox.ini
index 169d895329bf..8989fc3c4d96 100644
--- a/samples/client/petstore/python/tox.ini
+++ b/samples/client/petstore/python/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27, py3
+envlist = py3
[testenv]
deps=-r{toxinidir}/requirements.txt
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitignore b/samples/openapi3/client/extensions/x-auth-id-alias/python/.gitignore
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/.gitignore
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/.gitignore
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python/.gitlab-ci.yml
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/.gitlab-ci.yml
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator-ignore
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator-ignore
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator-ignore
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/FILES
similarity index 93%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator/FILES
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/FILES
index 93cf0c21cbdb..f34e06f86efc 100644
--- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator/FILES
+++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/FILES
@@ -17,7 +17,7 @@ x_auth_id_alias/api_client.py
x_auth_id_alias/apis/__init__.py
x_auth_id_alias/configuration.py
x_auth_id_alias/exceptions.py
-x_auth_id_alias/model/__init__.py
x_auth_id_alias/model_utils.py
x_auth_id_alias/models/__init__.py
+x_auth_id_alias/models/__init__.py
x_auth_id_alias/rest.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.openapi-generator/VERSION
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python/.travis.yml
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/.travis.yml
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md
similarity index 99%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/README.md
index 9fa46ab7a8a7..59be57aa45af 100644
--- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md
+++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md
@@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen
+- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/python/docs/UsageApi.md
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/docs/UsageApi.md
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/git_push.sh b/samples/openapi3/client/extensions/x-auth-id-alias/python/git_push.sh
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/git_push.sh
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/git_push.sh
diff --git a/samples/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python/requirements.txt
similarity index 100%
rename from samples/client/petstore/python-experimental/requirements.txt
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/requirements.txt
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.cfg b/samples/openapi3/client/extensions/x-auth-id-alias/python/setup.cfg
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.cfg
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/setup.cfg
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/setup.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/setup.py
diff --git a/samples/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python/test-requirements.txt
similarity index 100%
rename from samples/client/petstore/python-experimental/test-requirements.txt
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/test-requirements.txt
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/test/__init__.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/test/__init__.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/test/__init__.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/test/test_usage_api.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/test/test_usage_api.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/tests/test_api_keys.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/tests/test_api_keys.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini b/samples/openapi3/client/extensions/x-auth-id-alias/python/tox.ini
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/tox.ini
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/__init__.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/__init__.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/__init__.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/__init__.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/apis/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/apis/__init__.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/apis/__init__.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/apis/__init__.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/configuration.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/configuration.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/exceptions.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/exceptions.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model/__init__.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/models/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/models/__init__.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/models/__init__.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/models/__init__.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py
rename to samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt b/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt
deleted file mode 100644
index 2d88b0341921..000000000000
--- a/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-pytest~=4.6.7 # needed for python 3.4
-pytest-cov>=2.8.1
-pytest-randomly==1.2.3 # needed for python 3.4
diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/features/dynamic-servers/python/.gitignore
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/.gitignore
rename to samples/openapi3/client/features/dynamic-servers/python/.gitignore
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/features/dynamic-servers/python/.gitlab-ci.yml
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml
rename to samples/openapi3/client/features/dynamic-servers/python/.gitlab-ci.yml
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator-ignore
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator-ignore
rename to samples/openapi3/client/features/dynamic-servers/python/.openapi-generator-ignore
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES
similarity index 93%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator/FILES
rename to samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES
index e9b184541660..f6a48cd1c183 100644
--- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator/FILES
+++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES
@@ -10,9 +10,9 @@ dynamic_servers/api_client.py
dynamic_servers/apis/__init__.py
dynamic_servers/configuration.py
dynamic_servers/exceptions.py
-dynamic_servers/model/__init__.py
dynamic_servers/model_utils.py
dynamic_servers/models/__init__.py
+dynamic_servers/models/__init__.py
dynamic_servers/rest.py
git_push.sh
requirements.txt
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/.openapi-generator/VERSION
rename to samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml b/samples/openapi3/client/features/dynamic-servers/python/.travis.yml
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml
rename to samples/openapi3/client/features/dynamic-servers/python/.travis.yml
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md b/samples/openapi3/client/features/dynamic-servers/python/README.md
similarity index 99%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/README.md
rename to samples/openapi3/client/features/dynamic-servers/python/README.md
index 0d9236bd2203..cdc065ee8a22 100644
--- a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md
+++ b/samples/openapi3/client/features/dynamic-servers/python/README.md
@@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen
+- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md b/samples/openapi3/client/features/dynamic-servers/python/docs/UsageApi.md
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md
rename to samples/openapi3/client/features/dynamic-servers/python/docs/UsageApi.md
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/__init__.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/__init__.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/__init__.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/__init__.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/apis/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/__init__.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/apis/__init__.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/__init__.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/configuration.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/configuration.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/exceptions.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/exceptions.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model/__init__.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model/__init__.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model/__init__.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/models/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/models/__init__.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/models/__init__.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/models/__init__.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py
rename to samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/git_push.sh b/samples/openapi3/client/features/dynamic-servers/python/git_push.sh
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/git_push.sh
rename to samples/openapi3/client/features/dynamic-servers/python/git_push.sh
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt b/samples/openapi3/client/features/dynamic-servers/python/requirements.txt
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt
rename to samples/openapi3/client/features/dynamic-servers/python/requirements.txt
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.cfg b/samples/openapi3/client/features/dynamic-servers/python/setup.cfg
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/setup.cfg
rename to samples/openapi3/client/features/dynamic-servers/python/setup.cfg
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py b/samples/openapi3/client/features/dynamic-servers/python/setup.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py
rename to samples/openapi3/client/features/dynamic-servers/python/setup.py
diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt b/samples/openapi3/client/features/dynamic-servers/python/test-requirements.txt
similarity index 100%
rename from samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt
rename to samples/openapi3/client/features/dynamic-servers/python/test-requirements.txt
diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/test/__init__.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/__init__.py
rename to samples/openapi3/client/features/dynamic-servers/python/test/__init__.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_usage_api.py
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py
rename to samples/openapi3/client/features/dynamic-servers/python/test/test_usage_api.py
diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini b/samples/openapi3/client/features/dynamic-servers/python/tox.ini
similarity index 100%
rename from samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini
rename to samples/openapi3/client/features/dynamic-servers/python/tox.ini
diff --git a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml
deleted file mode 100644
index 611e425676ee..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-# ref: https://docs.gitlab.com/ee/ci/README.html
-
-stages:
- - test
-
-.tests:
- stage: test
- script:
- - pip install -r requirements.txt
- - pip install -r test-requirements.txt
- - pytest --cov=petstore_api
-
-test-3.5:
- extends: .tests
- image: python:3.5-alpine
-test-3.6:
- extends: .tests
- image: python:3.6-alpine
-test-3.7:
- extends: .tests
- image: python:3.7-alpine
-test-3.8:
- extends: .tests
- image: python:3.8-alpine
diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES
deleted file mode 100644
index af91f257f617..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES
+++ /dev/null
@@ -1,218 +0,0 @@
-.gitignore
-.gitlab-ci.yml
-.travis.yml
-README.md
-docs/AdditionalPropertiesClass.md
-docs/AdditionalPropertiesWithArrayOfEnums.md
-docs/Address.md
-docs/Animal.md
-docs/AnimalFarm.md
-docs/AnotherFakeApi.md
-docs/ApiResponse.md
-docs/Apple.md
-docs/AppleReq.md
-docs/ArrayOfArrayOfNumberOnly.md
-docs/ArrayOfEnums.md
-docs/ArrayOfNumberOnly.md
-docs/ArrayTest.md
-docs/Banana.md
-docs/BananaReq.md
-docs/BasquePig.md
-docs/Capitalization.md
-docs/Cat.md
-docs/CatAllOf.md
-docs/Category.md
-docs/ChildCat.md
-docs/ChildCatAllOf.md
-docs/ClassModel.md
-docs/Client.md
-docs/ComplexQuadrilateral.md
-docs/ComposedOneOfNumberWithValidations.md
-docs/DanishPig.md
-docs/DefaultApi.md
-docs/Dog.md
-docs/DogAllOf.md
-docs/Drawing.md
-docs/EnumArrays.md
-docs/EnumClass.md
-docs/EnumTest.md
-docs/EquilateralTriangle.md
-docs/FakeApi.md
-docs/FakeClassnameTags123Api.md
-docs/File.md
-docs/FileSchemaTestClass.md
-docs/Foo.md
-docs/FormatTest.md
-docs/Fruit.md
-docs/FruitReq.md
-docs/GmFruit.md
-docs/GrandparentAnimal.md
-docs/HasOnlyReadOnly.md
-docs/HealthCheckResult.md
-docs/InlineObject.md
-docs/InlineObject1.md
-docs/InlineObject2.md
-docs/InlineObject3.md
-docs/InlineObject4.md
-docs/InlineObject5.md
-docs/InlineResponseDefault.md
-docs/IntegerEnum.md
-docs/IntegerEnumOneValue.md
-docs/IntegerEnumWithDefaultValue.md
-docs/IsoscelesTriangle.md
-docs/List.md
-docs/Mammal.md
-docs/MapTest.md
-docs/MixedPropertiesAndAdditionalPropertiesClass.md
-docs/Model200Response.md
-docs/ModelReturn.md
-docs/Name.md
-docs/NullableClass.md
-docs/NullableShape.md
-docs/NumberOnly.md
-docs/NumberWithValidations.md
-docs/ObjectInterface.md
-docs/ObjectModelWithRefProps.md
-docs/ObjectWithValidations.md
-docs/Order.md
-docs/ParentPet.md
-docs/Pet.md
-docs/PetApi.md
-docs/Pig.md
-docs/Quadrilateral.md
-docs/QuadrilateralInterface.md
-docs/ReadOnlyFirst.md
-docs/ScaleneTriangle.md
-docs/Shape.md
-docs/ShapeInterface.md
-docs/ShapeOrNull.md
-docs/SimpleQuadrilateral.md
-docs/SomeObject.md
-docs/SpecialModelName.md
-docs/StoreApi.md
-docs/StringBooleanMap.md
-docs/StringEnum.md
-docs/StringEnumWithDefaultValue.md
-docs/Tag.md
-docs/Triangle.md
-docs/TriangleInterface.md
-docs/User.md
-docs/UserApi.md
-docs/Whale.md
-docs/Zebra.md
-git_push.sh
-petstore_api/__init__.py
-petstore_api/api/__init__.py
-petstore_api/api/another_fake_api.py
-petstore_api/api/default_api.py
-petstore_api/api/fake_api.py
-petstore_api/api/fake_classname_tags_123_api.py
-petstore_api/api/pet_api.py
-petstore_api/api/store_api.py
-petstore_api/api/user_api.py
-petstore_api/api_client.py
-petstore_api/apis/__init__.py
-petstore_api/configuration.py
-petstore_api/exceptions.py
-petstore_api/model/__init__.py
-petstore_api/model/additional_properties_class.py
-petstore_api/model/additional_properties_with_array_of_enums.py
-petstore_api/model/address.py
-petstore_api/model/animal.py
-petstore_api/model/animal_farm.py
-petstore_api/model/api_response.py
-petstore_api/model/apple.py
-petstore_api/model/apple_req.py
-petstore_api/model/array_of_array_of_number_only.py
-petstore_api/model/array_of_enums.py
-petstore_api/model/array_of_number_only.py
-petstore_api/model/array_test.py
-petstore_api/model/banana.py
-petstore_api/model/banana_req.py
-petstore_api/model/basque_pig.py
-petstore_api/model/capitalization.py
-petstore_api/model/cat.py
-petstore_api/model/cat_all_of.py
-petstore_api/model/category.py
-petstore_api/model/child_cat.py
-petstore_api/model/child_cat_all_of.py
-petstore_api/model/class_model.py
-petstore_api/model/client.py
-petstore_api/model/complex_quadrilateral.py
-petstore_api/model/composed_one_of_number_with_validations.py
-petstore_api/model/danish_pig.py
-petstore_api/model/dog.py
-petstore_api/model/dog_all_of.py
-petstore_api/model/drawing.py
-petstore_api/model/enum_arrays.py
-petstore_api/model/enum_class.py
-petstore_api/model/enum_test.py
-petstore_api/model/equilateral_triangle.py
-petstore_api/model/file.py
-petstore_api/model/file_schema_test_class.py
-petstore_api/model/foo.py
-petstore_api/model/format_test.py
-petstore_api/model/fruit.py
-petstore_api/model/fruit_req.py
-petstore_api/model/gm_fruit.py
-petstore_api/model/grandparent_animal.py
-petstore_api/model/has_only_read_only.py
-petstore_api/model/health_check_result.py
-petstore_api/model/inline_object.py
-petstore_api/model/inline_object1.py
-petstore_api/model/inline_object2.py
-petstore_api/model/inline_object3.py
-petstore_api/model/inline_object4.py
-petstore_api/model/inline_object5.py
-petstore_api/model/inline_response_default.py
-petstore_api/model/integer_enum.py
-petstore_api/model/integer_enum_one_value.py
-petstore_api/model/integer_enum_with_default_value.py
-petstore_api/model/isosceles_triangle.py
-petstore_api/model/list.py
-petstore_api/model/mammal.py
-petstore_api/model/map_test.py
-petstore_api/model/mixed_properties_and_additional_properties_class.py
-petstore_api/model/model200_response.py
-petstore_api/model/model_return.py
-petstore_api/model/name.py
-petstore_api/model/nullable_class.py
-petstore_api/model/nullable_shape.py
-petstore_api/model/number_only.py
-petstore_api/model/number_with_validations.py
-petstore_api/model/object_interface.py
-petstore_api/model/object_model_with_ref_props.py
-petstore_api/model/object_with_validations.py
-petstore_api/model/order.py
-petstore_api/model/parent_pet.py
-petstore_api/model/pet.py
-petstore_api/model/pig.py
-petstore_api/model/quadrilateral.py
-petstore_api/model/quadrilateral_interface.py
-petstore_api/model/read_only_first.py
-petstore_api/model/scalene_triangle.py
-petstore_api/model/shape.py
-petstore_api/model/shape_interface.py
-petstore_api/model/shape_or_null.py
-petstore_api/model/simple_quadrilateral.py
-petstore_api/model/some_object.py
-petstore_api/model/special_model_name.py
-petstore_api/model/string_boolean_map.py
-petstore_api/model/string_enum.py
-petstore_api/model/string_enum_with_default_value.py
-petstore_api/model/tag.py
-petstore_api/model/triangle.py
-petstore_api/model/triangle_interface.py
-petstore_api/model/user.py
-petstore_api/model/whale.py
-petstore_api/model/zebra.py
-petstore_api/model_utils.py
-petstore_api/models/__init__.py
-petstore_api/rest.py
-petstore_api/signing.py
-requirements.txt
-setup.cfg
-setup.py
-test-requirements.txt
-test/__init__.py
-tox.ini
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md
deleted file mode 100644
index e54a02329f1b..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# AdditionalPropertiesClass
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**map_property** | **{str: (str,)}** | | [optional]
-**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional]
-**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**map_with_undeclared_properties_anytype_1** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
-**map_with_undeclared_properties_anytype_2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
-**map_with_undeclared_properties_anytype_3** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
-**empty_map** | **bool, date, datetime, dict, float, int, list, str** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional]
-**map_with_undeclared_properties_string** | **{str: (str,)}** | | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md
deleted file mode 100644
index 86f6c0e11dcf..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Cat
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**class_name** | **str** | |
-**declawed** | **bool** | | [optional]
-**color** | **str** | | [optional] if omitted the server will use the default value of "red"
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md
deleted file mode 100644
index fa9568060923..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Dog
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**class_name** | **str** | |
-**breed** | **str** | | [optional]
-**color** | **str** | | [optional] if omitted the server will use the default value of "red"
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md
deleted file mode 100644
index 6dda7fd8a77f..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# EnumClass
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md
deleted file mode 100644
index 70969239ca25..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# EnumTest
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**enum_string_required** | **str** | |
-**enum_string** | **str** | | [optional]
-**enum_integer** | **int** | | [optional]
-**enum_number** | **float** | | [optional]
-**string_enum** | [**StringEnum**](StringEnum.md) | | [optional]
-**integer_enum** | [**IntegerEnum**](IntegerEnum.md) | | [optional]
-**string_enum_with_default_value** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional]
-**integer_enum_with_default_value** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional]
-**integer_enum_one_value** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md
deleted file mode 100644
index ad561b7220bf..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# MapTest
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional]
-**map_of_enum_string** | **{str: (str,)}** | | [optional]
-**direct_map** | **{str: (bool,)}** | | [optional]
-**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md
deleted file mode 100644
index 0789eb8ad1a4..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# NullableClass
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**integer_prop** | **int, none_type** | | [optional]
-**number_prop** | **float, none_type** | | [optional]
-**boolean_prop** | **bool, none_type** | | [optional]
-**string_prop** | **str, none_type** | | [optional]
-**date_prop** | **date, none_type** | | [optional]
-**datetime_prop** | **datetime, none_type** | | [optional]
-**array_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | | [optional]
-**array_and_items_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type** | | [optional]
-**array_items_nullable** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]** | | [optional]
-**object_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type** | | [optional]
-**object_and_items_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type** | | [optional]
-**object_items_nullable** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}** | | [optional]
-**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | any string name can be used but the value must be the correct type | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md
deleted file mode 100644
index 21323c72c953..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md
+++ /dev/null
@@ -1,997 +0,0 @@
-# petstore_api.PetApi
-
-All URIs are relative to *http://petstore.swagger.io:80/v2*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
-[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
-[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
-[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
-[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
-[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
-[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
-[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
-[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
-
-
-# **add_pet**
-> add_pet(pet)
-
-Add a new pet to the store
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure HTTP message signature: http_signature_test
-# The HTTP Signature Header mechanism that can be used by a client to
-# authenticate the sender of a message and ensure that particular headers
-# have not been modified in transit.
-#
-# You can specify the signing key-id, private key path, signing scheme,
-# signing algorithm, list of signed headers and signature max validity.
-# The 'key_id' parameter is an opaque string that the API server can use
-# to lookup the client and validate the signature.
-# The 'private_key_path' parameter should be the path to a file that
-# contains a DER or base-64 encoded private key.
-# The 'private_key_passphrase' parameter is optional. Set the passphrase
-# if the private key is encrypted.
-# The 'signed_headers' parameter is used to specify the list of
-# HTTP headers included when generating the signature for the message.
-# You can specify HTTP headers that you want to protect with a cryptographic
-# signature. Note that proxies may add, modify or remove HTTP headers
-# for legitimate reasons, so you should only add headers that you know
-# will not be modified. For example, if you want to protect the HTTP request
-# body, you can specify the Digest header. In that case, the client calculates
-# the digest of the HTTP request body and includes the digest in the message
-# signature.
-# The 'signature_max_validity' parameter is optional. It is configured as a
-# duration to express when the signature ceases to be valid. The client calculates
-# the expiration date every time it generates the cryptographic signature
-# of an HTTP request. The API server may have its own security policy
-# that controls the maximum validity of the signature. The client max validity
-# must be lower than the server max validity.
-# The time on the client and server must be synchronized, otherwise the
-# server may reject the client signature.
-#
-# The client must use a combination of private key, signing scheme,
-# signing algorithm and hash algorithm that matches the security policy of
-# the API server.
-#
-# See petstore_api.signing for a list of all supported parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2",
- signing_info = petstore_api.signing.HttpSigningConfiguration(
- key_id = 'my-key-id',
- private_key_path = 'private_key.pem',
- private_key_passphrase = 'YOUR_PASSPHRASE',
- signing_scheme = petstore_api.signing.SCHEME_HS2019,
- signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
- hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
- signed_headers = [
- petstore_api.signing.HEADER_REQUEST_TARGET,
- petstore_api.signing.HEADER_CREATED,
- petstore_api.signing.HEADER_EXPIRES,
- petstore_api.signing.HEADER_HOST,
- petstore_api.signing.HEADER_DATE,
- petstore_api.signing.HEADER_DIGEST,
- 'Content-Type',
- 'Content-Length',
- 'User-Agent'
- ],
- signature_max_validity = datetime.timedelta(minutes=5)
- )
-)
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet = Pet(
- id=1,
- category=Category(
- id=1,
- name="default-name",
- ),
- name="doggie",
- photo_urls=[
- "photo_urls_example",
- ],
- tags=[
- Tag(
- id=1,
- name="name_example",
- ),
- ],
- status="available",
- ) # Pet | Pet object that needs to be added to the store
-
- # example passing only required values which don't have defaults set
- try:
- # Add a new pet to the store
- api_instance.add_pet(pet)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->add_pet: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: application/json, application/xml
- - **Accept**: Not defined
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**405** | Invalid input | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **delete_pet**
-> delete_pet(pet_id)
-
-Deletes a pet
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | Pet id to delete
- api_key = "api_key_example" # str | (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Deletes a pet
- api_instance.delete_pet(pet_id)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->delete_pet: %s\n" % e)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- # Deletes a pet
- api_instance.delete_pet(pet_id, api_key=api_key)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->delete_pet: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| Pet id to delete |
- **api_key** | **str**| | [optional]
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: Not defined
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**400** | Invalid pet value | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **find_pets_by_status**
-> [Pet] find_pets_by_status(status)
-
-Finds Pets by status
-
-Multiple status values can be provided with comma separated strings
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure HTTP message signature: http_signature_test
-# The HTTP Signature Header mechanism that can be used by a client to
-# authenticate the sender of a message and ensure that particular headers
-# have not been modified in transit.
-#
-# You can specify the signing key-id, private key path, signing scheme,
-# signing algorithm, list of signed headers and signature max validity.
-# The 'key_id' parameter is an opaque string that the API server can use
-# to lookup the client and validate the signature.
-# The 'private_key_path' parameter should be the path to a file that
-# contains a DER or base-64 encoded private key.
-# The 'private_key_passphrase' parameter is optional. Set the passphrase
-# if the private key is encrypted.
-# The 'signed_headers' parameter is used to specify the list of
-# HTTP headers included when generating the signature for the message.
-# You can specify HTTP headers that you want to protect with a cryptographic
-# signature. Note that proxies may add, modify or remove HTTP headers
-# for legitimate reasons, so you should only add headers that you know
-# will not be modified. For example, if you want to protect the HTTP request
-# body, you can specify the Digest header. In that case, the client calculates
-# the digest of the HTTP request body and includes the digest in the message
-# signature.
-# The 'signature_max_validity' parameter is optional. It is configured as a
-# duration to express when the signature ceases to be valid. The client calculates
-# the expiration date every time it generates the cryptographic signature
-# of an HTTP request. The API server may have its own security policy
-# that controls the maximum validity of the signature. The client max validity
-# must be lower than the server max validity.
-# The time on the client and server must be synchronized, otherwise the
-# server may reject the client signature.
-#
-# The client must use a combination of private key, signing scheme,
-# signing algorithm and hash algorithm that matches the security policy of
-# the API server.
-#
-# See petstore_api.signing for a list of all supported parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2",
- signing_info = petstore_api.signing.HttpSigningConfiguration(
- key_id = 'my-key-id',
- private_key_path = 'private_key.pem',
- private_key_passphrase = 'YOUR_PASSPHRASE',
- signing_scheme = petstore_api.signing.SCHEME_HS2019,
- signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
- hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
- signed_headers = [
- petstore_api.signing.HEADER_REQUEST_TARGET,
- petstore_api.signing.HEADER_CREATED,
- petstore_api.signing.HEADER_EXPIRES,
- petstore_api.signing.HEADER_HOST,
- petstore_api.signing.HEADER_DATE,
- petstore_api.signing.HEADER_DIGEST,
- 'Content-Type',
- 'Content-Length',
- 'User-Agent'
- ],
- signature_max_validity = datetime.timedelta(minutes=5)
- )
-)
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- status = [
- "available",
- ] # [str] | Status values that need to be considered for filter
-
- # example passing only required values which don't have defaults set
- try:
- # Finds Pets by status
- api_response = api_instance.find_pets_by_status(status)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **status** | **[str]**| Status values that need to be considered for filter |
-
-### Return type
-
-[**[Pet]**](Pet.md)
-
-### Authorization
-
-[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/xml, application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | successful operation | - |
-**400** | Invalid status value | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **find_pets_by_tags**
-> [Pet] find_pets_by_tags(tags)
-
-Finds Pets by tags
-
-Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure HTTP message signature: http_signature_test
-# The HTTP Signature Header mechanism that can be used by a client to
-# authenticate the sender of a message and ensure that particular headers
-# have not been modified in transit.
-#
-# You can specify the signing key-id, private key path, signing scheme,
-# signing algorithm, list of signed headers and signature max validity.
-# The 'key_id' parameter is an opaque string that the API server can use
-# to lookup the client and validate the signature.
-# The 'private_key_path' parameter should be the path to a file that
-# contains a DER or base-64 encoded private key.
-# The 'private_key_passphrase' parameter is optional. Set the passphrase
-# if the private key is encrypted.
-# The 'signed_headers' parameter is used to specify the list of
-# HTTP headers included when generating the signature for the message.
-# You can specify HTTP headers that you want to protect with a cryptographic
-# signature. Note that proxies may add, modify or remove HTTP headers
-# for legitimate reasons, so you should only add headers that you know
-# will not be modified. For example, if you want to protect the HTTP request
-# body, you can specify the Digest header. In that case, the client calculates
-# the digest of the HTTP request body and includes the digest in the message
-# signature.
-# The 'signature_max_validity' parameter is optional. It is configured as a
-# duration to express when the signature ceases to be valid. The client calculates
-# the expiration date every time it generates the cryptographic signature
-# of an HTTP request. The API server may have its own security policy
-# that controls the maximum validity of the signature. The client max validity
-# must be lower than the server max validity.
-# The time on the client and server must be synchronized, otherwise the
-# server may reject the client signature.
-#
-# The client must use a combination of private key, signing scheme,
-# signing algorithm and hash algorithm that matches the security policy of
-# the API server.
-#
-# See petstore_api.signing for a list of all supported parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2",
- signing_info = petstore_api.signing.HttpSigningConfiguration(
- key_id = 'my-key-id',
- private_key_path = 'private_key.pem',
- private_key_passphrase = 'YOUR_PASSPHRASE',
- signing_scheme = petstore_api.signing.SCHEME_HS2019,
- signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
- hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
- signed_headers = [
- petstore_api.signing.HEADER_REQUEST_TARGET,
- petstore_api.signing.HEADER_CREATED,
- petstore_api.signing.HEADER_EXPIRES,
- petstore_api.signing.HEADER_HOST,
- petstore_api.signing.HEADER_DATE,
- petstore_api.signing.HEADER_DIGEST,
- 'Content-Type',
- 'Content-Length',
- 'User-Agent'
- ],
- signature_max_validity = datetime.timedelta(minutes=5)
- )
-)
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- tags = [
- "tags_example",
- ] # [str] | Tags to filter by
-
- # example passing only required values which don't have defaults set
- try:
- # Finds Pets by tags
- api_response = api_instance.find_pets_by_tags(tags)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **tags** | **[str]**| Tags to filter by |
-
-### Return type
-
-[**[Pet]**](Pet.md)
-
-### Authorization
-
-[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/xml, application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | successful operation | - |
-**400** | Invalid tag value | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **get_pet_by_id**
-> Pet get_pet_by_id(pet_id)
-
-Find pet by ID
-
-Returns a single pet
-
-### Example
-
-* Api Key Authentication (api_key):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure API key authorization: api_key
-configuration.api_key['api_key'] = 'YOUR_API_KEY'
-
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['api_key'] = 'Bearer'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet to return
-
- # example passing only required values which don't have defaults set
- try:
- # Find pet by ID
- api_response = api_instance.get_pet_by_id(pet_id)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to return |
-
-### Return type
-
-[**Pet**](Pet.md)
-
-### Authorization
-
-[api_key](../README.md#api_key)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/xml, application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | successful operation | - |
-**400** | Invalid ID supplied | - |
-**404** | Pet not found | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **update_pet**
-> update_pet(pet)
-
-Update an existing pet
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.pet import Pet
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure HTTP message signature: http_signature_test
-# The HTTP Signature Header mechanism that can be used by a client to
-# authenticate the sender of a message and ensure that particular headers
-# have not been modified in transit.
-#
-# You can specify the signing key-id, private key path, signing scheme,
-# signing algorithm, list of signed headers and signature max validity.
-# The 'key_id' parameter is an opaque string that the API server can use
-# to lookup the client and validate the signature.
-# The 'private_key_path' parameter should be the path to a file that
-# contains a DER or base-64 encoded private key.
-# The 'private_key_passphrase' parameter is optional. Set the passphrase
-# if the private key is encrypted.
-# The 'signed_headers' parameter is used to specify the list of
-# HTTP headers included when generating the signature for the message.
-# You can specify HTTP headers that you want to protect with a cryptographic
-# signature. Note that proxies may add, modify or remove HTTP headers
-# for legitimate reasons, so you should only add headers that you know
-# will not be modified. For example, if you want to protect the HTTP request
-# body, you can specify the Digest header. In that case, the client calculates
-# the digest of the HTTP request body and includes the digest in the message
-# signature.
-# The 'signature_max_validity' parameter is optional. It is configured as a
-# duration to express when the signature ceases to be valid. The client calculates
-# the expiration date every time it generates the cryptographic signature
-# of an HTTP request. The API server may have its own security policy
-# that controls the maximum validity of the signature. The client max validity
-# must be lower than the server max validity.
-# The time on the client and server must be synchronized, otherwise the
-# server may reject the client signature.
-#
-# The client must use a combination of private key, signing scheme,
-# signing algorithm and hash algorithm that matches the security policy of
-# the API server.
-#
-# See petstore_api.signing for a list of all supported parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2",
- signing_info = petstore_api.signing.HttpSigningConfiguration(
- key_id = 'my-key-id',
- private_key_path = 'private_key.pem',
- private_key_passphrase = 'YOUR_PASSPHRASE',
- signing_scheme = petstore_api.signing.SCHEME_HS2019,
- signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
- hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
- signed_headers = [
- petstore_api.signing.HEADER_REQUEST_TARGET,
- petstore_api.signing.HEADER_CREATED,
- petstore_api.signing.HEADER_EXPIRES,
- petstore_api.signing.HEADER_HOST,
- petstore_api.signing.HEADER_DATE,
- petstore_api.signing.HEADER_DIGEST,
- 'Content-Type',
- 'Content-Length',
- 'User-Agent'
- ],
- signature_max_validity = datetime.timedelta(minutes=5)
- )
-)
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet = Pet(
- id=1,
- category=Category(
- id=1,
- name="default-name",
- ),
- name="doggie",
- photo_urls=[
- "photo_urls_example",
- ],
- tags=[
- Tag(
- id=1,
- name="name_example",
- ),
- ],
- status="available",
- ) # Pet | Pet object that needs to be added to the store
-
- # example passing only required values which don't have defaults set
- try:
- # Update an existing pet
- api_instance.update_pet(pet)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->update_pet: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: application/json, application/xml
- - **Accept**: Not defined
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**400** | Invalid ID supplied | - |
-**404** | Pet not found | - |
-**405** | Validation exception | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **update_pet_with_form**
-> update_pet_with_form(pet_id)
-
-Updates a pet in the store with form data
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet that needs to be updated
- name = "name_example" # str | Updated name of the pet (optional)
- status = "status_example" # str | Updated status of the pet (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Updates a pet in the store with form data
- api_instance.update_pet_with_form(pet_id)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- # Updates a pet in the store with form data
- api_instance.update_pet_with_form(pet_id, name=name, status=status)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet that needs to be updated |
- **name** | **str**| Updated name of the pet | [optional]
- **status** | **str**| Updated status of the pet | [optional]
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: application/x-www-form-urlencoded
- - **Accept**: Not defined
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**405** | Invalid input | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **upload_file**
-> ApiResponse upload_file(pet_id)
-
-uploads an image
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.api_response import ApiResponse
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet to update
- additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
- file = open('/path/to/file', 'rb') # file_type | file to upload (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # uploads an image
- api_response = api_instance.upload_file(pet_id)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->upload_file: %s\n" % e)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- # uploads an image
- api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->upload_file: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
- **file** | **file_type**| file to upload | [optional]
-
-### Return type
-
-[**ApiResponse**](ApiResponse.md)
-
-### Authorization
-
-[petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: multipart/form-data
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | successful operation | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, required_file)
-
-uploads an image (required)
-
-### Example
-
-* OAuth Authentication (petstore_auth):
-```python
-import time
-import petstore_api
-from petstore_api.api import pet_api
-from petstore_api.model.api_response import ApiResponse
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure OAuth2 access token for authorization: petstore_auth
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = pet_api.PetApi(api_client)
- pet_id = 1 # int | ID of pet to update
- required_file = open('/path/to/file', 'rb') # file_type | file to upload
- additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # uploads an image (required)
- api_response = api_instance.upload_file_with_required_file(pet_id, required_file)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- # uploads an image (required)
- api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **required_file** | **file_type**| file to upload |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
-
-### Return type
-
-[**ApiResponse**](ApiResponse.md)
-
-### Authorization
-
-[petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: multipart/form-data
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | successful operation | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md
deleted file mode 100644
index 5fc54dce871b..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/docs/User.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# User
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | | [optional]
-**username** | **str** | | [optional]
-**first_name** | **str** | | [optional]
-**last_name** | **str** | | [optional]
-**email** | **str** | | [optional]
-**password** | **str** | | [optional]
-**phone** | **str** | | [optional]
-**user_status** | **int** | User Status | [optional]
-**object_with_no_declared_props** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional]
-**object_with_no_declared_props_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional]
-**any_type_prop** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional]
-**any_type_prop_nullable** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional]
-
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py
deleted file mode 100644
index 1605d7d67c05..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-__version__ = "1.0.0"
-
-# import ApiClient
-from petstore_api.api_client import ApiClient
-
-# import Configuration
-from petstore_api.configuration import Configuration
-from petstore_api.signing import HttpSigningConfiguration
-
-# import exceptions
-from petstore_api.exceptions import OpenApiException
-from petstore_api.exceptions import ApiAttributeError
-from petstore_api.exceptions import ApiTypeError
-from petstore_api.exceptions import ApiValueError
-from petstore_api.exceptions import ApiKeyError
-from petstore_api.exceptions import ApiException
-
-__import__('sys').setrecursionlimit(1234)
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py
deleted file mode 100644
index 840e9f0cd908..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# do not import all apis into this module because that uses a lot of memory and stack frames
-# if you need the ability to import all apis from one package, import them with
-# from petstore_api.apis import AnotherFakeApi
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py
deleted file mode 100644
index af80014fe0cf..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.client import Client
-
-
-class AnotherFakeApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __call_123_test_special_tags(
- self,
- client,
- **kwargs
- ):
- """To test special tags # noqa: E501
-
- To test special tags and operation ID starting with number # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.call_123_test_special_tags(client, async_req=True)
- >>> result = thread.get()
-
- Args:
- client (Client): client model
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Client
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['client'] = \
- client
- return self.call_with_http_info(**kwargs)
-
- self.call_123_test_special_tags = Endpoint(
- settings={
- 'response_type': (Client,),
- 'auth': [],
- 'endpoint_path': '/another-fake/dummy',
- 'operation_id': 'call_123_test_special_tags',
- 'http_method': 'PATCH',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'client',
- ],
- 'required': [
- 'client',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'client':
- (Client,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'client': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__call_123_test_special_tags
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py
deleted file mode 100644
index c64ea731eba0..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py
+++ /dev/null
@@ -1,143 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.inline_response_default import InlineResponseDefault
-
-
-class DefaultApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __foo_get(
- self,
- **kwargs
- ):
- """foo_get # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.foo_get(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- InlineResponseDefault
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.foo_get = Endpoint(
- settings={
- 'response_type': (InlineResponseDefault,),
- 'auth': [],
- 'endpoint_path': '/foo',
- 'operation_id': 'foo_get',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- },
- 'attribute_map': {
- },
- 'location_map': {
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__foo_get
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py
deleted file mode 100644
index 7654e5916de7..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py
+++ /dev/null
@@ -1,2659 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
-from petstore_api.model.animal_farm import AnimalFarm
-from petstore_api.model.array_of_enums import ArrayOfEnums
-from petstore_api.model.client import Client
-from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
-from petstore_api.model.health_check_result import HealthCheckResult
-from petstore_api.model.mammal import Mammal
-from petstore_api.model.number_with_validations import NumberWithValidations
-from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
-from petstore_api.model.string_enum import StringEnum
-from petstore_api.model.user import User
-
-
-class FakeApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __additional_properties_with_array_of_enums(
- self,
- **kwargs
- ):
- """Additional Properties with Array of Enums # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.additional_properties_with_array_of_enums(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- AdditionalPropertiesWithArrayOfEnums
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.additional_properties_with_array_of_enums = Endpoint(
- settings={
- 'response_type': (AdditionalPropertiesWithArrayOfEnums,),
- 'auth': [],
- 'endpoint_path': '/fake/additional-properties-with-array-of-enums',
- 'operation_id': 'additional_properties_with_array_of_enums',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'additional_properties_with_array_of_enums',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'additional_properties_with_array_of_enums':
- (AdditionalPropertiesWithArrayOfEnums,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'additional_properties_with_array_of_enums': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__additional_properties_with_array_of_enums
- )
-
- def __array_model(
- self,
- **kwargs
- ):
- """array_model # noqa: E501
-
- Test serialization of ArrayModel # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.array_model(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (AnimalFarm): Input model. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- AnimalFarm
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.array_model = Endpoint(
- settings={
- 'response_type': (AnimalFarm,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/arraymodel',
- 'operation_id': 'array_model',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (AnimalFarm,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__array_model
- )
-
- def __array_of_enums(
- self,
- **kwargs
- ):
- """Array of Enums # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.array_of_enums(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- array_of_enums (ArrayOfEnums): Input enum. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ArrayOfEnums
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.array_of_enums = Endpoint(
- settings={
- 'response_type': (ArrayOfEnums,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/array-of-enums',
- 'operation_id': 'array_of_enums',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'array_of_enums',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'array_of_enums':
- (ArrayOfEnums,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'array_of_enums': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__array_of_enums
- )
-
- def __boolean(
- self,
- **kwargs
- ):
- """boolean # noqa: E501
-
- 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_req=True
-
- >>> thread = api.boolean(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (bool): Input boolean as post body. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- bool
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.boolean = Endpoint(
- settings={
- 'response_type': (bool,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/boolean',
- 'operation_id': 'boolean',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (bool,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__boolean
- )
-
- def __composed_one_of_number_with_validations(
- self,
- **kwargs
- ):
- """composed_one_of_number_with_validations # noqa: E501
-
- Test serialization of object with $refed properties # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.composed_one_of_number_with_validations(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ComposedOneOfNumberWithValidations
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.composed_one_of_number_with_validations = Endpoint(
- settings={
- 'response_type': (ComposedOneOfNumberWithValidations,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/composed_one_of_number_with_validations',
- 'operation_id': 'composed_one_of_number_with_validations',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'composed_one_of_number_with_validations',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'composed_one_of_number_with_validations':
- (ComposedOneOfNumberWithValidations,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'composed_one_of_number_with_validations': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__composed_one_of_number_with_validations
- )
-
- def __fake_health_get(
- self,
- **kwargs
- ):
- """Health check endpoint # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.fake_health_get(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- HealthCheckResult
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.fake_health_get = Endpoint(
- settings={
- 'response_type': (HealthCheckResult,),
- 'auth': [],
- 'endpoint_path': '/fake/health',
- 'operation_id': 'fake_health_get',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- },
- 'attribute_map': {
- },
- 'location_map': {
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__fake_health_get
- )
-
- def __mammal(
- self,
- mammal,
- **kwargs
- ):
- """mammal # noqa: E501
-
- Test serialization of mammals # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.mammal(mammal, async_req=True)
- >>> result = thread.get()
-
- Args:
- mammal (Mammal): Input mammal
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Mammal
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['mammal'] = \
- mammal
- return self.call_with_http_info(**kwargs)
-
- self.mammal = Endpoint(
- settings={
- 'response_type': (Mammal,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/mammal',
- 'operation_id': 'mammal',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'mammal',
- ],
- 'required': [
- 'mammal',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'mammal':
- (Mammal,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'mammal': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__mammal
- )
-
- def __number_with_validations(
- self,
- **kwargs
- ):
- """number_with_validations # noqa: E501
-
- 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_req=True
-
- >>> thread = api.number_with_validations(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (NumberWithValidations): Input number as post body. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- NumberWithValidations
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.number_with_validations = Endpoint(
- settings={
- 'response_type': (NumberWithValidations,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/number',
- 'operation_id': 'number_with_validations',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (NumberWithValidations,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__number_with_validations
- )
-
- def __object_model_with_ref_props(
- self,
- **kwargs
- ):
- """object_model_with_ref_props # noqa: E501
-
- Test serialization of object with $refed properties # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.object_model_with_ref_props(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (ObjectModelWithRefProps): Input model. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ObjectModelWithRefProps
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.object_model_with_ref_props = Endpoint(
- settings={
- 'response_type': (ObjectModelWithRefProps,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/object_model_with_ref_props',
- 'operation_id': 'object_model_with_ref_props',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (ObjectModelWithRefProps,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__object_model_with_ref_props
- )
-
- def __string(
- self,
- **kwargs
- ):
- """string # noqa: E501
-
- 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_req=True
-
- >>> thread = api.string(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (str): Input string as post body. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- str
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.string = Endpoint(
- settings={
- 'response_type': (str,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/string',
- 'operation_id': 'string',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (str,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__string
- )
-
- def __string_enum(
- self,
- **kwargs
- ):
- """string_enum # noqa: E501
-
- Test serialization of outer enum # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.string_enum(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- body (StringEnum): Input enum. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- StringEnum
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.string_enum = Endpoint(
- settings={
- 'response_type': (StringEnum,),
- 'auth': [],
- 'endpoint_path': '/fake/refs/enum',
- 'operation_id': 'string_enum',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'body',
- ],
- 'required': [],
- 'nullable': [
- 'body',
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'body':
- (StringEnum,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__string_enum
- )
-
- def __test_body_with_file_schema(
- self,
- file_schema_test_class,
- **kwargs
- ):
- """test_body_with_file_schema # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
- >>> result = thread.get()
-
- Args:
- file_schema_test_class (FileSchemaTestClass):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['file_schema_test_class'] = \
- file_schema_test_class
- return self.call_with_http_info(**kwargs)
-
- self.test_body_with_file_schema = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/body-with-file-schema',
- 'operation_id': 'test_body_with_file_schema',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'file_schema_test_class',
- ],
- 'required': [
- 'file_schema_test_class',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'file_schema_test_class':
- (FileSchemaTestClass,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'file_schema_test_class': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_body_with_file_schema
- )
-
- def __test_body_with_query_params(
- self,
- query,
- user,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.test_body_with_query_params(query, user, async_req=True)
- >>> result = thread.get()
-
- Args:
- query (str):
- user (User):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['query'] = \
- query
- kwargs['user'] = \
- user
- return self.call_with_http_info(**kwargs)
-
- self.test_body_with_query_params = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/body-with-query-params',
- 'operation_id': 'test_body_with_query_params',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'query',
- 'user',
- ],
- 'required': [
- 'query',
- 'user',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'query':
- (str,),
- 'user':
- (User,),
- },
- 'attribute_map': {
- 'query': 'query',
- },
- 'location_map': {
- 'query': 'query',
- 'user': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_body_with_query_params
- )
-
- def __test_client_model(
- self,
- client,
- **kwargs
- ):
- """To test \"client\" model # noqa: E501
-
- To test \"client\" model # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_client_model(client, async_req=True)
- >>> result = thread.get()
-
- Args:
- client (Client): client model
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Client
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['client'] = \
- client
- return self.call_with_http_info(**kwargs)
-
- self.test_client_model = Endpoint(
- settings={
- 'response_type': (Client,),
- 'auth': [],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_client_model',
- 'http_method': 'PATCH',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'client',
- ],
- 'required': [
- 'client',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'client':
- (Client,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'client': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_client_model
- )
-
- def __test_endpoint_parameters(
- self,
- number,
- double,
- pattern_without_delimiter,
- byte,
- **kwargs
- ):
- """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
- >>> result = thread.get()
-
- Args:
- number (float): None
- double (float): None
- pattern_without_delimiter (str): None
- byte (str): None
-
- Keyword Args:
- integer (int): None. [optional]
- int32 (int): None. [optional]
- int64 (int): None. [optional]
- float (float): None. [optional]
- string (str): None. [optional]
- binary (file_type): None. [optional]
- date (date): None. [optional]
- date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
- password (str): None. [optional]
- param_callback (str): None. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['number'] = \
- number
- kwargs['double'] = \
- double
- kwargs['pattern_without_delimiter'] = \
- pattern_without_delimiter
- kwargs['byte'] = \
- byte
- return self.call_with_http_info(**kwargs)
-
- self.test_endpoint_parameters = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'http_basic_test'
- ],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_endpoint_parameters',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'byte',
- 'integer',
- 'int32',
- 'int64',
- 'float',
- 'string',
- 'binary',
- 'date',
- 'date_time',
- 'password',
- 'param_callback',
- ],
- 'required': [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'byte',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'integer',
- 'int32',
- 'float',
- 'string',
- 'password',
- ]
- },
- root_map={
- 'validations': {
- ('number',): {
-
- 'inclusive_maximum': 543.2,
- 'inclusive_minimum': 32.1,
- },
- ('double',): {
-
- 'inclusive_maximum': 123.4,
- 'inclusive_minimum': 67.8,
- },
- ('pattern_without_delimiter',): {
-
- 'regex': {
- 'pattern': r'^[A-Z].*', # noqa: E501
- },
- },
- ('integer',): {
-
- 'inclusive_maximum': 100,
- 'inclusive_minimum': 10,
- },
- ('int32',): {
-
- 'inclusive_maximum': 200,
- 'inclusive_minimum': 20,
- },
- ('float',): {
-
- 'inclusive_maximum': 987.6,
- },
- ('string',): {
-
- 'regex': {
- 'pattern': r'[a-z]', # noqa: E501
- 'flags': (re.IGNORECASE)
- },
- },
- ('password',): {
- 'max_length': 64,
- 'min_length': 10,
- },
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'number':
- (float,),
- 'double':
- (float,),
- 'pattern_without_delimiter':
- (str,),
- 'byte':
- (str,),
- 'integer':
- (int,),
- 'int32':
- (int,),
- 'int64':
- (int,),
- 'float':
- (float,),
- 'string':
- (str,),
- 'binary':
- (file_type,),
- 'date':
- (date,),
- 'date_time':
- (datetime,),
- 'password':
- (str,),
- 'param_callback':
- (str,),
- },
- 'attribute_map': {
- 'number': 'number',
- 'double': 'double',
- 'pattern_without_delimiter': 'pattern_without_delimiter',
- 'byte': 'byte',
- 'integer': 'integer',
- 'int32': 'int32',
- 'int64': 'int64',
- 'float': 'float',
- 'string': 'string',
- 'binary': 'binary',
- 'date': 'date',
- 'date_time': 'dateTime',
- 'password': 'password',
- 'param_callback': 'callback',
- },
- 'location_map': {
- 'number': 'form',
- 'double': 'form',
- 'pattern_without_delimiter': 'form',
- 'byte': 'form',
- 'integer': 'form',
- 'int32': 'form',
- 'int64': 'form',
- 'float': 'form',
- 'string': 'form',
- 'binary': 'form',
- 'date': 'form',
- 'date_time': 'form',
- 'password': 'form',
- 'param_callback': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__test_endpoint_parameters
- )
-
- def __test_enum_parameters(
- self,
- **kwargs
- ):
- """To test enum parameters # noqa: E501
-
- To test enum parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_enum_parameters(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- enum_header_string_array ([str]): Header parameter enum test (string array). [optional]
- enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
- enum_query_string_array ([str]): Query parameter enum test (string array). [optional]
- enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
- enum_query_integer (int): Query parameter enum test (double). [optional]
- enum_query_double (float): Query parameter enum test (double). [optional]
- enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$"
- enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.test_enum_parameters = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_enum_parameters',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- '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',
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- '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',
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- ('enum_header_string_array',): {
-
- ">": ">",
- "$": "$"
- },
- ('enum_header_string',): {
-
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- },
- ('enum_query_string_array',): {
-
- ">": ">",
- "$": "$"
- },
- ('enum_query_string',): {
-
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- },
- ('enum_query_integer',): {
-
- "1": 1,
- "-2": -2
- },
- ('enum_query_double',): {
-
- "1.1": 1.1,
- "-1.2": -1.2
- },
- ('enum_form_string_array',): {
-
- ">": ">",
- "$": "$"
- },
- ('enum_form_string',): {
-
- "_ABC": "_abc",
- "-EFG": "-efg",
- "(XYZ)": "(xyz)"
- },
- },
- 'openapi_types': {
- 'enum_header_string_array':
- ([str],),
- 'enum_header_string':
- (str,),
- 'enum_query_string_array':
- ([str],),
- 'enum_query_string':
- (str,),
- 'enum_query_integer':
- (int,),
- 'enum_query_double':
- (float,),
- 'enum_form_string_array':
- ([str],),
- 'enum_form_string':
- (str,),
- },
- 'attribute_map': {
- 'enum_header_string_array': 'enum_header_string_array',
- 'enum_header_string': 'enum_header_string',
- 'enum_query_string_array': 'enum_query_string_array',
- 'enum_query_string': 'enum_query_string',
- 'enum_query_integer': 'enum_query_integer',
- 'enum_query_double': 'enum_query_double',
- 'enum_form_string_array': 'enum_form_string_array',
- 'enum_form_string': 'enum_form_string',
- },
- 'location_map': {
- 'enum_header_string_array': 'header',
- 'enum_header_string': 'header',
- 'enum_query_string_array': 'query',
- 'enum_query_string': 'query',
- 'enum_query_integer': 'query',
- 'enum_query_double': 'query',
- 'enum_form_string_array': 'form',
- 'enum_form_string': 'form',
- },
- 'collection_format_map': {
- 'enum_header_string_array': 'csv',
- 'enum_query_string_array': 'multi',
- 'enum_form_string_array': 'csv',
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__test_enum_parameters
- )
-
- def __test_group_parameters(
- self,
- required_string_group,
- required_boolean_group,
- required_int64_group,
- **kwargs
- ):
- """Fake endpoint to test group parameters (optional) # noqa: E501
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
- >>> result = thread.get()
-
- Args:
- required_string_group (int): Required String in group parameters
- required_boolean_group (bool): Required Boolean in group parameters
- required_int64_group (int): Required Integer in group parameters
-
- Keyword Args:
- string_group (int): String in group parameters. [optional]
- boolean_group (bool): Boolean in group parameters. [optional]
- int64_group (int): Integer in group parameters. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['required_string_group'] = \
- required_string_group
- kwargs['required_boolean_group'] = \
- required_boolean_group
- kwargs['required_int64_group'] = \
- required_int64_group
- return self.call_with_http_info(**kwargs)
-
- self.test_group_parameters = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'bearer_test'
- ],
- 'endpoint_path': '/fake',
- 'operation_id': 'test_group_parameters',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'required_string_group',
- 'required_boolean_group',
- 'required_int64_group',
- 'string_group',
- 'boolean_group',
- 'int64_group',
- ],
- 'required': [
- 'required_string_group',
- 'required_boolean_group',
- 'required_int64_group',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'required_string_group':
- (int,),
- 'required_boolean_group':
- (bool,),
- 'required_int64_group':
- (int,),
- 'string_group':
- (int,),
- 'boolean_group':
- (bool,),
- 'int64_group':
- (int,),
- },
- 'attribute_map': {
- 'required_string_group': 'required_string_group',
- 'required_boolean_group': 'required_boolean_group',
- 'required_int64_group': 'required_int64_group',
- 'string_group': 'string_group',
- 'boolean_group': 'boolean_group',
- 'int64_group': 'int64_group',
- },
- 'location_map': {
- 'required_string_group': 'query',
- 'required_boolean_group': 'header',
- 'required_int64_group': 'query',
- 'string_group': 'query',
- 'boolean_group': 'header',
- 'int64_group': 'query',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__test_group_parameters
- )
-
- def __test_inline_additional_properties(
- self,
- request_body,
- **kwargs
- ):
- """test inline additionalProperties # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_inline_additional_properties(request_body, async_req=True)
- >>> result = thread.get()
-
- Args:
- request_body ({str: (str,)}): request body
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['request_body'] = \
- request_body
- return self.call_with_http_info(**kwargs)
-
- self.test_inline_additional_properties = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/inline-additionalProperties',
- 'operation_id': 'test_inline_additional_properties',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'request_body',
- ],
- 'required': [
- 'request_body',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'request_body':
- ({str: (str,)},),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'request_body': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_inline_additional_properties
- )
-
- def __test_json_form_data(
- self,
- param,
- param2,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.test_json_form_data(param, param2, async_req=True)
- >>> result = thread.get()
-
- Args:
- param (str): field1
- param2 (str): field2
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['param'] = \
- param
- kwargs['param2'] = \
- param2
- return self.call_with_http_info(**kwargs)
-
- self.test_json_form_data = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/jsonFormData',
- 'operation_id': 'test_json_form_data',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'param',
- 'param2',
- ],
- 'required': [
- 'param',
- 'param2',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'param':
- (str,),
- 'param2':
- (str,),
- },
- 'attribute_map': {
- 'param': 'param',
- 'param2': 'param2',
- },
- 'location_map': {
- 'param': 'form',
- 'param2': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__test_json_form_data
- )
-
- def __test_query_parameter_collection_format(
- self,
- pipe,
- ioutil,
- http,
- url,
- context,
- **kwargs
- ):
- """test_query_parameter_collection_format # noqa: E501
-
- To test the collection format in query parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True)
- >>> result = thread.get()
-
- Args:
- pipe ([str]):
- ioutil ([str]):
- http ([str]):
- url ([str]):
- context ([str]):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pipe'] = \
- pipe
- kwargs['ioutil'] = \
- ioutil
- kwargs['http'] = \
- http
- kwargs['url'] = \
- url
- kwargs['context'] = \
- context
- return self.call_with_http_info(**kwargs)
-
- self.test_query_parameter_collection_format = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/fake/test-query-paramters',
- 'operation_id': 'test_query_parameter_collection_format',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pipe',
- 'ioutil',
- 'http',
- 'url',
- 'context',
- ],
- 'required': [
- 'pipe',
- 'ioutil',
- 'http',
- 'url',
- 'context',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pipe':
- ([str],),
- 'ioutil':
- ([str],),
- 'http':
- ([str],),
- 'url':
- ([str],),
- 'context':
- ([str],),
- },
- 'attribute_map': {
- 'pipe': 'pipe',
- 'ioutil': 'ioutil',
- 'http': 'http',
- 'url': 'url',
- 'context': 'context',
- },
- 'location_map': {
- 'pipe': 'query',
- 'ioutil': 'query',
- 'http': 'query',
- 'url': 'query',
- 'context': 'query',
- },
- 'collection_format_map': {
- 'pipe': 'multi',
- 'ioutil': 'csv',
- 'http': 'ssv',
- 'url': 'csv',
- 'context': 'multi',
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__test_query_parameter_collection_format
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py
deleted file mode 100644
index 40f8039b3cb1..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.client import Client
-
-
-class FakeClassnameTags123Api(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __test_classname(
- self,
- client,
- **kwargs
- ):
- """To test class name in snake case # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_classname(client, async_req=True)
- >>> result = thread.get()
-
- Args:
- client (Client): client model
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Client
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['client'] = \
- client
- return self.call_with_http_info(**kwargs)
-
- self.test_classname = Endpoint(
- settings={
- 'response_type': (Client,),
- 'auth': [
- 'api_key_query'
- ],
- 'endpoint_path': '/fake_classname_test',
- 'operation_id': 'test_classname',
- 'http_method': 'PATCH',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'client',
- ],
- 'required': [
- 'client',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'client':
- (Client,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'client': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__test_classname
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py
deleted file mode 100644
index 3a20006d3929..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py
+++ /dev/null
@@ -1,1187 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.api_response import ApiResponse
-from petstore_api.model.pet import Pet
-
-
-class PetApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __add_pet(
- self,
- pet,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.add_pet(pet, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet (Pet): Pet object that needs to be added to the store
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet'] = \
- pet
- return self.call_with_http_info(**kwargs)
-
- self.add_pet = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'http_signature_test',
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet',
- 'operation_id': 'add_pet',
- 'http_method': 'POST',
- 'servers': [
- {
- 'url': "http://petstore.swagger.io/v2",
- 'description': "No description provided",
- },
- {
- 'url': "http://path-server-test.petstore.local/v2",
- 'description': "No description provided",
- },
- ]
- },
- params_map={
- 'all': [
- 'pet',
- ],
- 'required': [
- 'pet',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet':
- (Pet,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'pet': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json',
- 'application/xml'
- ]
- },
- api_client=api_client,
- callable=__add_pet
- )
-
- def __delete_pet(
- self,
- pet_id,
- **kwargs
- ):
- """Deletes a pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.delete_pet(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): Pet id to delete
-
- Keyword Args:
- api_key (str): [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.delete_pet = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/{petId}',
- 'operation_id': 'delete_pet',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'api_key',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'api_key':
- (str,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'api_key': 'api_key',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'api_key': 'header',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__delete_pet
- )
-
- def __find_pets_by_status(
- self,
- status,
- **kwargs
- ):
- """Finds Pets by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_status(status, async_req=True)
- >>> result = thread.get()
-
- Args:
- status ([str]): Status values that need to be considered for filter
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- [Pet]
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['status'] = \
- status
- return self.call_with_http_info(**kwargs)
-
- self.find_pets_by_status = Endpoint(
- settings={
- 'response_type': ([Pet],),
- 'auth': [
- 'http_signature_test',
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/findByStatus',
- 'operation_id': 'find_pets_by_status',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'status',
- ],
- 'required': [
- 'status',
- ],
- 'nullable': [
- ],
- 'enum': [
- 'status',
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- ('status',): {
-
- "AVAILABLE": "available",
- "PENDING": "pending",
- "SOLD": "sold"
- },
- },
- 'openapi_types': {
- 'status':
- ([str],),
- },
- 'attribute_map': {
- 'status': 'status',
- },
- 'location_map': {
- 'status': 'query',
- },
- 'collection_format_map': {
- 'status': 'csv',
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__find_pets_by_status
- )
-
- def __find_pets_by_tags(
- self,
- tags,
- **kwargs
- ):
- """Finds Pets by tags # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_tags(tags, async_req=True)
- >>> result = thread.get()
-
- Args:
- tags ([str]): Tags to filter by
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- [Pet]
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['tags'] = \
- tags
- return self.call_with_http_info(**kwargs)
-
- self.find_pets_by_tags = Endpoint(
- settings={
- 'response_type': ([Pet],),
- 'auth': [
- 'http_signature_test',
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/findByTags',
- 'operation_id': 'find_pets_by_tags',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'tags',
- ],
- 'required': [
- 'tags',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'tags':
- ([str],),
- },
- 'attribute_map': {
- 'tags': 'tags',
- },
- 'location_map': {
- 'tags': 'query',
- },
- 'collection_format_map': {
- 'tags': 'csv',
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__find_pets_by_tags
- )
-
- def __get_pet_by_id(
- self,
- pet_id,
- **kwargs
- ):
- """Find pet by ID # noqa: E501
-
- Returns a single pet # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.get_pet_by_id(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): ID of pet to return
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Pet
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.get_pet_by_id = Endpoint(
- settings={
- 'response_type': (Pet,),
- 'auth': [
- 'api_key'
- ],
- 'endpoint_path': '/pet/{petId}',
- 'operation_id': 'get_pet_by_id',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- },
- 'location_map': {
- 'pet_id': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_pet_by_id
- )
-
- def __update_pet(
- self,
- pet,
- **kwargs
- ):
- """Update an existing pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.update_pet(pet, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet (Pet): Pet object that needs to be added to the store
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet'] = \
- pet
- return self.call_with_http_info(**kwargs)
-
- self.update_pet = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'http_signature_test',
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet',
- 'operation_id': 'update_pet',
- 'http_method': 'PUT',
- 'servers': [
- {
- 'url': "http://petstore.swagger.io/v2",
- 'description': "No description provided",
- },
- {
- 'url': "http://path-server-test.petstore.local/v2",
- 'description': "No description provided",
- },
- ]
- },
- params_map={
- 'all': [
- 'pet',
- ],
- 'required': [
- 'pet',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet':
- (Pet,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'pet': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json',
- 'application/xml'
- ]
- },
- api_client=api_client,
- callable=__update_pet
- )
-
- def __update_pet_with_form(
- self,
- pet_id,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.update_pet_with_form(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): ID of pet that needs to be updated
-
- Keyword Args:
- name (str): Updated name of the pet. [optional]
- status (str): Updated status of the pet. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.update_pet_with_form = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/{petId}',
- 'operation_id': 'update_pet_with_form',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'name',
- 'status',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'name':
- (str,),
- 'status':
- (str,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'name': 'name',
- 'status': 'status',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'name': 'form',
- 'status': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/x-www-form-urlencoded'
- ]
- },
- api_client=api_client,
- callable=__update_pet_with_form
- )
-
- def __upload_file(
- self,
- pet_id,
- **kwargs
- ):
- """uploads an image # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.upload_file(pet_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- pet_id (int): ID of pet to update
-
- Keyword Args:
- additional_metadata (str): Additional data to pass to server. [optional]
- file (file_type): file to upload. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ApiResponse
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- return self.call_with_http_info(**kwargs)
-
- self.upload_file = Endpoint(
- settings={
- 'response_type': (ApiResponse,),
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/pet/{petId}/uploadImage',
- 'operation_id': 'upload_file',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'additional_metadata',
- 'file',
- ],
- 'required': [
- 'pet_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'additional_metadata':
- (str,),
- 'file':
- (file_type,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'additional_metadata': 'additionalMetadata',
- 'file': 'file',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'additional_metadata': 'form',
- 'file': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'multipart/form-data'
- ]
- },
- api_client=api_client,
- callable=__upload_file
- )
-
- def __upload_file_with_required_file(
- self,
- pet_id,
- required_file,
- **kwargs
- ):
- """uploads an image (required) # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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()
-
- Args:
- pet_id (int): ID of pet to update
- required_file (file_type): file to upload
-
- Keyword Args:
- additional_metadata (str): Additional data to pass to server. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ApiResponse
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['pet_id'] = \
- pet_id
- kwargs['required_file'] = \
- required_file
- return self.call_with_http_info(**kwargs)
-
- self.upload_file_with_required_file = Endpoint(
- settings={
- 'response_type': (ApiResponse,),
- 'auth': [
- 'petstore_auth'
- ],
- 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile',
- 'operation_id': 'upload_file_with_required_file',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'pet_id',
- 'required_file',
- 'additional_metadata',
- ],
- 'required': [
- 'pet_id',
- 'required_file',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'pet_id':
- (int,),
- 'required_file':
- (file_type,),
- 'additional_metadata':
- (str,),
- },
- 'attribute_map': {
- 'pet_id': 'petId',
- 'required_file': 'requiredFile',
- 'additional_metadata': 'additionalMetadata',
- },
- 'location_map': {
- 'pet_id': 'path',
- 'required_file': 'form',
- 'additional_metadata': 'form',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [
- 'multipart/form-data'
- ]
- },
- api_client=api_client,
- callable=__upload_file_with_required_file
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py
deleted file mode 100644
index 5aa2d27623a8..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py
+++ /dev/null
@@ -1,503 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.order import Order
-
-
-class StoreApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __delete_order(
- self,
- order_id,
- **kwargs
- ):
- """Delete purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_order(order_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- order_id (str): ID of the order that needs to be deleted
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['order_id'] = \
- order_id
- return self.call_with_http_info(**kwargs)
-
- self.delete_order = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/store/order/{order_id}',
- 'operation_id': 'delete_order',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'order_id',
- ],
- 'required': [
- 'order_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'order_id':
- (str,),
- },
- 'attribute_map': {
- 'order_id': 'order_id',
- },
- 'location_map': {
- 'order_id': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__delete_order
- )
-
- def __get_inventory(
- self,
- **kwargs
- ):
- """Returns pet inventories by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_inventory(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- {str: (int,)}
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.get_inventory = Endpoint(
- settings={
- 'response_type': ({str: (int,)},),
- 'auth': [
- 'api_key'
- ],
- 'endpoint_path': '/store/inventory',
- 'operation_id': 'get_inventory',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- },
- 'attribute_map': {
- },
- 'location_map': {
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_inventory
- )
-
- def __get_order_by_id(
- self,
- order_id,
- **kwargs
- ):
- """Find purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_order_by_id(order_id, async_req=True)
- >>> result = thread.get()
-
- Args:
- order_id (int): ID of pet that needs to be fetched
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Order
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['order_id'] = \
- order_id
- return self.call_with_http_info(**kwargs)
-
- self.get_order_by_id = Endpoint(
- settings={
- 'response_type': (Order,),
- 'auth': [],
- 'endpoint_path': '/store/order/{order_id}',
- 'operation_id': 'get_order_by_id',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'order_id',
- ],
- 'required': [
- 'order_id',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- 'order_id',
- ]
- },
- root_map={
- 'validations': {
- ('order_id',): {
-
- 'inclusive_maximum': 5,
- 'inclusive_minimum': 1,
- },
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'order_id':
- (int,),
- },
- 'attribute_map': {
- 'order_id': 'order_id',
- },
- 'location_map': {
- 'order_id': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_order_by_id
- )
-
- def __place_order(
- self,
- order,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.place_order(order, async_req=True)
- >>> result = thread.get()
-
- Args:
- order (Order): order placed for purchasing the pet
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Order
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['order'] = \
- order
- return self.call_with_http_info(**kwargs)
-
- self.place_order = Endpoint(
- settings={
- 'response_type': (Order,),
- 'auth': [],
- 'endpoint_path': '/store/order',
- 'operation_id': 'place_order',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'order',
- ],
- 'required': [
- 'order',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'order':
- (Order,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'order': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__place_order
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py
deleted file mode 100644
index ee0468ec9286..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py
+++ /dev/null
@@ -1,972 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from petstore_api.api_client import ApiClient, Endpoint
-from petstore_api.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types
-)
-from petstore_api.model.user import User
-
-
-class UserApi(object):
- """NOTE: This class is auto generated by OpenAPI Generator
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- def __init__(self, api_client=None):
- if api_client is None:
- api_client = ApiClient()
- self.api_client = api_client
-
- def __create_user(
- self,
- user,
- **kwargs
- ):
- """Create user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.create_user(user, async_req=True)
- >>> result = thread.get()
-
- Args:
- user (User): Created user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['user'] = \
- user
- return self.call_with_http_info(**kwargs)
-
- self.create_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user',
- 'operation_id': 'create_user',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'user',
- ],
- 'required': [
- 'user',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'user':
- (User,),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'user': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__create_user
- )
-
- def __create_users_with_array_input(
- self,
- user,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.create_users_with_array_input(user, async_req=True)
- >>> result = thread.get()
-
- Args:
- user ([User]): List of user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['user'] = \
- user
- return self.call_with_http_info(**kwargs)
-
- self.create_users_with_array_input = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/createWithArray',
- 'operation_id': 'create_users_with_array_input',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'user',
- ],
- 'required': [
- 'user',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'user':
- ([User],),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'user': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__create_users_with_array_input
- )
-
- def __create_users_with_list_input(
- self,
- user,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.create_users_with_list_input(user, async_req=True)
- >>> result = thread.get()
-
- Args:
- user ([User]): List of user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['user'] = \
- user
- return self.call_with_http_info(**kwargs)
-
- self.create_users_with_list_input = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/createWithList',
- 'operation_id': 'create_users_with_list_input',
- 'http_method': 'POST',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'user',
- ],
- 'required': [
- 'user',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'user':
- ([User],),
- },
- 'attribute_map': {
- },
- 'location_map': {
- 'user': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__create_users_with_list_input
- )
-
- def __delete_user(
- self,
- username,
- **kwargs
- ):
- """Delete user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_user(username, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): The name that needs to be deleted
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- return self.call_with_http_info(**kwargs)
-
- self.delete_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/{username}',
- 'operation_id': 'delete_user',
- 'http_method': 'DELETE',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- ],
- 'required': [
- 'username',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- },
- 'attribute_map': {
- 'username': 'username',
- },
- 'location_map': {
- 'username': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__delete_user
- )
-
- def __get_user_by_name(
- self,
- username,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.get_user_by_name(username, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): The name that needs to be fetched. Use user1 for testing.
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- User
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- return self.call_with_http_info(**kwargs)
-
- self.get_user_by_name = Endpoint(
- settings={
- 'response_type': (User,),
- 'auth': [],
- 'endpoint_path': '/user/{username}',
- 'operation_id': 'get_user_by_name',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- ],
- 'required': [
- 'username',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- },
- 'attribute_map': {
- 'username': 'username',
- },
- 'location_map': {
- 'username': 'path',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__get_user_by_name
- )
-
- def __login_user(
- self,
- username,
- password,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.login_user(username, password, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): The user name for login
- password (str): The password for login in clear text
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- str
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- kwargs['password'] = \
- password
- return self.call_with_http_info(**kwargs)
-
- self.login_user = Endpoint(
- settings={
- 'response_type': (str,),
- 'auth': [],
- 'endpoint_path': '/user/login',
- 'operation_id': 'login_user',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- 'password',
- ],
- 'required': [
- 'username',
- 'password',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- 'password':
- (str,),
- },
- 'attribute_map': {
- 'username': 'username',
- 'password': 'password',
- },
- 'location_map': {
- 'username': 'query',
- 'password': 'query',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [
- 'application/xml',
- 'application/json'
- ],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__login_user
- )
-
- def __logout_user(
- self,
- **kwargs
- ):
- """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_req=True
-
- >>> thread = api.logout_user(async_req=True)
- >>> result = thread.get()
-
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- return self.call_with_http_info(**kwargs)
-
- self.logout_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/logout',
- 'operation_id': 'logout_user',
- 'http_method': 'GET',
- 'servers': None,
- },
- params_map={
- 'all': [
- ],
- 'required': [],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- },
- 'attribute_map': {
- },
- 'location_map': {
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [],
- },
- api_client=api_client,
- callable=__logout_user
- )
-
- def __update_user(
- self,
- username,
- user,
- **kwargs
- ):
- """Updated user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.update_user(username, user, async_req=True)
- >>> result = thread.get()
-
- Args:
- username (str): name that need to be deleted
- user (User): Updated user object
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (float/tuple): timeout setting for this request. If one
- number provided, it will be total request timeout. It can also
- be a pair (tuple) of (connection, read) timeouts.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
- """
- kwargs['async_req'] = kwargs.get(
- 'async_req', False
- )
- kwargs['_return_http_data_only'] = kwargs.get(
- '_return_http_data_only', True
- )
- kwargs['_preload_content'] = kwargs.get(
- '_preload_content', True
- )
- kwargs['_request_timeout'] = kwargs.get(
- '_request_timeout', None
- )
- kwargs['_check_input_type'] = kwargs.get(
- '_check_input_type', True
- )
- kwargs['_check_return_type'] = kwargs.get(
- '_check_return_type', True
- )
- kwargs['_host_index'] = kwargs.get('_host_index')
- kwargs['username'] = \
- username
- kwargs['user'] = \
- user
- return self.call_with_http_info(**kwargs)
-
- self.update_user = Endpoint(
- settings={
- 'response_type': None,
- 'auth': [],
- 'endpoint_path': '/user/{username}',
- 'operation_id': 'update_user',
- 'http_method': 'PUT',
- 'servers': None,
- },
- params_map={
- 'all': [
- 'username',
- 'user',
- ],
- 'required': [
- 'username',
- 'user',
- ],
- 'nullable': [
- ],
- 'enum': [
- ],
- 'validation': [
- ]
- },
- root_map={
- 'validations': {
- },
- 'allowed_values': {
- },
- 'openapi_types': {
- 'username':
- (str,),
- 'user':
- (User,),
- },
- 'attribute_map': {
- 'username': 'username',
- },
- 'location_map': {
- 'username': 'path',
- 'user': 'body',
- },
- 'collection_format_map': {
- }
- },
- headers_map={
- 'accept': [],
- 'content_type': [
- 'application/json'
- ]
- },
- api_client=api_client,
- callable=__update_user
- )
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py
deleted file mode 100644
index ac0fb625b16e..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py
+++ /dev/null
@@ -1,825 +0,0 @@
-# coding: utf-8
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import json
-import atexit
-import mimetypes
-from multiprocessing.pool import ThreadPool
-import io
-import os
-import re
-import typing
-from urllib.parse import quote
-
-
-from petstore_api import rest
-from petstore_api.configuration import Configuration
-from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException
-from petstore_api.model_utils import (
- ModelNormal,
- ModelSimple,
- ModelComposed,
- check_allowed_values,
- check_validations,
- date,
- datetime,
- deserialize_file,
- file_type,
- model_to_dict,
- none_type,
- validate_and_convert_types
-)
-
-
-class ApiClient(object):
- """Generic API client for OpenAPI client library builds.
-
- OpenAPI generic API client. This client handles the client-
- server communication, and is invariant across implementations. Specifics of
- the methods and models for each application are generated from the OpenAPI
- templates.
-
- NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
-
- :param configuration: .Configuration object for this client
- :param header_name: a header to pass when making calls to the API.
- :param header_value: a header value to pass when making calls to
- the API.
- :param cookie: a cookie to include in the header when making calls
- to the API
- :param pool_threads: The number of threads to use for async requests
- to the API. More threads means more concurrent API requests.
- """
-
- _pool = None
-
- def __init__(self, configuration=None, header_name=None, header_value=None,
- cookie=None, pool_threads=1):
- if configuration is None:
- configuration = Configuration()
- self.configuration = configuration
- self.pool_threads = pool_threads
-
- self.rest_client = rest.RESTClientObject(configuration)
- self.default_headers = {}
- if header_name is not None:
- self.default_headers[header_name] = header_value
- self.cookie = cookie
- # Set default User-Agent.
- self.user_agent = 'OpenAPI-Generator/1.0.0/python'
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, traceback):
- self.close()
-
- def close(self):
- if self._pool:
- self._pool.close()
- self._pool.join()
- self._pool = None
- if hasattr(atexit, 'unregister'):
- atexit.unregister(self.close)
-
- @property
- def pool(self):
- """Create thread pool on first request
- avoids instantiating unused threadpool for blocking clients.
- """
- if self._pool is None:
- atexit.register(self.close)
- self._pool = ThreadPool(self.pool_threads)
- return self._pool
-
- @property
- def user_agent(self):
- """User agent for this API client"""
- return self.default_headers['User-Agent']
-
- @user_agent.setter
- def user_agent(self, value):
- self.default_headers['User-Agent'] = value
-
- def set_default_header(self, header_name, header_value):
- self.default_headers[header_name] = header_value
-
- def __call_api(
- self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None
- ):
-
- config = self.configuration
-
- # header parameters
- header_params = header_params or {}
- header_params.update(self.default_headers)
- if self.cookie:
- header_params['Cookie'] = self.cookie
- if header_params:
- header_params = self.sanitize_for_serialization(header_params)
- header_params = dict(self.parameters_to_tuples(header_params,
- collection_formats))
-
- # path parameters
- if path_params:
- path_params = self.sanitize_for_serialization(path_params)
- path_params = self.parameters_to_tuples(path_params,
- collection_formats)
- for k, v in path_params:
- # specified safe chars, encode everything
- resource_path = resource_path.replace(
- '{%s}' % k,
- quote(str(v), safe=config.safe_chars_for_path_param)
- )
-
- # query parameters
- if query_params:
- query_params = self.sanitize_for_serialization(query_params)
- query_params = self.parameters_to_tuples(query_params,
- collection_formats)
-
- # post parameters
- if post_params or files:
- post_params = post_params if post_params else []
- post_params = self.sanitize_for_serialization(post_params)
- post_params = self.parameters_to_tuples(post_params,
- collection_formats)
- post_params.extend(self.files_parameters(files))
-
- # body
- if body:
- body = self.sanitize_for_serialization(body)
-
- # auth setting
- self.update_params_for_auth(header_params, query_params,
- auth_settings, resource_path, method, body)
-
- # request url
- if _host is None:
- url = self.configuration.host + resource_path
- else:
- # use server/host defined in path or operation instead
- url = _host + resource_path
-
- try:
- # perform request and return response
- response_data = self.request(
- method, url, query_params=query_params, headers=header_params,
- post_params=post_params, body=body,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout)
- except ApiException as e:
- e.body = e.body.decode('utf-8')
- raise e
-
- content_type = response_data.getheader('content-type')
-
- self.last_response = response_data
-
- return_data = response_data
-
- if not _preload_content:
- return (return_data)
- return return_data
-
- if response_type not in ["file", "bytes"]:
- match = None
- if content_type is not None:
- match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
- encoding = match.group(1) if match else "utf-8"
- response_data.data = response_data.data.decode(encoding)
-
- # deserialize response data
- if response_type:
- return_data = self.deserialize(
- response_data,
- response_type,
- _check_type
- )
- else:
- return_data = None
-
- if _return_http_data_only:
- return (return_data)
- else:
- return (return_data, response_data.status,
- response_data.getheaders())
-
- @classmethod
- def sanitize_for_serialization(cls, obj):
- """Builds a JSON POST object.
- If obj is None, return None.
- If obj is str, int, long, float, bool, return directly.
- If obj is datetime.datetime, datetime.date
- convert to string in iso8601 format.
- If obj is list, sanitize each element in the list.
- If obj is dict, return the dict.
- If obj is OpenAPI model, return the properties dict.
- :param obj: The data to serialize.
- :return: The serialized form of data.
- """
- if isinstance(obj, (ModelNormal, ModelComposed)):
- return {
- key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()
- }
- elif isinstance(obj, (str, int, float, none_type, bool)):
- return obj
- elif isinstance(obj, (datetime, date)):
- return obj.isoformat()
- elif isinstance(obj, ModelSimple):
- return cls.sanitize_for_serialization(obj.value)
- elif isinstance(obj, (list, tuple)):
- return [cls.sanitize_for_serialization(item) for item in obj]
- if isinstance(obj, dict):
- return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
- raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))
-
- def deserialize(self, response, response_type, _check_type):
- """Deserializes response into an object.
-
- :param response: RESTResponse object to be deserialized.
- :param response_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param _check_type: boolean, whether to check the types of the data
- received from the server
- :type _check_type: bool
-
- :return: deserialized object.
- """
- # handle file downloading
- # save response body into a tmp file and return the instance
- if response_type == (file_type,):
- content_disposition = response.getheader("Content-Disposition")
- return deserialize_file(response.data, self.configuration,
- content_disposition=content_disposition)
-
- # fetch data from response object
- try:
- received_data = json.loads(response.data)
- except ValueError:
- received_data = response.data
-
- # store our data under the key of 'received_data' so users have some
- # context if they are deserializing a string and the data type is wrong
- deserialized_data = validate_and_convert_types(
- received_data,
- response_type,
- ['received_data'],
- True,
- _check_type,
- configuration=self.configuration
- )
- return deserialized_data
-
- def call_api(
- self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- async_req: typing.Optional[bool] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None
- ):
- """Makes the HTTP request (synchronous) and returns deserialized data.
-
- To make an async_req request, set the async_req parameter.
-
- :param resource_path: Path to method endpoint.
- :param method: Method to call.
- :param path_params: Path parameters in the url.
- :param query_params: Query parameters in the url.
- :param header_params: Header parameters to be
- placed in the request header.
- :param body: Request body.
- :param post_params dict: Request post form parameters,
- for `application/x-www-form-urlencoded`, `multipart/form-data`.
- :param auth_settings list: Auth Settings names for the request.
- :param response_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param files: key -> field name, value -> a list of open file
- objects for `multipart/form-data`.
- :type files: dict
- :param async_req bool: execute request asynchronously
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param collection_formats: dict of collection formats for path, query,
- header, and post parameters.
- :type collection_formats: dict, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _check_type: boolean describing if the data back from the server
- should have its type checked.
- :type _check_type: bool, optional
- :return:
- If async_req parameter is True,
- the request will be called asynchronously.
- The method will return the request thread.
- If parameter async_req is False or missing,
- then the method will return the response directly.
- """
- if not async_req:
- return self.__call_api(resource_path, method,
- path_params, query_params, header_params,
- body, post_params, files,
- response_type, auth_settings,
- _return_http_data_only, collection_formats,
- _preload_content, _request_timeout, _host,
- _check_type)
-
- return self.pool.apply_async(self.__call_api, (resource_path,
- method, path_params,
- query_params,
- header_params, body,
- post_params, files,
- response_type,
- auth_settings,
- _return_http_data_only,
- collection_formats,
- _preload_content,
- _request_timeout,
- _host, _check_type))
-
- def request(self, method, url, query_params=None, headers=None,
- post_params=None, body=None, _preload_content=True,
- _request_timeout=None):
- """Makes the HTTP request using RESTClient."""
- if method == "GET":
- return self.rest_client.GET(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "HEAD":
- return self.rest_client.HEAD(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "OPTIONS":
- return self.rest_client.OPTIONS(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "POST":
- return self.rest_client.POST(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PUT":
- return self.rest_client.PUT(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PATCH":
- return self.rest_client.PATCH(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "DELETE":
- return self.rest_client.DELETE(url,
- query_params=query_params,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- else:
- raise ApiValueError(
- "http method must be `GET`, `HEAD`, `OPTIONS`,"
- " `POST`, `PATCH`, `PUT` or `DELETE`."
- )
-
- def parameters_to_tuples(self, params, collection_formats):
- """Get parameters as list of tuples, formatting collections.
-
- :param params: Parameters as dict or list of two-tuples
- :param dict collection_formats: Parameter collection formats
- :return: Parameters as list of tuples, collections formatted
- """
- new_params = []
- if collection_formats is None:
- collection_formats = {}
- for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
- if k in collection_formats:
- collection_format = collection_formats[k]
- if collection_format == 'multi':
- new_params.extend((k, value) for value in v)
- else:
- if collection_format == 'ssv':
- delimiter = ' '
- elif collection_format == 'tsv':
- delimiter = '\t'
- elif collection_format == 'pipes':
- delimiter = '|'
- else: # csv is the default
- delimiter = ','
- new_params.append(
- (k, delimiter.join(str(value) for value in v)))
- else:
- new_params.append((k, v))
- return new_params
-
- def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
- """Builds form parameters.
-
- :param files: None or a dict with key=param_name and
- value is a list of open file objects
- :return: List of tuples of form parameters with file data
- """
- if files is None:
- return []
-
- params = []
- for param_name, file_instances in files.items():
- if file_instances is None:
- # if the file field is nullable, skip None values
- continue
- for file_instance in file_instances:
- if file_instance is None:
- # if the file field is nullable, skip None values
- continue
- if file_instance.closed is True:
- raise ApiValueError(
- "Cannot read a closed file. The passed in file_type "
- "for %s must be open." % param_name
- )
- filename = os.path.basename(file_instance.name)
- filedata = file_instance.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([param_name, tuple([filename, filedata, mimetype])]))
- file_instance.close()
-
- return params
-
- def select_header_accept(self, accepts):
- """Returns `Accept` based on an array of accepts provided.
-
- :param accepts: List of headers.
- :return: Accept (e.g. application/json).
- """
- if not accepts:
- return
-
- accepts = [x.lower() for x in accepts]
-
- if 'application/json' in accepts:
- return 'application/json'
- else:
- return ', '.join(accepts)
-
- def select_header_content_type(self, content_types):
- """Returns `Content-Type` based on an array of content_types provided.
-
- :param content_types: List of content-types.
- :return: Content-Type (e.g. application/json).
- """
- if not content_types:
- return 'application/json'
-
- content_types = [x.lower() for x in content_types]
-
- if 'application/json' in content_types or '*/*' in content_types:
- return 'application/json'
- else:
- return content_types[0]
-
- def update_params_for_auth(self, headers, querys, auth_settings,
- resource_path, method, body):
- """Updates header and query params based on authentication setting.
-
- :param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
- :param auth_settings: Authentication setting identifiers list.
- :param resource_path: A string representation of the HTTP request resource path.
- :param method: A string representation of the HTTP request method.
- :param body: A object representing the body of the HTTP request.
- The object type is the return value of _encoder.default().
- """
- if not auth_settings:
- return
-
- for auth in auth_settings:
- auth_setting = self.configuration.auth_settings().get(auth)
- if auth_setting:
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- if auth_setting['type'] != 'http-signature':
- headers[auth_setting['key']] = auth_setting['value']
- else:
- # The HTTP signature scheme requires multiple HTTP headers
- # that are calculated dynamically.
- signing_info = self.configuration.signing_info
- auth_headers = signing_info.get_http_signature_headers(
- resource_path, method, headers, body, querys)
- headers.update(auth_headers)
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
-
-
-class Endpoint(object):
- def __init__(self, settings=None, params_map=None, root_map=None,
- headers_map=None, api_client=None, callable=None):
- """Creates an endpoint
-
- Args:
- settings (dict): see below key value pairs
- 'response_type' (tuple/None): response type
- 'auth' (list): a list of auth type keys
- 'endpoint_path' (str): the endpoint path
- 'operation_id' (str): endpoint string identifier
- 'http_method' (str): POST/PUT/PATCH/GET etc
- 'servers' (list): list of str servers that this endpoint is at
- params_map (dict): see below key value pairs
- 'all' (list): list of str endpoint parameter names
- 'required' (list): list of required parameter names
- 'nullable' (list): list of nullable parameter names
- 'enum' (list): list of parameters with enum values
- 'validation' (list): list of parameters with validations
- root_map
- 'validations' (dict): the dict mapping endpoint parameter tuple
- paths to their validation dictionaries
- 'allowed_values' (dict): the dict mapping endpoint parameter
- tuple paths to their allowed_values (enum) dictionaries
- 'openapi_types' (dict): param_name to openapi type
- 'attribute_map' (dict): param_name to camelCase name
- 'location_map' (dict): param_name to 'body', 'file', 'form',
- 'header', 'path', 'query'
- collection_format_map (dict): param_name to `csv` etc.
- headers_map (dict): see below key value pairs
- 'accept' (list): list of Accept header strings
- 'content_type' (list): list of Content-Type header strings
- api_client (ApiClient) api client instance
- callable (function): the function which is invoked when the
- Endpoint is called
- """
- self.settings = settings
- self.params_map = params_map
- self.params_map['all'].extend([
- 'async_req',
- '_host_index',
- '_preload_content',
- '_request_timeout',
- '_return_http_data_only',
- '_check_input_type',
- '_check_return_type'
- ])
- self.params_map['nullable'].extend(['_request_timeout'])
- self.validations = root_map['validations']
- self.allowed_values = root_map['allowed_values']
- self.openapi_types = root_map['openapi_types']
- extra_types = {
- 'async_req': (bool,),
- '_host_index': (none_type, int),
- '_preload_content': (bool,),
- '_request_timeout': (none_type, int, (int,), [int]),
- '_return_http_data_only': (bool,),
- '_check_input_type': (bool,),
- '_check_return_type': (bool,)
- }
- self.openapi_types.update(extra_types)
- self.attribute_map = root_map['attribute_map']
- self.location_map = root_map['location_map']
- self.collection_format_map = root_map['collection_format_map']
- self.headers_map = headers_map
- self.api_client = api_client
- self.callable = callable
-
- def __validate_inputs(self, kwargs):
- for param in self.params_map['enum']:
- if param in kwargs:
- check_allowed_values(
- self.allowed_values,
- (param,),
- kwargs[param]
- )
-
- for param in self.params_map['validation']:
- if param in kwargs:
- check_validations(
- self.validations,
- (param,),
- kwargs[param],
- configuration=self.api_client.configuration
- )
-
- if kwargs['_check_input_type'] is False:
- return
-
- for key, value in kwargs.items():
- fixed_val = validate_and_convert_types(
- value,
- self.openapi_types[key],
- [key],
- False,
- kwargs['_check_input_type'],
- configuration=self.api_client.configuration
- )
- kwargs[key] = fixed_val
-
- def __gather_params(self, kwargs):
- params = {
- 'body': None,
- 'collection_format': {},
- 'file': {},
- 'form': [],
- 'header': {},
- 'path': {},
- 'query': []
- }
-
- for param_name, param_value in kwargs.items():
- param_location = self.location_map.get(param_name)
- if param_location is None:
- continue
- if param_location:
- if param_location == 'body':
- params['body'] = param_value
- continue
- base_name = self.attribute_map[param_name]
- if (param_location == 'form' and
- self.openapi_types[param_name] == (file_type,)):
- params['file'][param_name] = [param_value]
- elif (param_location == 'form' and
- self.openapi_types[param_name] == ([file_type],)):
- # param_value is already a list
- params['file'][param_name] = param_value
- elif param_location in {'form', 'query'}:
- param_value_full = (base_name, param_value)
- params[param_location].append(param_value_full)
- if param_location not in {'form', 'query'}:
- params[param_location][base_name] = param_value
- collection_format = self.collection_format_map.get(param_name)
- if collection_format:
- params['collection_format'][base_name] = collection_format
-
- return params
-
- def __call__(self, *args, **kwargs):
- """ This method is invoked when endpoints are called
- Example:
-
- api_instance = AnotherFakeApi()
- api_instance.call_123_test_special_tags # this is an instance of the class Endpoint
- api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__()
- which then invokes the callable functions stored in that endpoint at
- api_instance.call_123_test_special_tags.callable or self.callable in this class
-
- """
- return self.callable(self, *args, **kwargs)
-
- def call_with_http_info(self, **kwargs):
-
- try:
- index = self.api_client.configuration.server_operation_index.get(
- self.settings['operation_id'], self.api_client.configuration.server_index
- ) if kwargs['_host_index'] is None else kwargs['_host_index']
- server_variables = self.api_client.configuration.server_operation_variables.get(
- self.settings['operation_id'], self.api_client.configuration.server_variables
- )
- _host = self.api_client.configuration.get_host_from_settings(
- index, variables=server_variables, servers=self.settings['servers']
- )
- except IndexError:
- if self.settings['servers']:
- raise ApiValueError(
- "Invalid host index. Must be 0 <= index < %s" %
- len(self.settings['servers'])
- )
- _host = None
-
- for key, value in kwargs.items():
- if key not in self.params_map['all']:
- raise ApiTypeError(
- "Got an unexpected parameter '%s'"
- " to method `%s`" %
- (key, self.settings['operation_id'])
- )
- # only throw this nullable ApiValueError if _check_input_type
- # is False, if _check_input_type==True we catch this case
- # in self.__validate_inputs
- if (key not in self.params_map['nullable'] and value is None
- and kwargs['_check_input_type'] is False):
- raise ApiValueError(
- "Value may not be None for non-nullable parameter `%s`"
- " when calling `%s`" %
- (key, self.settings['operation_id'])
- )
-
- for key in self.params_map['required']:
- if key not in kwargs.keys():
- raise ApiValueError(
- "Missing the required parameter `%s` when calling "
- "`%s`" % (key, self.settings['operation_id'])
- )
-
- self.__validate_inputs(kwargs)
-
- params = self.__gather_params(kwargs)
-
- accept_headers_list = self.headers_map['accept']
- if accept_headers_list:
- params['header']['Accept'] = self.api_client.select_header_accept(
- accept_headers_list)
-
- content_type_headers_list = self.headers_map['content_type']
- if content_type_headers_list:
- header_list = self.api_client.select_header_content_type(
- content_type_headers_list)
- params['header']['Content-Type'] = header_list
-
- return self.api_client.call_api(
- self.settings['endpoint_path'], self.settings['http_method'],
- params['path'],
- params['query'],
- params['header'],
- body=params['body'],
- post_params=params['form'],
- files=params['file'],
- response_type=self.settings['response_type'],
- auth_settings=self.settings['auth'],
- async_req=kwargs['async_req'],
- _check_type=kwargs['_check_return_type'],
- _return_http_data_only=kwargs['_return_http_data_only'],
- _preload_content=kwargs['_preload_content'],
- _request_timeout=kwargs['_request_timeout'],
- _host=_host,
- collection_formats=params['collection_format'])
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py
deleted file mode 100644
index 248531dac14f..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py
+++ /dev/null
@@ -1,104 +0,0 @@
-# coding: utf-8
-
-# flake8: noqa
-
-# import all models into this package
-# if you have many models here with many references from one model to another this may
-# raise a RecursionError
-# to avoid this, import only the models that you directly need like:
-# from from petstore_api.model.pet import Pet
-# or import this package, but before doing it, use:
-# import sys
-# sys.setrecursionlimit(n)
-
-from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
-from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
-from petstore_api.model.address import Address
-from petstore_api.model.animal import Animal
-from petstore_api.model.animal_farm import AnimalFarm
-from petstore_api.model.api_response import ApiResponse
-from petstore_api.model.apple import Apple
-from petstore_api.model.apple_req import AppleReq
-from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-from petstore_api.model.array_of_enums import ArrayOfEnums
-from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
-from petstore_api.model.array_test import ArrayTest
-from petstore_api.model.banana import Banana
-from petstore_api.model.banana_req import BananaReq
-from petstore_api.model.basque_pig import BasquePig
-from petstore_api.model.capitalization import Capitalization
-from petstore_api.model.cat import Cat
-from petstore_api.model.cat_all_of import CatAllOf
-from petstore_api.model.category import Category
-from petstore_api.model.child_cat import ChildCat
-from petstore_api.model.child_cat_all_of import ChildCatAllOf
-from petstore_api.model.class_model import ClassModel
-from petstore_api.model.client import Client
-from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral
-from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations
-from petstore_api.model.danish_pig import DanishPig
-from petstore_api.model.dog import Dog
-from petstore_api.model.dog_all_of import DogAllOf
-from petstore_api.model.drawing import Drawing
-from petstore_api.model.enum_arrays import EnumArrays
-from petstore_api.model.enum_class import EnumClass
-from petstore_api.model.enum_test import EnumTest
-from petstore_api.model.equilateral_triangle import EquilateralTriangle
-from petstore_api.model.file import File
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
-from petstore_api.model.foo import Foo
-from petstore_api.model.format_test import FormatTest
-from petstore_api.model.fruit import Fruit
-from petstore_api.model.fruit_req import FruitReq
-from petstore_api.model.gm_fruit import GmFruit
-from petstore_api.model.grandparent_animal import GrandparentAnimal
-from petstore_api.model.has_only_read_only import HasOnlyReadOnly
-from petstore_api.model.health_check_result import HealthCheckResult
-from petstore_api.model.inline_object import InlineObject
-from petstore_api.model.inline_object1 import InlineObject1
-from petstore_api.model.inline_object2 import InlineObject2
-from petstore_api.model.inline_object3 import InlineObject3
-from petstore_api.model.inline_object4 import InlineObject4
-from petstore_api.model.inline_object5 import InlineObject5
-from petstore_api.model.inline_response_default import InlineResponseDefault
-from petstore_api.model.integer_enum import IntegerEnum
-from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue
-from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue
-from petstore_api.model.isosceles_triangle import IsoscelesTriangle
-from petstore_api.model.list import List
-from petstore_api.model.mammal import Mammal
-from petstore_api.model.map_test import MapTest
-from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-from petstore_api.model.model200_response import Model200Response
-from petstore_api.model.model_return import ModelReturn
-from petstore_api.model.name import Name
-from petstore_api.model.nullable_class import NullableClass
-from petstore_api.model.nullable_shape import NullableShape
-from petstore_api.model.number_only import NumberOnly
-from petstore_api.model.number_with_validations import NumberWithValidations
-from petstore_api.model.object_interface import ObjectInterface
-from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
-from petstore_api.model.object_with_validations import ObjectWithValidations
-from petstore_api.model.order import Order
-from petstore_api.model.parent_pet import ParentPet
-from petstore_api.model.pet import Pet
-from petstore_api.model.pig import Pig
-from petstore_api.model.quadrilateral import Quadrilateral
-from petstore_api.model.quadrilateral_interface import QuadrilateralInterface
-from petstore_api.model.read_only_first import ReadOnlyFirst
-from petstore_api.model.scalene_triangle import ScaleneTriangle
-from petstore_api.model.shape import Shape
-from petstore_api.model.shape_interface import ShapeInterface
-from petstore_api.model.shape_or_null import ShapeOrNull
-from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral
-from petstore_api.model.some_object import SomeObject
-from petstore_api.model.special_model_name import SpecialModelName
-from petstore_api.model.string_boolean_map import StringBooleanMap
-from petstore_api.model.string_enum import StringEnum
-from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue
-from petstore_api.model.tag import Tag
-from petstore_api.model.triangle import Triangle
-from petstore_api.model.triangle_interface import TriangleInterface
-from petstore_api.model.user import User
-from petstore_api.model.whale import Whale
-from petstore_api.model.zebra import Zebra
diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt
deleted file mode 100644
index 36d9b4fa7a8c..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-pytest~=4.6.7 # needed for python 3.4
-pytest-cov>=2.8.1
-pytest-randomly==1.2.3 # needed for python 3.4
-pycryptodome>=3.9.0
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py
deleted file mode 100644
index 42fdf1948736..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
-
-
-class TestAdditionalPropertiesClass(unittest.TestCase):
- """AdditionalPropertiesClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAdditionalPropertiesClass(self):
- """Test AdditionalPropertiesClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = AdditionalPropertiesClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py
deleted file mode 100644
index a35e4c3469e4..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.cat import Cat
-from petstore_api.model.dog import Dog
-globals()['Cat'] = Cat
-globals()['Dog'] = Dog
-from petstore_api.model.animal import Animal
-
-
-class TestAnimal(unittest.TestCase):
- """Animal unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testAnimal(self):
- """Test Animal"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Animal() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py
deleted file mode 100644
index a9a900c29cfa..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.api_response import ApiResponse
-
-
-class TestApiResponse(unittest.TestCase):
- """ApiResponse unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testApiResponse(self):
- """Test ApiResponse"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ApiResponse() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py
deleted file mode 100644
index 39f8874a4e81..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-
-
-class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
- """ArrayOfArrayOfNumberOnly unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testArrayOfArrayOfNumberOnly(self):
- """Test ArrayOfArrayOfNumberOnly"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ArrayOfArrayOfNumberOnly() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py
deleted file mode 100644
index c4abfd068614..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
-
-
-class TestArrayOfNumberOnly(unittest.TestCase):
- """ArrayOfNumberOnly unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testArrayOfNumberOnly(self):
- """Test ArrayOfNumberOnly"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ArrayOfNumberOnly() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py
deleted file mode 100644
index 5f47ddb4db09..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.capitalization import Capitalization
-
-
-class TestCapitalization(unittest.TestCase):
- """Capitalization unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testCapitalization(self):
- """Test Capitalization"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Capitalization() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py
deleted file mode 100644
index 3d5a33d9907b..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.cat_all_of import CatAllOf
-
-
-class TestCatAllOf(unittest.TestCase):
- """CatAllOf unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testCatAllOf(self):
- """Test CatAllOf"""
- # FIXME: construct object with mandatory attributes with example values
- # model = CatAllOf() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py
deleted file mode 100644
index 29490e0dbdb1..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_category.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.category import Category
-
-
-class TestCategory(unittest.TestCase):
- """Category unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testCategory(self):
- """Test Category"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Category() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py
deleted file mode 100644
index 6dc2a6928321..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.class_model import ClassModel
-
-
-class TestClassModel(unittest.TestCase):
- """ClassModel unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testClassModel(self):
- """Test ClassModel"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ClassModel() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py
deleted file mode 100644
index caf85a24aa27..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_client.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.client import Client
-
-
-class TestClient(unittest.TestCase):
- """Client unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testClient(self):
- """Test Client"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Client() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py
deleted file mode 100644
index 9f5075b7ed71..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.dog_all_of import DogAllOf
-
-
-class TestDogAllOf(unittest.TestCase):
- """DogAllOf unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testDogAllOf(self):
- """Test DogAllOf"""
- # FIXME: construct object with mandatory attributes with example values
- # model = DogAllOf() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py
deleted file mode 100644
index ed19c7985d4e..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.enum_class import EnumClass
-
-
-class TestEnumClass(unittest.TestCase):
- """EnumClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testEnumClass(self):
- """Test EnumClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = EnumClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py
deleted file mode 100644
index 7b0599f5a987..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.integer_enum import IntegerEnum
-from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue
-from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue
-from petstore_api.model.string_enum import StringEnum
-from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue
-globals()['IntegerEnum'] = IntegerEnum
-globals()['IntegerEnumOneValue'] = IntegerEnumOneValue
-globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue
-globals()['StringEnum'] = StringEnum
-globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue
-from petstore_api.model.enum_test import EnumTest
-
-
-class TestEnumTest(unittest.TestCase):
- """EnumTest unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testEnumTest(self):
- """Test EnumTest"""
- # FIXME: construct object with mandatory attributes with example values
- # model = EnumTest() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py
deleted file mode 100644
index 438482f39525..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_file.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.file import File
-
-
-class TestFile(unittest.TestCase):
- """File unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testFile(self):
- """Test File"""
- # FIXME: construct object with mandatory attributes with example values
- # model = File() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py
deleted file mode 100644
index 6366cd33470c..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.file import File
-globals()['File'] = File
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
-
-
-class TestFileSchemaTestClass(unittest.TestCase):
- """FileSchemaTestClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testFileSchemaTestClass(self):
- """Test FileSchemaTestClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = FileSchemaTestClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py
deleted file mode 100644
index 648a84c66f7c..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.foo import Foo
-
-
-class TestFoo(unittest.TestCase):
- """Foo unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testFoo(self):
- """Test Foo"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Foo() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py
deleted file mode 100644
index a5441cec1c97..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.format_test import FormatTest
-
-
-class TestFormatTest(unittest.TestCase):
- """FormatTest unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testFormatTest(self):
- """Test FormatTest"""
- # FIXME: construct object with mandatory attributes with example values
- # model = FormatTest() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py
deleted file mode 100644
index c9bf4c28658a..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.has_only_read_only import HasOnlyReadOnly
-
-
-class TestHasOnlyReadOnly(unittest.TestCase):
- """HasOnlyReadOnly unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testHasOnlyReadOnly(self):
- """Test HasOnlyReadOnly"""
- # FIXME: construct object with mandatory attributes with example values
- # model = HasOnlyReadOnly() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py
deleted file mode 100644
index 35f4d3afa989..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.health_check_result import HealthCheckResult
-
-
-class TestHealthCheckResult(unittest.TestCase):
- """HealthCheckResult unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testHealthCheckResult(self):
- """Test HealthCheckResult"""
- # FIXME: construct object with mandatory attributes with example values
- # model = HealthCheckResult() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py
deleted file mode 100644
index 3e391022d516..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.inline_object import InlineObject
-
-
-class TestInlineObject(unittest.TestCase):
- """InlineObject unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineObject(self):
- """Test InlineObject"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineObject() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py
deleted file mode 100644
index 982e20e0c6f4..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.inline_object1 import InlineObject1
-
-
-class TestInlineObject1(unittest.TestCase):
- """InlineObject1 unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineObject1(self):
- """Test InlineObject1"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineObject1() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py
deleted file mode 100644
index 133e31acb200..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.inline_object2 import InlineObject2
-
-
-class TestInlineObject2(unittest.TestCase):
- """InlineObject2 unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineObject2(self):
- """Test InlineObject2"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineObject2() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py
deleted file mode 100644
index 69bf17c56c2d..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.inline_object3 import InlineObject3
-
-
-class TestInlineObject3(unittest.TestCase):
- """InlineObject3 unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineObject3(self):
- """Test InlineObject3"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineObject3() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py
deleted file mode 100644
index 727596be5e5d..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.inline_object4 import InlineObject4
-
-
-class TestInlineObject4(unittest.TestCase):
- """InlineObject4 unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineObject4(self):
- """Test InlineObject4"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineObject4() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py
deleted file mode 100644
index 1ef579b8e307..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.inline_object5 import InlineObject5
-
-
-class TestInlineObject5(unittest.TestCase):
- """InlineObject5 unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineObject5(self):
- """Test InlineObject5"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineObject5() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py
deleted file mode 100644
index 3b3fc2ddcdf7..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.foo import Foo
-globals()['Foo'] = Foo
-from petstore_api.model.inline_response_default import InlineResponseDefault
-
-
-class TestInlineResponseDefault(unittest.TestCase):
- """InlineResponseDefault unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testInlineResponseDefault(self):
- """Test InlineResponseDefault"""
- # FIXME: construct object with mandatory attributes with example values
- # model = InlineResponseDefault() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py
deleted file mode 100644
index 77611c300dc8..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_list.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.list import List
-
-
-class TestList(unittest.TestCase):
- """List unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testList(self):
- """Test List"""
- # FIXME: construct object with mandatory attributes with example values
- # model = List() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py
deleted file mode 100644
index 9cddd802e56e..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.string_boolean_map import StringBooleanMap
-globals()['StringBooleanMap'] = StringBooleanMap
-from petstore_api.model.map_test import MapTest
-
-
-class TestMapTest(unittest.TestCase):
- """MapTest unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testMapTest(self):
- """Test MapTest"""
- # FIXME: construct object with mandatory attributes with example values
- # model = MapTest() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py
deleted file mode 100644
index 60b774977965..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.animal import Animal
-globals()['Animal'] = Animal
-from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-
-
-class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
- """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testMixedPropertiesAndAdditionalPropertiesClass(self):
- """Test MixedPropertiesAndAdditionalPropertiesClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py
deleted file mode 100644
index 8ff474d5dde3..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.model200_response import Model200Response
-
-
-class TestModel200Response(unittest.TestCase):
- """Model200Response unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testModel200Response(self):
- """Test Model200Response"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Model200Response() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py
deleted file mode 100644
index f856d3d76206..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.model_return import ModelReturn
-
-
-class TestModelReturn(unittest.TestCase):
- """ModelReturn unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testModelReturn(self):
- """Test ModelReturn"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ModelReturn() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py
deleted file mode 100644
index b3841ca0304f..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_name.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.name import Name
-
-
-class TestName(unittest.TestCase):
- """Name unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testName(self):
- """Test Name"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Name() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py
deleted file mode 100644
index 730e9264ef9d..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.nullable_class import NullableClass
-
-
-class TestNullableClass(unittest.TestCase):
- """NullableClass unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testNullableClass(self):
- """Test NullableClass"""
- # FIXME: construct object with mandatory attributes with example values
- # model = NullableClass() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py
deleted file mode 100644
index b7205f5fe029..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.number_only import NumberOnly
-
-
-class TestNumberOnly(unittest.TestCase):
- """NumberOnly unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testNumberOnly(self):
- """Test NumberOnly"""
- # FIXME: construct object with mandatory attributes with example values
- # model = NumberOnly() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py
deleted file mode 100644
index 0d77e022738b..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.category import Category
-from petstore_api.model.tag import Tag
-globals()['Category'] = Category
-globals()['Tag'] = Tag
-from petstore_api.model.pet import Pet
-
-
-class TestPet(unittest.TestCase):
- """Pet unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testPet(self):
- """Test Pet"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Pet() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py
deleted file mode 100644
index a07676e9c2de..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.read_only_first import ReadOnlyFirst
-
-
-class TestReadOnlyFirst(unittest.TestCase):
- """ReadOnlyFirst unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testReadOnlyFirst(self):
- """Test ReadOnlyFirst"""
- # FIXME: construct object with mandatory attributes with example values
- # model = ReadOnlyFirst() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py
deleted file mode 100644
index 4c525d99be5b..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.special_model_name import SpecialModelName
-
-
-class TestSpecialModelName(unittest.TestCase):
- """SpecialModelName unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testSpecialModelName(self):
- """Test SpecialModelName"""
- # FIXME: construct object with mandatory attributes with example values
- # model = SpecialModelName() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py
deleted file mode 100644
index 0ce1c0a87f1d..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.tag import Tag
-
-
-class TestTag(unittest.TestCase):
- """Tag unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testTag(self):
- """Test Tag"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Tag() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py
deleted file mode 100644
index df3d2fff6532..000000000000
--- a/samples/openapi3/client/petstore/python-experimental/test/test_user.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# coding: utf-8
-
-"""
- OpenAPI Petstore
-
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-import sys
-import unittest
-
-import petstore_api
-from petstore_api.model.user import User
-
-
-class TestUser(unittest.TestCase):
- """User unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testUser(self):
- """Test User"""
- # FIXME: construct object with mandatory attributes with example values
- # model = User() # noqa: E501
- pass
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/.gitignore b/samples/openapi3/client/petstore/python-legacy/.gitignore
new file mode 100755
index 000000000000..43995bd42fa2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/.gitignore
@@ -0,0 +1,66 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.venv/
+.python-version
+.pytest_cache
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
diff --git a/samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml
new file mode 100755
index 000000000000..142ce3712ed0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml
@@ -0,0 +1,33 @@
+# ref: https://docs.gitlab.com/ee/ci/README.html
+
+stages:
+ - test
+
+.nosetest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov=petstore_api
+
+nosetest-2.7:
+ extends: .nosetest
+ image: python:2.7-alpine
+nosetest-3.3:
+ extends: .nosetest
+ image: python:3.3-alpine
+nosetest-3.4:
+ extends: .nosetest
+ image: python:3.4-alpine
+nosetest-3.5:
+ extends: .nosetest
+ image: python:3.5-alpine
+nosetest-3.6:
+ extends: .nosetest
+ image: python:3.6-alpine
+nosetest-3.7:
+ extends: .nosetest
+ image: python:3.7-alpine
+nosetest-3.8:
+ extends: .nosetest
+ image: python:3.8-alpine
diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-legacy/.openapi-generator-ignore
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore
rename to samples/openapi3/client/petstore/python-legacy/.openapi-generator-ignore
diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES
new file mode 100755
index 000000000000..1607b2b462b9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES
@@ -0,0 +1,130 @@
+.gitignore
+.gitlab-ci.yml
+.travis.yml
+README.md
+docs/AdditionalPropertiesClass.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/ApiResponse.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ClassModel.md
+docs/Client.md
+docs/DefaultApi.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/File.md
+docs/FileSchemaTestClass.md
+docs/Foo.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/HealthCheckResult.md
+docs/InlineObject.md
+docs/InlineObject1.md
+docs/InlineObject2.md
+docs/InlineObject3.md
+docs/InlineObject4.md
+docs/InlineObject5.md
+docs/InlineResponseDefault.md
+docs/List.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NullableClass.md
+docs/NumberOnly.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/OuterEnumDefaultValue.md
+docs/OuterEnumInteger.md
+docs/OuterEnumIntegerDefaultValue.md
+docs/Pet.md
+docs/PetApi.md
+docs/ReadOnlyFirst.md
+docs/SpecialModelName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/User.md
+docs/UserApi.md
+git_push.sh
+petstore_api/__init__.py
+petstore_api/api/__init__.py
+petstore_api/api/another_fake_api.py
+petstore_api/api/default_api.py
+petstore_api/api/fake_api.py
+petstore_api/api/fake_classname_tags_123_api.py
+petstore_api/api/pet_api.py
+petstore_api/api/store_api.py
+petstore_api/api/user_api.py
+petstore_api/api_client.py
+petstore_api/configuration.py
+petstore_api/exceptions.py
+petstore_api/models/__init__.py
+petstore_api/models/additional_properties_class.py
+petstore_api/models/animal.py
+petstore_api/models/api_response.py
+petstore_api/models/array_of_array_of_number_only.py
+petstore_api/models/array_of_number_only.py
+petstore_api/models/array_test.py
+petstore_api/models/capitalization.py
+petstore_api/models/cat.py
+petstore_api/models/cat_all_of.py
+petstore_api/models/category.py
+petstore_api/models/class_model.py
+petstore_api/models/client.py
+petstore_api/models/dog.py
+petstore_api/models/dog_all_of.py
+petstore_api/models/enum_arrays.py
+petstore_api/models/enum_class.py
+petstore_api/models/enum_test.py
+petstore_api/models/file.py
+petstore_api/models/file_schema_test_class.py
+petstore_api/models/foo.py
+petstore_api/models/format_test.py
+petstore_api/models/has_only_read_only.py
+petstore_api/models/health_check_result.py
+petstore_api/models/inline_object.py
+petstore_api/models/inline_object1.py
+petstore_api/models/inline_object2.py
+petstore_api/models/inline_object3.py
+petstore_api/models/inline_object4.py
+petstore_api/models/inline_object5.py
+petstore_api/models/inline_response_default.py
+petstore_api/models/list.py
+petstore_api/models/map_test.py
+petstore_api/models/mixed_properties_and_additional_properties_class.py
+petstore_api/models/model200_response.py
+petstore_api/models/model_return.py
+petstore_api/models/name.py
+petstore_api/models/nullable_class.py
+petstore_api/models/number_only.py
+petstore_api/models/order.py
+petstore_api/models/outer_composite.py
+petstore_api/models/outer_enum.py
+petstore_api/models/outer_enum_default_value.py
+petstore_api/models/outer_enum_integer.py
+petstore_api/models/outer_enum_integer_default_value.py
+petstore_api/models/pet.py
+petstore_api/models/read_only_first.py
+petstore_api/models/special_model_name.py
+petstore_api/models/tag.py
+petstore_api/models/user.py
+petstore_api/rest.py
+requirements.txt
+setup.cfg
+setup.py
+test-requirements.txt
+test/__init__.py
+tox.ini
diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION
rename to samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION
diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-legacy/.travis.yml
old mode 100644
new mode 100755
similarity index 88%
rename from samples/openapi3/client/petstore/python-experimental/.travis.yml
rename to samples/openapi3/client/petstore/python-legacy/.travis.yml
index f931f0f74b96..fcd7e31c7ccf
--- a/samples/openapi3/client/petstore/python-experimental/.travis.yml
+++ b/samples/openapi3/client/petstore/python-legacy/.travis.yml
@@ -1,6 +1,10 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
+ - "2.7"
+ - "3.2"
+ - "3.3"
+ - "3.4"
- "3.5"
- "3.6"
- "3.7"
diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-legacy/Makefile
old mode 100644
new mode 100755
similarity index 77%
rename from samples/openapi3/client/petstore/python-experimental/Makefile
rename to samples/openapi3/client/petstore/python-legacy/Makefile
index f8957d5ed65d..ba5c5e73c63c
--- a/samples/openapi3/client/petstore/python-experimental/Makefile
+++ b/samples/openapi3/client/petstore/python-legacy/Makefile
@@ -1,3 +1,5 @@
+ #!/bin/bash
+
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
@@ -13,4 +15,7 @@ clean:
find . -name "__pycache__" -delete
test: clean
- bash ./test_python.sh
+ bash ./test_python2.sh
+
+test-all: clean
+ bash ./test_python2_and_3.sh
diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-legacy/README.md
old mode 100644
new mode 100755
similarity index 67%
rename from samples/openapi3/client/petstore/python-experimental/README.md
rename to samples/openapi3/client/petstore/python-legacy/README.md
index 14d81557bcce..801d1515ceab
--- a/samples/openapi3/client/petstore/python-experimental/README.md
+++ b/samples/openapi3/client/petstore/python-legacy/README.md
@@ -5,11 +5,11 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen
+- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen
## Requirements.
-Python >= 3.5
+Python 2.7 and 3.4+
## Installation & Usage
### pip install
@@ -45,12 +45,13 @@ import petstore_api
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
+from __future__ import print_function
import datetime
import time
import petstore_api
+from petstore_api.rest import ApiException
from pprint import pprint
-from petstore_api.api import another_fake_api
-from petstore_api.model.client import Client
+
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
@@ -62,17 +63,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = another_fake_api.AnotherFakeApi(api_client)
- client = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+
```
## Documentation for API Endpoints
@@ -83,17 +83,12 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
-*FakeApi* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
-*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
-*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums
-*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean |
-*FakeApi* | [**composed_one_of_number_with_validations**](docs/FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations |
*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
-*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal |
-*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
-*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
-*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
-*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
+*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
@@ -130,46 +125,26 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md)
- - [Address](docs/Address.md)
- [Animal](docs/Animal.md)
- - [AnimalFarm](docs/AnimalFarm.md)
- [ApiResponse](docs/ApiResponse.md)
- - [Apple](docs/Apple.md)
- - [AppleReq](docs/AppleReq.md)
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- - [ArrayOfEnums](docs/ArrayOfEnums.md)
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
- - [Banana](docs/Banana.md)
- - [BananaReq](docs/BananaReq.md)
- - [BasquePig](docs/BasquePig.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [CatAllOf](docs/CatAllOf.md)
- [Category](docs/Category.md)
- - [ChildCat](docs/ChildCat.md)
- - [ChildCatAllOf](docs/ChildCatAllOf.md)
- [ClassModel](docs/ClassModel.md)
- [Client](docs/Client.md)
- - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
- - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md)
- - [DanishPig](docs/DanishPig.md)
- [Dog](docs/Dog.md)
- [DogAllOf](docs/DogAllOf.md)
- - [Drawing](docs/Drawing.md)
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- - [EquilateralTriangle](docs/EquilateralTriangle.md)
- [File](docs/File.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FormatTest](docs/FormatTest.md)
- - [Fruit](docs/Fruit.md)
- - [FruitReq](docs/FruitReq.md)
- - [GmFruit](docs/GmFruit.md)
- - [GrandparentAnimal](docs/GrandparentAnimal.md)
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [HealthCheckResult](docs/HealthCheckResult.md)
- [InlineObject](docs/InlineObject.md)
@@ -179,47 +154,25 @@ Class | Method | HTTP request | Description
- [InlineObject4](docs/InlineObject4.md)
- [InlineObject5](docs/InlineObject5.md)
- [InlineResponseDefault](docs/InlineResponseDefault.md)
- - [IntegerEnum](docs/IntegerEnum.md)
- - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md)
- - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md)
- - [IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [List](docs/List.md)
- - [Mammal](docs/Mammal.md)
- [MapTest](docs/MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model200Response.md)
- [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md)
- [NullableClass](docs/NullableClass.md)
- - [NullableShape](docs/NullableShape.md)
- [NumberOnly](docs/NumberOnly.md)
- - [NumberWithValidations](docs/NumberWithValidations.md)
- - [ObjectInterface](docs/ObjectInterface.md)
- - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md)
- - [ObjectWithValidations](docs/ObjectWithValidations.md)
- [Order](docs/Order.md)
- - [ParentPet](docs/ParentPet.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
+ - [OuterEnumInteger](docs/OuterEnumInteger.md)
+ - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [Pet](docs/Pet.md)
- - [Pig](docs/Pig.md)
- - [Quadrilateral](docs/Quadrilateral.md)
- - [QuadrilateralInterface](docs/QuadrilateralInterface.md)
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
- - [ScaleneTriangle](docs/ScaleneTriangle.md)
- - [Shape](docs/Shape.md)
- - [ShapeInterface](docs/ShapeInterface.md)
- - [ShapeOrNull](docs/ShapeOrNull.md)
- - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
- - [SomeObject](docs/SomeObject.md)
- [SpecialModelName](docs/SpecialModelName.md)
- - [StringBooleanMap](docs/StringBooleanMap.md)
- - [StringEnum](docs/StringEnum.md)
- - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md)
- [Tag](docs/Tag.md)
- - [Triangle](docs/Triangle.md)
- - [TriangleInterface](docs/TriangleInterface.md)
- [User](docs/User.md)
- - [Whale](docs/Whale.md)
- - [Zebra](docs/Zebra.md)
## Documentation For Authorization
@@ -251,7 +204,6 @@ Class | Method | HTTP request | Description
## http_signature_test
-- **Type**: HTTP signature authentication
## petstore_auth
@@ -269,22 +221,3 @@ Class | Method | HTTP request | Description
-## Notes for Large OpenAPI documents
-If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a
-RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
-
-Solution 1:
-Use specific imports for apis and models like:
-- `from petstore_api.api.default_api import DefaultApi`
-- `from petstore_api.model.pet import Pet`
-
-Solution 1:
-Before importing the package, adjust the maximum recursion limit as shown below:
-```
-import sys
-sys.setrecursionlimit(1500)
-import petstore_api
-from petstore_api.apis import *
-from petstore_api.models import *
-```
-
diff --git a/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt b/samples/openapi3/client/petstore/python-legacy/dev-requirements.txt
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/dev-requirements.txt
rename to samples/openapi3/client/petstore/python-legacy/dev-requirements.txt
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
new file mode 100755
index 000000000000..796a789d4c4b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,11 @@
+# AdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_property** | **dict(str, str)** | | [optional]
+**map_of_map_property** | **dict(str, dict(str, str))** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-legacy/docs/Animal.md
old mode 100644
new mode 100755
similarity index 76%
rename from samples/openapi3/client/petstore/python-experimental/docs/Animal.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Animal.md
index 698dc711aeb9..7ed4ba541fa3
--- a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Animal.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
-**color** | **str** | | [optional] if omitted the server will use the default value of "red"
+**color** | **str** | | [optional] [default to 'red']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md
old mode 100644
new mode 100755
similarity index 81%
rename from samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md
rename to samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md
index 402031d6beef..ecd52ad7705d
--- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md
@@ -17,10 +17,10 @@ To test special tags and operation ID starting with number
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import another_fake_api
-from petstore_api.model.client import Client
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -32,17 +32,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = another_fake_api.AnotherFakeApi(api_client)
- client = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
- # example passing only required values which don't have defaults set
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
```
@@ -50,7 +47,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **client** | [**Client**](Client.md)| client model |
+ **client** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-legacy/docs/ApiResponse.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ApiResponse.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md
old mode 100644
new mode 100755
similarity index 82%
rename from samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md
index 1a68df0090bb..aa3988ab1679
--- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_array_number** | **[[float]]** | | [optional]
+**array_array_number** | **list[list[float]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md
old mode 100644
new mode 100755
similarity index 85%
rename from samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md
index b8a760f56dc2..2c3de967aec6
--- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_number** | **[float]** | | [optional]
+**array_number** | **list[float]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md
old mode 100644
new mode 100755
similarity index 59%
rename from samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md
index b94f23fd2271..6ab0d1378065
--- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md
@@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_of_string** | **[str]** | | [optional]
-**array_array_of_integer** | **[[int]]** | | [optional]
-**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional]
+**array_of_string** | **list[str]** | | [optional]
+**array_array_of_integer** | **list[list[int]]** | | [optional]
+**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-legacy/docs/Capitalization.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Capitalization.md
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Cat.md b/samples/openapi3/client/petstore/python-legacy/docs/Cat.md
new file mode 100755
index 000000000000..8d30565d014e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Cat.md
@@ -0,0 +1,10 @@
+# Cat
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-legacy/docs/CatAllOf.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md
rename to samples/openapi3/client/petstore/python-legacy/docs/CatAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-legacy/docs/Category.md
old mode 100644
new mode 100755
similarity index 86%
rename from samples/client/petstore/python-experimental/docs/Category.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Category.md
index 287225d66fd7..7e5c1e316499
--- a/samples/client/petstore/python-experimental/docs/Category.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Category.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | | defaults to "default-name"
**id** | **int** | | [optional]
+**name** | **str** | | [default to 'default-name']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-legacy/docs/ClassModel.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ClassModel.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-legacy/docs/Client.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Client.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Client.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md
old mode 100644
new mode 100755
similarity index 84%
rename from samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md
rename to samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md
index 3fffa95ff343..7f022fd7d3eb
--- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md
@@ -15,10 +15,10 @@ Method | HTTP request | Description
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import default_api
-from petstore_api.model.inline_response_default import InlineResponseDefault
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -30,13 +30,12 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = default_api.DefaultApi(api_client)
-
- # example, this endpoint has no required or optional parameters
+ api_instance = petstore_api.DefaultApi(api_client)
+
try:
api_response = api_instance.foo_get()
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling DefaultApi->foo_get: %s\n" % e)
```
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Dog.md b/samples/openapi3/client/petstore/python-legacy/docs/Dog.md
new file mode 100755
index 000000000000..f727487975c4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Dog.md
@@ -0,0 +1,10 @@
+# Dog
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-legacy/docs/DogAllOf.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md
rename to samples/openapi3/client/petstore/python-legacy/docs/DogAllOf.md
diff --git a/samples/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md
old mode 100644
new mode 100755
similarity index 87%
rename from samples/client/petstore/python-experimental/docs/EnumArrays.md
rename to samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md
index e0b5582e9d5b..e15a5f1fd049
--- a/samples/client/petstore/python-experimental/docs/EnumArrays.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**just_symbol** | **str** | | [optional]
-**array_enum** | **[str]** | | [optional]
+**array_enum** | **list[str]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md b/samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md
new file mode 100755
index 000000000000..67f017becd0c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md
@@ -0,0 +1,9 @@
+# EnumClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md b/samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md
new file mode 100755
index 000000000000..bd1e2beb90d3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md
@@ -0,0 +1,17 @@
+# EnumTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enum_string** | **str** | | [optional]
+**enum_string_required** | **str** | |
+**enum_integer** | **int** | | [optional]
+**enum_number** | **float** | | [optional]
+**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
+**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
+**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
old mode 100644
new mode 100755
similarity index 50%
rename from samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md
rename to samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
index a5cbcb9e0f7e..50de8cc758fa
--- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
@@ -4,17 +4,12 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**additional_properties_with_array_of_enums**](FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
-[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
-[**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums
-[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean |
-[**composed_one_of_number_with_validations**](FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations |
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
-[**mammal**](FakeApi.md#mammal) | **POST** /fake/refs/mammal |
-[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
-[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
-[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
-[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
+[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
@@ -26,18 +21,18 @@ Method | HTTP request | Description
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
-# **additional_properties_with_array_of_enums**
-> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums()
+# **fake_health_get**
+> HealthCheckResult fake_health_get()
-Additional Properties with Array of Enums
+Health check endpoint
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -49,32 +44,22 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- additional_properties_with_array_of_enums = AdditionalPropertiesWithArrayOfEnums(
- "key": [
- EnumClass("-efg"),
- ],
- ) # AdditionalPropertiesWithArrayOfEnums | Input enum (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
+ api_instance = petstore_api.FakeApi(api_client)
+
try:
- # Additional Properties with Array of Enums
- api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums=additional_properties_with_array_of_enums)
+ # Health check endpoint
+ api_response = api_instance.fake_health_get()
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
```
### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **additional_properties_with_array_of_enums** | [**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional]
+This endpoint does not need any parameter.
### Return type
-[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)
+[**HealthCheckResult**](HealthCheckResult.md)
### Authorization
@@ -82,30 +67,28 @@ No authorization required
### HTTP request headers
- - **Content-Type**: application/json
+ - **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Got object with additional properties with array of enums | - |
+**200** | The instance started successfully | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **array_model**
-> AnimalFarm array_model()
+# **fake_http_signature_test**
+> fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
-
-
-Test serialization of ArrayModel
+test http signature authentication
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.animal_farm import AnimalFarm
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -113,116 +96,116 @@ configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = AnimalFarm([
- Animal(),
- ]) # AnimalFarm | Input model (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- api_response = api_instance.array_model(body=body)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->array_model: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional]
-
-### Return type
-
-[**AnimalFarm**](AnimalFarm.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Output model | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **array_of_enums**
-> ArrayOfEnums array_of_enums()
-
-Array of Enums
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.array_of_enums import ArrayOfEnums
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
)
-
# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
+with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- array_of_enums = ArrayOfEnums([
- StringEnum("placed"),
- ]) # ArrayOfEnums | Input enum (optional)
+ api_instance = petstore_api.FakeApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+query_1 = 'query_1_example' # str | query parameter (optional)
+header_1 = 'header_1_example' # str | header parameter (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- # Array of Enums
- api_response = api_instance.array_of_enums(array_of_enums=array_of_enums)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->array_of_enums: %s\n" % e)
+ # test http signature authentication
+ api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **array_of_enums** | [**ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional]
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **query_1** | **str**| query parameter | [optional]
+ **header_1** | **str**| header parameter | [optional]
### Return type
-[**ArrayOfEnums**](ArrayOfEnums.md)
+void (empty response body)
### Authorization
-No authorization required
+[http_signature_test](../README.md#http_signature_test)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Got named array of enums | - |
+**200** | The instance started successfully | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **boolean**
-> bool boolean()
+# **fake_outer_boolean_serialize**
+> bool fake_outer_boolean_serialize(body=body)
@@ -231,9 +214,10 @@ Test serialization of outer boolean types
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -245,23 +229,21 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
+ api_instance = petstore_api.FakeApi(api_client)
body = True # bool | Input boolean as post body (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- api_response = api_instance.boolean(body=body)
+ api_response = api_instance.fake_outer_boolean_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->boolean: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **bool**| Input boolean as post body | [optional]
+ **body** | **bool**| Input boolean as post body | [optional]
### Return type
@@ -274,7 +256,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: application/json
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
@@ -283,81 +265,20 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **composed_one_of_number_with_validations**
-> ComposedOneOfNumberWithValidations composed_one_of_number_with_validations()
-
-
-
-Test serialization of object with $refed properties
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- composed_one_of_number_with_validations = ComposedOneOfNumberWithValidations() # ComposedOneOfNumberWithValidations | Input model (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations=composed_one_of_number_with_validations)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->composed_one_of_number_with_validations: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **composed_one_of_number_with_validations** | [**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional]
-
-### Return type
-
-[**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)
+# **fake_outer_composite_serialize**
+> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Output model | - |
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_health_get**
-> HealthCheckResult fake_health_get()
-
-Health check endpoint
+Test serialization of object with outer number type
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.health_check_result import HealthCheckResult
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -369,89 +290,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
-
- # example, this endpoint has no required or optional parameters
- try:
- # Health check endpoint
- api_response = api_instance.fake_health_get()
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**HealthCheckResult**](HealthCheckResult.md)
-
-### Authorization
-
-No authorization required
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | The instance started successfully | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **mammal**
-> Mammal mammal(mammal)
-
-
-
-Test serialization of mammals
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.mammal import Mammal
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- mammal = Mammal(
- has_baleen=True,
- has_teeth=True,
- class_name="whale",
- ) # Mammal | Input mammal
-
- # example passing only required values which don't have defaults set
try:
- api_response = api_instance.mammal(mammal)
+ api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->mammal: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **mammal** | [**Mammal**](Mammal.md)| Input mammal |
+ **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
-[**Mammal**](Mammal.md)
+[**OuterComposite**](OuterComposite.md)
### Authorization
@@ -460,17 +317,17 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: application/json
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output mammal | - |
+**200** | Output composite | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **number_with_validations**
-> NumberWithValidations number_with_validations()
+# **fake_outer_number_serialize**
+> float fake_outer_number_serialize(body=body)
@@ -479,10 +336,10 @@ Test serialization of outer number types
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.number_with_validations import NumberWithValidations
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -494,27 +351,25 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = NumberWithValidations(10) # NumberWithValidations | Input number as post body (optional)
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 3.4 # float | Input number as post body (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- api_response = api_instance.number_with_validations(body=body)
+ api_response = api_instance.fake_outer_number_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->number_with_validations: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional]
+ **body** | **float**| Input number as post body | [optional]
### Return type
-[**NumberWithValidations**](NumberWithValidations.md)
+**float**
### Authorization
@@ -523,7 +378,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: application/json
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
@@ -532,75 +387,8 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **object_model_with_ref_props**
-> ObjectModelWithRefProps object_model_with_ref_props()
-
-
-
-Test serialization of object with $refed properties
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = ObjectModelWithRefProps(
- my_number=NumberWithValidations(10),
- my_string="my_string_example",
- my_boolean=True,
- ) # ObjectModelWithRefProps | Input model (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- api_response = api_instance.object_model_with_ref_props(body=body)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional]
-
-### Return type
-
-[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Output model | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
-# **string**
-> str string()
+# **fake_outer_string_serialize**
+> str fake_outer_string_serialize(body=body)
@@ -609,9 +397,10 @@ Test serialization of outer string types
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -623,23 +412,21 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = "body_example" # str | Input string as post body (optional)
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | Input string as post body (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
- api_response = api_instance.string(body=body)
+ api_response = api_instance.fake_outer_string_serialize(body=body)
pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->string: %s\n" % e)
+ except ApiException as e:
+ print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **str**| Input string as post body | [optional]
+ **body** | **str**| Input string as post body | [optional]
### Return type
@@ -652,7 +439,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: application/json
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
@@ -661,69 +448,6 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **string_enum**
-> StringEnum string_enum()
-
-
-
-Test serialization of outer enum
-
-### Example
-
-```python
-import time
-import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.string_enum import StringEnum
-from pprint import pprint
-# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
-# See configuration.py for a list of all supported configuration parameters.
-configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2"
-)
-
-
-# Enter a context with an instance of the API client
-with petstore_api.ApiClient() as api_client:
- # Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- body = StringEnum("placed") # StringEnum | Input enum (optional)
-
- # example passing only required values which don't have defaults set
- # and optional values
- try:
- api_response = api_instance.string_enum(body=body)
- pprint(api_response)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->string_enum: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional]
-
-### Return type
-
-[**StringEnum**](StringEnum.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Output enum | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
# **test_body_with_file_schema**
> test_body_with_file_schema(file_schema_test_class)
@@ -734,10 +458,10 @@ For this test, the body for this request much reference a schema named `File`.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -749,22 +473,12 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- file_schema_test_class = FileSchemaTestClass(
- file=File(
- source_uri="source_uri_example",
- ),
- files=[
- File(
- source_uri="source_uri_example",
- ),
- ],
- ) # FileSchemaTestClass |
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.FakeApi(api_client)
+ file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
+
try:
api_instance.test_body_with_file_schema(file_schema_test_class)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
@@ -772,7 +486,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+ **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
@@ -802,10 +516,10 @@ No authorization required
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -817,27 +531,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- query = "query_example" # str |
- user = User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- object_with_no_declared_props={},
- object_with_no_declared_props_nullable={},
- any_type_prop=None,
- any_type_prop_nullable=None,
- ) # User |
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.FakeApi(api_client)
+ query = 'query_example' # str |
+user = petstore_api.User() # User |
+
try:
api_instance.test_body_with_query_params(query, user)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
@@ -845,8 +545,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **query** | **str**| |
- **user** | [**User**](User.md)| |
+ **query** | **str**| |
+ **user** | [**User**](User.md)| |
### Return type
@@ -878,10 +578,10 @@ To test \"client\" model
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
-from petstore_api.model.client import Client
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -893,17 +593,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- client = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.FakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
- # example passing only required values which don't have defaults set
try:
# To test \"client\" model
api_response = api_instance.test_client_model(client)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
```
@@ -911,7 +608,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **client** | [**Client**](Client.md)| client model |
+ **client** | [**Client**](Client.md)| client model |
### Return type
@@ -934,7 +631,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_endpoint_parameters**
-> test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -944,9 +641,10 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
* Basic Authentication (http_basic_test):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -968,35 +666,26 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- number = 32.1 # float | None
- double = 67.8 # float | None
- pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C" # str | None
- byte = 'YQ==' # str | None
- integer = 10 # int | None (optional)
- int32 = 20 # int | None (optional)
- int64 = 1 # int | None (optional)
- float = 3.14 # float | None (optional)
- string = "a" # str | None (optional)
- binary = open('/path/to/file', 'rb') # file_type | None (optional)
- date = dateutil_parser('1970-01-01').date() # date | None (optional)
- date_time = dateutil_parser('2020-02-02T20:20:20.22222Z') # datetime | None (optional) if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
- password = "password_example" # str | None (optional)
- param_callback = "param_callback_example" # str | None (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+ api_instance = petstore_api.FakeApi(api_client)
+ number = 3.4 # float | None
+double = 3.4 # float | None
+pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
+byte = 'byte_example' # str | None
+integer = 56 # int | None (optional)
+int32 = 56 # int | None (optional)
+int64 = 56 # int | None (optional)
+float = 3.4 # float | None (optional)
+string = 'string_example' # str | None (optional)
+binary = '/path/to/file' # file | None (optional)
+date = '2013-10-20' # date | None (optional)
+date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
+password = 'password_example' # str | None (optional)
+param_callback = 'param_callback_example' # str | None (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
```
@@ -1004,20 +693,20 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **number** | **float**| None |
- **double** | **float**| None |
- **pattern_without_delimiter** | **str**| None |
- **byte** | **str**| None |
- **integer** | **int**| None | [optional]
- **int32** | **int**| None | [optional]
- **int64** | **int**| None | [optional]
- **float** | **float**| None | [optional]
- **string** | **str**| None | [optional]
- **binary** | **file_type**| None | [optional]
- **date** | **date**| None | [optional]
- **date_time** | **datetime**| None | [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
- **password** | **str**| None | [optional]
- **param_callback** | **str**| None | [optional]
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **file**| None | [optional]
+ **date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
### Return type
@@ -1041,7 +730,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_enum_parameters**
-> test_enum_parameters()
+> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
To test enum parameters
@@ -1050,9 +739,10 @@ To test enum parameters
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1064,26 +754,20 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- enum_header_string_array = [
- "$",
- ] # [str] | Header parameter enum test (string array) (optional)
- enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
- enum_query_string_array = [
- "$",
- ] # [str] | Query parameter enum test (string array) (optional)
- enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
- enum_query_integer = 1 # int | Query parameter enum test (double) (optional)
- enum_query_double = 1.1 # float | Query parameter enum test (double) (optional)
- enum_form_string_array = "$" # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$"
- enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
-
- # example passing only required values which don't have defaults set
- # and optional values
+ api_instance = petstore_api.FakeApi(api_client)
+ enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional)
+enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg')
+enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional)
+enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg')
+enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
+enum_query_double = 3.4 # float | Query parameter enum test (double) (optional)
+enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$')
+enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg')
+
try:
# To test enum parameters
api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e)
```
@@ -1091,14 +775,14 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional]
- **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
- **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional]
- **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
- **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
- **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
- **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$"
- **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+ **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional]
+ **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg']
+ **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional]
+ **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg']
+ **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
+ **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
+ **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$']
+ **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg']
### Return type
@@ -1122,7 +806,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_group_parameters**
-> test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
Fake endpoint to test group parameters (optional)
@@ -1132,9 +816,10 @@ Fake endpoint to test group parameters (optional)
* Bearer (JWT) Authentication (bearer_test):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1155,27 +840,18 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- required_string_group = 1 # int | Required String in group parameters
- required_boolean_group = True # bool | Required Boolean in group parameters
- required_int64_group = 1 # int | Required Integer in group parameters
- string_group = 1 # int | String in group parameters (optional)
- boolean_group = True # bool | Boolean in group parameters (optional)
- int64_group = 1 # int | Integer in group parameters (optional)
-
- # example passing only required values which don't have defaults set
- try:
- # Fake endpoint to test group parameters (optional)
- api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
- except petstore_api.ApiException as e:
- print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+ api_instance = petstore_api.FakeApi(api_client)
+ required_string_group = 56 # int | Required String in group parameters
+required_boolean_group = True # bool | Required Boolean in group parameters
+required_int64_group = 56 # int | Required Integer in group parameters
+string_group = 56 # int | String in group parameters (optional)
+boolean_group = True # bool | Boolean in group parameters (optional)
+int64_group = 56 # int | Integer in group parameters (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
# Fake endpoint to test group parameters (optional)
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
```
@@ -1183,12 +859,12 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **required_string_group** | **int**| Required String in group parameters |
- **required_boolean_group** | **bool**| Required Boolean in group parameters |
- **required_int64_group** | **int**| Required Integer in group parameters |
- **string_group** | **int**| String in group parameters | [optional]
- **boolean_group** | **bool**| Boolean in group parameters | [optional]
- **int64_group** | **int**| Integer in group parameters | [optional]
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
### Return type
@@ -1218,9 +894,10 @@ test inline additionalProperties
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1232,16 +909,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- request_body = {
- "key": "key_example",
- } # {str: (str,)} | request body
+ api_instance = petstore_api.FakeApi(api_client)
+ request_body = {'key': 'request_body_example'} # dict(str, str) | request body
- # example passing only required values which don't have defaults set
try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(request_body)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
@@ -1249,7 +923,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **request_body** | **{str: (str,)}**| request body |
+ **request_body** | [**dict(str, str)**](str.md)| request body |
### Return type
@@ -1279,9 +953,10 @@ test json serialization of form data
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1293,15 +968,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- param = "param_example" # str | field1
- param2 = "param2_example" # str | field2
+ api_instance = petstore_api.FakeApi(api_client)
+ param = 'param_example' # str | field1
+param2 = 'param2_example' # str | field2
- # example passing only required values which don't have defaults set
try:
# test json serialization of form data
api_instance.test_json_form_data(param, param2)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
```
@@ -1309,8 +983,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | **str**| field1 |
- **param2** | **str**| field2 |
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
### Return type
@@ -1342,9 +1016,10 @@ To test the collection format in query parameters
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1356,27 +1031,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = fake_api.FakeApi(api_client)
- pipe = [
- "pipe_example",
- ] # [str] |
- ioutil = [
- "ioutil_example",
- ] # [str] |
- http = [
- "http_example",
- ] # [str] |
- url = [
- "url_example",
- ] # [str] |
- context = [
- "context_example",
- ] # [str] |
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.FakeApi(api_client)
+ pipe = ['pipe_example'] # list[str] |
+ioutil = ['ioutil_example'] # list[str] |
+http = ['http_example'] # list[str] |
+url = ['url_example'] # list[str] |
+context = ['context_example'] # list[str] |
+
try:
api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
```
@@ -1384,11 +1048,11 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pipe** | **[str]**| |
- **ioutil** | **[str]**| |
- **http** | **[str]**| |
- **url** | **[str]**| |
- **context** | **[str]**| |
+ **pipe** | [**list[str]**](str.md)| |
+ **ioutil** | [**list[str]**](str.md)| |
+ **http** | [**list[str]**](str.md)| |
+ **url** | [**list[str]**](str.md)| |
+ **context** | [**list[str]**](str.md)| |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md
old mode 100644
new mode 100755
similarity index 84%
rename from samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md
rename to samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md
index e7a43d577d88..1b02ad93eff6
--- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md
@@ -18,10 +18,10 @@ To test class name in snake case
* Api Key Authentication (api_key_query):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import fake_classname_tags_123_api
-from petstore_api.model.client import Client
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -43,17 +43,14 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client)
- client = Client(
- client="client_example",
- ) # Client | client model
+ api_instance = petstore_api.FakeClassnameTags123Api(api_client)
+ client = petstore_api.Client() # Client | client model
- # example passing only required values which don't have defaults set
try:
# To test class name in snake case
api_response = api_instance.test_classname(client)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
```
@@ -61,7 +58,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **client** | [**Client**](Client.md)| client model |
+ **client** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-legacy/docs/File.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/File.md
rename to samples/openapi3/client/petstore/python-legacy/docs/File.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md
old mode 100644
new mode 100755
similarity index 86%
rename from samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md
rename to samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md
index d0a8bbaaba95..dc3722289887
--- a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**File**](File.md) | | [optional]
-**files** | [**[File]**](File.md) | | [optional]
+**files** | [**list[File]**](File.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-legacy/docs/Foo.md
old mode 100644
new mode 100755
similarity index 75%
rename from samples/openapi3/client/petstore/python-experimental/docs/Foo.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Foo.md
index 3e9080e7f48a..c55aa2cf103c
--- a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Foo.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**bar** | **str** | | [optional] if omitted the server will use the default value of "bar"
+**bar** | **str** | | [optional] [default to 'bar']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md
old mode 100644
new mode 100755
similarity index 91%
rename from samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md
rename to samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md
index 18e7d495e0f5..919d954bf525
--- a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md
@@ -3,20 +3,20 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**number** | **float** | |
-**byte** | **str** | |
-**date** | **date** | |
-**password** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
+**number** | **float** | |
**float** | **float** | | [optional]
**double** | **float** | | [optional]
+**decimal** | [**Decimal**](Decimal.md) | | [optional]
**string** | **str** | | [optional]
-**binary** | **file_type** | | [optional]
+**byte** | **str** | |
+**binary** | **file** | | [optional]
+**date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
-**uuid_no_example** | **str** | | [optional]
+**password** | **str** | |
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/HasOnlyReadOnly.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md
rename to samples/openapi3/client/petstore/python-legacy/docs/HasOnlyReadOnly.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md
old mode 100644
new mode 100755
similarity index 87%
rename from samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md
rename to samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md
index 50cf84f69133..7cde5c093292
--- a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md
@@ -4,7 +4,7 @@ Just a string to inform instance is up and running. Make it nullable in hope to
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**nullable_message** | **str, none_type** | | [optional]
+**nullable_message** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineObject.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md
old mode 100644
new mode 100755
similarity index 87%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md
index 4349ad73e3b7..42d38efa3013
--- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additional_metadata** | **str** | Additional data to pass to server | [optional]
-**file** | **file_type** | file to upload | [optional]
+**file** | **file** | file to upload | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md
old mode 100644
new mode 100755
similarity index 67%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md
index 9312bc7e3a19..9bfba12f6f15
--- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional]
-**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+**enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional]
+**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md
old mode 100644
new mode 100755
similarity index 79%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md
index 34d5eb478457..ef9845fcd9c6
--- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md
@@ -3,18 +3,18 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**number** | **float** | None |
-**double** | **float** | None |
-**pattern_without_delimiter** | **str** | None |
-**byte** | **str** | None |
**integer** | **int** | None | [optional]
**int32** | **int** | None | [optional]
**int64** | **int** | None | [optional]
+**number** | **float** | None |
**float** | **float** | None | [optional]
+**double** | **float** | None |
**string** | **str** | None | [optional]
-**binary** | **file_type** | None | [optional]
+**pattern_without_delimiter** | **str** | None |
+**byte** | **str** | None |
+**binary** | **file** | None | [optional]
**date** | **date** | None | [optional]
-**date_time** | **datetime** | None | [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
+**date_time** | **datetime** | None | [optional]
**password** | **str** | None | [optional]
**callback** | **str** | None | [optional]
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject4.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineObject4.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md
old mode 100644
new mode 100755
similarity index 87%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md
index 8f8662c434db..c4502f70f9c8
--- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**required_file** | **file_type** | file to upload |
**additional_metadata** | **str** | Additional data to pass to server | [optional]
+**required_file** | **file** | file to upload |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineResponseDefault.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md
rename to samples/openapi3/client/petstore/python-legacy/docs/InlineResponseDefault.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-legacy/docs/List.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/List.md
rename to samples/openapi3/client/petstore/python-legacy/docs/List.md
diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md b/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md
old mode 100644
new mode 100755
similarity index 52%
rename from samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md
rename to samples/openapi3/client/petstore/python-legacy/docs/MapTest.md
index 61ac566c14d2..a5601691f885
--- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md
@@ -1,10 +1,12 @@
-# AdditionalPropertiesArray
+# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | | [optional]
-**any string name** | **[bool, date, datetime, dict, float, int, list, str]** | any string name can be used but the value must be the correct type | [optional]
+**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
+**map_of_enum_string** | **dict(str, str)** | | [optional]
+**direct_map** | **dict(str, bool)** | | [optional]
+**indirect_map** | **dict(str, bool)** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
old mode 100644
new mode 100755
similarity index 86%
rename from samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md
rename to samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index 1484c0638d83..b9808d5275e5
--- a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**{str: (Animal,)}**](Animal.md) | | [optional]
+**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-legacy/docs/Model200Response.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Model200Response.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-legacy/docs/ModelReturn.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ModelReturn.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-legacy/docs/Name.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Name.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Name.md
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md b/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md
new file mode 100755
index 000000000000..c8b74746ae97
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md
@@ -0,0 +1,21 @@
+# NullableClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer_prop** | **int** | | [optional]
+**number_prop** | **float** | | [optional]
+**boolean_prop** | **bool** | | [optional]
+**string_prop** | **str** | | [optional]
+**date_prop** | **date** | | [optional]
+**datetime_prop** | **datetime** | | [optional]
+**array_nullable_prop** | **list[object]** | | [optional]
+**array_and_items_nullable_prop** | **list[object]** | | [optional]
+**array_items_nullable** | **list[object]** | | [optional]
+**object_nullable_prop** | **dict(str, object)** | | [optional]
+**object_and_items_nullable_prop** | **dict(str, object)** | | [optional]
+**object_items_nullable** | **dict(str, object)** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/NumberOnly.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md
rename to samples/openapi3/client/petstore/python-legacy/docs/NumberOnly.md
diff --git a/samples/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-legacy/docs/Order.md
old mode 100644
new mode 100755
similarity index 83%
rename from samples/client/petstore/python-experimental/docs/Order.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Order.md
index c21210a3bd59..b5f7b22d34cf
--- a/samples/client/petstore/python-experimental/docs/Order.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Order.md
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional]
**ship_date** | **datetime** | | [optional]
**status** | **str** | Order Status | [optional]
-**complete** | **bool** | | [optional] if omitted the server will use the default value of False
+**complete** | **bool** | | [optional] [default to False]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterComposite.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/docs/OuterComposite.md
rename to samples/openapi3/client/petstore/python-legacy/docs/OuterComposite.md
diff --git a/samples/openapi3/client/petstore/python/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnum.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/docs/OuterEnum.md
rename to samples/openapi3/client/petstore/python-legacy/docs/OuterEnum.md
diff --git a/samples/openapi3/client/petstore/python/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumDefaultValue.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/docs/OuterEnumDefaultValue.md
rename to samples/openapi3/client/petstore/python-legacy/docs/OuterEnumDefaultValue.md
diff --git a/samples/openapi3/client/petstore/python/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumInteger.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/docs/OuterEnumInteger.md
rename to samples/openapi3/client/petstore/python-legacy/docs/OuterEnumInteger.md
diff --git a/samples/openapi3/client/petstore/python/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumIntegerDefaultValue.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/docs/OuterEnumIntegerDefaultValue.md
rename to samples/openapi3/client/petstore/python-legacy/docs/OuterEnumIntegerDefaultValue.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-legacy/docs/Pet.md
old mode 100644
new mode 100755
similarity index 78%
rename from samples/openapi3/client/petstore/python-experimental/docs/Pet.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Pet.md
index 1d3349fa9b43..9e15090300f8
--- a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Pet.md
@@ -1,14 +1,13 @@
# Pet
-Pet object that needs to be added to the store
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **str** | |
-**photo_urls** | **[str]** | |
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
-**tags** | [**[Tag]**](Tag.md) | | [optional]
+**name** | **str** | |
+**photo_urls** | **list[str]** | |
+**tags** | [**list[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md
new file mode 100755
index 000000000000..186933485eee
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md
@@ -0,0 +1,678 @@
+# petstore_api.PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+# **add_pet**
+> add_pet(pet)
+
+Add a new pet to the store
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Add a new pet to the store
+ api_instance.add_pet(pet)
+ except ApiException as e:
+ print("Exception when calling PetApi->add_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**405** | Invalid input | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_pet**
+> delete_pet(pet_id, api_key=api_key)
+
+Deletes a pet
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | Pet id to delete
+api_key = 'api_key_example' # str | (optional)
+
+ try:
+ # Deletes a pet
+ api_instance.delete_pet(pet_id, api_key=api_key)
+ except ApiException as e:
+ print("Exception when calling PetApi->delete_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid pet value | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_status**
+> list[Pet] find_pets_by_status(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # list[str] | Status values that need to be considered for filter
+
+ try:
+ # Finds Pets by status
+ api_response = api_instance.find_pets_by_status(status)
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**list[str]**](str.md)| Status values that need to be considered for filter |
+
+### Return type
+
+[**list[Pet]**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid status value | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_tags**
+> list[Pet] find_pets_by_tags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # list[str] | Tags to filter by
+
+ try:
+ # Finds Pets by tags
+ api_response = api_instance.find_pets_by_tags(tags)
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**list[str]**](str.md)| Tags to filter by |
+
+### Return type
+
+[**list[Pet]**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid tag value | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_pet_by_id**
+> Pet get_pet_by_id(pet_id)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+* Api Key Authentication (api_key):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = 'YOUR_API_KEY'
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to return
+
+ try:
+ # Find pet by ID
+ api_response = api_instance.get_pet_by_id(pet_id)
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Pet not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet**
+> update_pet(pet)
+
+Update an existing pet
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Update an existing pet
+ api_instance.update_pet(pet)
+ except ApiException as e:
+ print("Exception when calling PetApi->update_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid ID supplied | - |
+**404** | Pet not found | - |
+**405** | Validation exception | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet_with_form**
+> update_pet_with_form(pet_id, name=name, status=status)
+
+Updates a pet in the store with form data
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet that needs to be updated
+name = 'name_example' # str | Updated name of the pet (optional)
+status = 'status_example' # str | Updated status of the pet (optional)
+
+ try:
+ # Updates a pet in the store with form data
+ api_instance.update_pet_with_form(pet_id, name=name, status=status)
+ except ApiException as e:
+ print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**405** | Invalid input | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file**
+> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+
+uploads an image
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+file = '/path/to/file' # file | file to upload (optional)
+
+ try:
+ # uploads an image
+ api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling PetApi->upload_file: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **file**| file to upload | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file_with_required_file**
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+
+uploads an image (required)
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure OAuth2 access token for authorization: petstore_auth
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+required_file = '/path/to/file' # file | file to upload
+additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+
+ try:
+ # uploads an image (required)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **file**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-legacy/docs/ReadOnlyFirst.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md
rename to samples/openapi3/client/petstore/python-legacy/docs/ReadOnlyFirst.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-legacy/docs/SpecialModelName.md
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md
rename to samples/openapi3/client/petstore/python-legacy/docs/SpecialModelName.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md
old mode 100644
new mode 100755
similarity index 83%
rename from samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md
rename to samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md
index c052c02c9b45..6704d5844be7
--- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md
@@ -20,9 +20,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -34,14 +35,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
- order_id = "order_id_example" # str | ID of the order that needs to be deleted
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 'order_id_example' # str | ID of the order that needs to be deleted
- # example passing only required values which don't have defaults set
try:
# Delete purchase order by ID
api_instance.delete_order(order_id)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->delete_order: %s\n" % e)
```
@@ -49,7 +49,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **str**| ID of the order that needs to be deleted |
+ **order_id** | **str**| ID of the order that needs to be deleted |
### Return type
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> {str: (int,)} get_inventory()
+> dict(str, int) get_inventory()
Returns pet inventories by status
@@ -83,9 +83,10 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key):
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -107,14 +108,13 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
-
- # example, this endpoint has no required or optional parameters
+ api_instance = petstore_api.StoreApi(api_client)
+
try:
# Returns pet inventories by status
api_response = api_instance.get_inventory()
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->get_inventory: %s\n" % e)
```
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**{str: (int,)}**
+**dict(str, int)**
### Authorization
@@ -151,10 +151,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
-from petstore_api.model.order import Order
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -166,15 +166,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
- order_id = 1 # int | ID of pet that needs to be fetched
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 56 # int | ID of pet that needs to be fetched
- # example passing only required values which don't have defaults set
try:
# Find purchase order by ID
api_response = api_instance.get_order_by_id(order_id)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
```
@@ -182,7 +181,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **int**| ID of pet that needs to be fetched |
+ **order_id** | **int**| ID of pet that needs to be fetched |
### Return type
@@ -214,10 +213,10 @@ Place an order for a pet
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import store_api
-from petstore_api.model.order import Order
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -229,22 +228,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = store_api.StoreApi(api_client)
- order = Order(
- id=1,
- pet_id=1,
- quantity=1,
- ship_date=dateutil_parser('2020-02-02T20:20:20.000222Z'),
- status="placed",
- complete=False,
- ) # Order | order placed for purchasing the pet
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.StoreApi(api_client)
+ order = petstore_api.Order() # Order | order placed for purchasing the pet
+
try:
# Place an order for a pet
api_response = api_instance.place_order(order)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
```
@@ -252,7 +243,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
diff --git a/samples/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-legacy/docs/Tag.md
old mode 100644
new mode 100755
similarity index 89%
rename from samples/client/petstore/python-experimental/docs/Tag.md
rename to samples/openapi3/client/petstore/python-legacy/docs/Tag.md
index fb8be02da161..243cd98eda69
--- a/samples/client/petstore/python-experimental/docs/Tag.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/Tag.md
@@ -5,7 +5,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**name** | **str** | | [optional]
-**full_name** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/User.md b/samples/openapi3/client/petstore/python-legacy/docs/User.md
new file mode 100755
index 000000000000..443ac123fdca
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/docs/User.md
@@ -0,0 +1,17 @@
+# User
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**username** | **str** | | [optional]
+**first_name** | **str** | | [optional]
+**last_name** | **str** | | [optional]
+**email** | **str** | | [optional]
+**password** | **str** | | [optional]
+**phone** | **str** | | [optional]
+**user_status** | **int** | User Status | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md
old mode 100644
new mode 100755
similarity index 73%
rename from samples/openapi3/client/petstore/python-experimental/docs/UserApi.md
rename to samples/openapi3/client/petstore/python-legacy/docs/UserApi.md
index 59eeff9a3366..32a62c8add92
--- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md
@@ -24,10 +24,10 @@ This can only be done by the logged in user.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -39,27 +39,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- user = User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- object_with_no_declared_props={},
- object_with_no_declared_props_nullable={},
- any_type_prop=None,
- any_type_prop_nullable=None,
- ) # User | Created user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ user = petstore_api.User() # User | Created user object
+
try:
# Create user
api_instance.create_user(user)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
@@ -67,7 +53,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**User**](User.md)| Created user object |
+ **user** | [**User**](User.md)| Created user object |
### Return type
@@ -97,10 +83,10 @@ Creates list of users with given input array
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -112,29 +98,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- user = [
- User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- object_with_no_declared_props={},
- object_with_no_declared_props_nullable={},
- any_type_prop=None,
- any_type_prop_nullable=None,
- ),
- ] # [User] | List of user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # list[User] | List of user object
+
try:
# Creates list of users with given input array
api_instance.create_users_with_array_input(user)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
@@ -142,7 +112,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**[User]**](User.md)| List of user object |
+ **user** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -172,10 +142,10 @@ Creates list of users with given input array
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -187,29 +157,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- user = [
- User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- object_with_no_declared_props={},
- object_with_no_declared_props_nullable={},
- any_type_prop=None,
- any_type_prop_nullable=None,
- ),
- ] # [User] | List of user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # list[User] | List of user object
+
try:
# Creates list of users with given input array
api_instance.create_users_with_list_input(user)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
@@ -217,7 +171,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**[User]**](User.md)| List of user object |
+ **user** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -249,9 +203,10 @@ This can only be done by the logged in user.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -263,14 +218,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | The name that needs to be deleted
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be deleted
- # example passing only required values which don't have defaults set
try:
# Delete user
api_instance.delete_user(username)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->delete_user: %s\n" % e)
```
@@ -278,7 +232,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be deleted |
+ **username** | **str**| The name that needs to be deleted |
### Return type
@@ -309,10 +263,10 @@ Get user by user name
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -324,15 +278,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | The name that needs to be fetched. Use user1 for testing.
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
- # example passing only required values which don't have defaults set
try:
# Get user by user name
api_response = api_instance.get_user_by_name(username)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
```
@@ -340,7 +293,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
+ **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
### Return type
@@ -372,9 +325,10 @@ Logs user into the system
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -386,16 +340,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | The user name for login
- password = "password_example" # str | The password for login in clear text
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The user name for login
+password = 'password_example' # str | The password for login in clear text
- # example passing only required values which don't have defaults set
try:
# Logs user into the system
api_response = api_instance.login_user(username, password)
pprint(api_response)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->login_user: %s\n" % e)
```
@@ -403,8 +356,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The user name for login |
- **password** | **str**| The password for login in clear text |
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
### Return type
@@ -435,9 +388,10 @@ Logs out current logged in user session
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -449,13 +403,12 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
-
- # example, this endpoint has no required or optional parameters
+ api_instance = petstore_api.UserApi(api_client)
+
try:
# Logs out current logged in user session
api_instance.logout_user()
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->logout_user: %s\n" % e)
```
@@ -492,10 +445,10 @@ This can only be done by the logged in user.
### Example
```python
+from __future__ import print_function
import time
import petstore_api
-from petstore_api.api import user_api
-from petstore_api.model.user import User
+from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -507,28 +460,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
- username = "username_example" # str | name that need to be deleted
- user = User(
- id=1,
- username="username_example",
- first_name="first_name_example",
- last_name="last_name_example",
- email="email_example",
- password="password_example",
- phone="phone_example",
- user_status=1,
- object_with_no_declared_props={},
- object_with_no_declared_props_nullable={},
- any_type_prop=None,
- any_type_prop_nullable=None,
- ) # User | Updated user object
-
- # example passing only required values which don't have defaults set
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | name that need to be deleted
+user = petstore_api.User() # User | Updated user object
+
try:
# Updated user
api_instance.update_user(username, user)
- except petstore_api.ApiException as e:
+ except ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
```
@@ -536,8 +475,8 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| name that need to be deleted |
- **user** | [**User**](User.md)| Updated user object |
+ **username** | **str**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-legacy/git_push.sh
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/git_push.sh
rename to samples/openapi3/client/petstore/python-legacy/git_push.sh
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py
new file mode 100755
index 000000000000..8a91e73ea15b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+__version__ = "1.0.0"
+
+# import apis into sdk package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
+
+# import ApiClient
+from petstore_api.api_client import ApiClient
+from petstore_api.configuration import Configuration
+from petstore_api.exceptions import OpenApiException
+from petstore_api.exceptions import ApiTypeError
+from petstore_api.exceptions import ApiValueError
+from petstore_api.exceptions import ApiKeyError
+from petstore_api.exceptions import ApiAttributeError
+from petstore_api.exceptions import ApiException
+# import models into sdk package
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.animal import Animal
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.foo import Foo
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.inline_object import InlineObject
+from petstore_api.models.inline_object1 import InlineObject1
+from petstore_api.models.inline_object2 import InlineObject2
+from petstore_api.models.inline_object3 import InlineObject3
+from petstore_api.models.inline_object4 import InlineObject4
+from petstore_api.models.inline_object5 import InlineObject5
+from petstore_api.models.inline_response_default import InlineResponseDefault
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.pet import Pet
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.tag import Tag
+from petstore_api.models.user import User
+
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py
new file mode 100755
index 000000000000..fa4e54a80091
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py
@@ -0,0 +1,12 @@
+from __future__ import absolute_import
+
+# flake8: noqa
+
+# import apis into api package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py
new file mode 100755
index 000000000000..af8d8fd0f25e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py
@@ -0,0 +1,176 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class AnotherFakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def call_123_test_special_tags(self, client, **kwargs): # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501
+
+ def call_123_test_special_tags_with_http_info(self, client, **kwargs): # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'client'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method call_123_test_special_tags" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'client' is set
+ if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
+ local_var_params['client'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `client` when calling `call_123_test_special_tags`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'client' in local_var_params:
+ body_params = local_var_params['client']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/another-fake/dummy', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py
new file mode 100755
index 000000000000..98554918aaec
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py
@@ -0,0 +1,158 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class DefaultApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def foo_get(self, **kwargs): # noqa: E501
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: InlineResponseDefault
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.foo_get_with_http_info(**kwargs) # noqa: E501
+
+ def foo_get_with_http_info(self, **kwargs): # noqa: E501
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(InlineResponseDefault, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method foo_get" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ }
+
+ return self.api_client.call_api(
+ '/foo', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py
new file mode 100755
index 000000000000..a5038873bb40
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py
@@ -0,0 +1,2326 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def fake_health_get(self, **kwargs): # noqa: E501
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: HealthCheckResult
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_health_get_with_http_info(**kwargs) # noqa: E501
+
+ def fake_health_get_with_http_info(self, **kwargs): # noqa: E501
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(HealthCheckResult, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_health_get" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "HealthCheckResult",
+ }
+
+ return self.api_client.call_api(
+ '/fake/health', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_http_signature_test(self, pet, **kwargs): # noqa: E501
+ """test http signature authentication # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_http_signature_test(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_http_signature_test_with_http_info(pet, **kwargs) # noqa: E501
+
+ def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501
+ """test http signature authentication # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_http_signature_test_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet',
+ 'query_1',
+ 'header_1'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_http_signature_test" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet' is set
+ if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501
+ local_var_params['pet'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet` when calling `fake_http_signature_test`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'query_1' in local_var_params and local_var_params['query_1'] is not None: # noqa: E501
+ query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501
+
+ header_params = {}
+ if 'header_1' in local_var_params:
+ header_params['header_1'] = local_var_params['header_1'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'pet' in local_var_params:
+ body_params = local_var_params['pet']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json', 'application/xml']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['http_signature_test'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/http-signature-test', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bool
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_boolean_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "bool",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/boolean', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_composite_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_composite_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: OuterComposite
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'outer_composite'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_composite_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'outer_composite' in local_var_params:
+ body_params = local_var_params['outer_composite']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "OuterComposite",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/composite', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_number_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_number_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: float
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_number_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "float",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/number', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def fake_outer_string_serialize(self, **kwargs): # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_string_serialize(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
+
+ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_string_serialize" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'body' in local_var_params:
+ body_params = local_var_params['body']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "str",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/string', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_body_with_file_schema(self, file_schema_test_class, **kwargs): # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
+
+ def test_body_with_file_schema_with_http_info(self, file_schema_test_class, **kwargs): # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'file_schema_test_class'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_file_schema" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'file_schema_test_class' is set
+ if self.api_client.client_side_validation and ('file_schema_test_class' not in local_var_params or # noqa: E501
+ local_var_params['file_schema_test_class'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `file_schema_test_class` when calling `test_body_with_file_schema`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'file_schema_test_class' in local_var_params:
+ body_params = local_var_params['file_schema_test_class']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-file-schema', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_body_with_query_params(self, query, user, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_body_with_query_params(query, user, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
+
+ def test_body_with_query_params_with_http_info(self, query, user, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'query',
+ 'user'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_query_params" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'query' is set
+ if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501
+ local_var_params['query'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501
+ # verify the required parameter 'user' is set
+ if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
+ local_var_params['user'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `user` when calling `test_body_with_query_params`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501
+ query_params.append(('query', local_var_params['query'])) # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'user' in local_var_params:
+ body_params = local_var_params['user']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-query-params', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_client_model(self, client, **kwargs): # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
+
+ def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'client'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_client_model" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'client' is set
+ if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
+ local_var_params['client'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `client` when calling `test_client_model`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'client' in local_var_params:
+ body_params = local_var_params['client']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: file
+ :param date: None
+ :type date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
+
+ def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: file
+ :param date: None
+ :type date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ 'integer',
+ 'int32',
+ 'int64',
+ 'float',
+ 'string',
+ 'binary',
+ 'date',
+ 'date_time',
+ 'password',
+ 'param_callback'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_endpoint_parameters" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'number' is set
+ if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501
+ local_var_params['number'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501
+ # verify the required parameter 'double' is set
+ if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501
+ local_var_params['double'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501
+ # verify the required parameter 'pattern_without_delimiter' is set
+ if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501
+ local_var_params['pattern_without_delimiter'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501
+ # verify the required parameter 'byte' is set
+ if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501
+ local_var_params['byte'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501
+
+ if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501
+ if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501
+ if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501
+ if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501
+ if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501
+ if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501
+ if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501
+ if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501
+ if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501
+ if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501
+ if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501
+ if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
+ len(local_var_params['password']) > 64): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501
+ if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
+ len(local_var_params['password']) < 10): # noqa: E501
+ raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'integer' in local_var_params:
+ form_params.append(('integer', local_var_params['integer'])) # noqa: E501
+ if 'int32' in local_var_params:
+ form_params.append(('int32', local_var_params['int32'])) # noqa: E501
+ if 'int64' in local_var_params:
+ form_params.append(('int64', local_var_params['int64'])) # noqa: E501
+ if 'number' in local_var_params:
+ form_params.append(('number', local_var_params['number'])) # noqa: E501
+ if 'float' in local_var_params:
+ form_params.append(('float', local_var_params['float'])) # noqa: E501
+ if 'double' in local_var_params:
+ form_params.append(('double', local_var_params['double'])) # noqa: E501
+ if 'string' in local_var_params:
+ form_params.append(('string', local_var_params['string'])) # noqa: E501
+ if 'pattern_without_delimiter' in local_var_params:
+ form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501
+ if 'byte' in local_var_params:
+ form_params.append(('byte', local_var_params['byte'])) # noqa: E501
+ if 'binary' in local_var_params:
+ local_var_files['binary'] = local_var_params['binary'] # noqa: E501
+ if 'date' in local_var_params:
+ form_params.append(('date', local_var_params['date'])) # noqa: E501
+ if 'date_time' in local_var_params:
+ form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501
+ if 'password' in local_var_params:
+ form_params.append(('password', local_var_params['password'])) # noqa: E501
+ if 'param_callback' in local_var_params:
+ form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['http_basic_test'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_enum_parameters(self, **kwargs): # noqa: E501
+ """To test enum parameters # noqa: E501
+
+ To test enum parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_enum_parameters(async_req=True)
+ >>> result = thread.get()
+
+ :param enum_header_string_array: Header parameter enum test (string array)
+ :type enum_header_string_array: list[str]
+ :param enum_header_string: Header parameter enum test (string)
+ :type enum_header_string: str
+ :param enum_query_string_array: Query parameter enum test (string array)
+ :type enum_query_string_array: list[str]
+ :param enum_query_string: Query parameter enum test (string)
+ :type enum_query_string: str
+ :param enum_query_integer: Query parameter enum test (double)
+ :type enum_query_integer: int
+ :param enum_query_double: Query parameter enum test (double)
+ :type enum_query_double: float
+ :param enum_form_string_array: Form parameter enum test (string array)
+ :type enum_form_string_array: list[str]
+ :param enum_form_string: Form parameter enum test (string)
+ :type enum_form_string: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
+
+ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501
+ """To test enum parameters # noqa: E501
+
+ To test enum parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_enum_parameters_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param enum_header_string_array: Header parameter enum test (string array)
+ :type enum_header_string_array: list[str]
+ :param enum_header_string: Header parameter enum test (string)
+ :type enum_header_string: str
+ :param enum_query_string_array: Query parameter enum test (string array)
+ :type enum_query_string_array: list[str]
+ :param enum_query_string: Query parameter enum test (string)
+ :type enum_query_string: str
+ :param enum_query_integer: Query parameter enum test (double)
+ :type enum_query_integer: int
+ :param enum_query_double: Query parameter enum test (double)
+ :type enum_query_double: float
+ :param enum_form_string_array: Form parameter enum test (string array)
+ :type enum_form_string_array: list[str]
+ :param enum_form_string: Form parameter enum test (string)
+ :type enum_form_string: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ 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'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_enum_parameters" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501
+ query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501
+ collection_formats['enum_query_string_array'] = 'multi' # noqa: E501
+ if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501
+ query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501
+ if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501
+ query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501
+ if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501
+ query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501
+
+ header_params = {}
+ if 'enum_header_string_array' in local_var_params:
+ header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501
+ collection_formats['enum_header_string_array'] = 'csv' # noqa: E501
+ if 'enum_header_string' in local_var_params:
+ header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+ if 'enum_form_string_array' in local_var_params:
+ form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501
+ collection_formats['enum_form_string_array'] = 'csv' # noqa: E501
+ if 'enum_form_string' in local_var_params:
+ form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
+
+ def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ 'string_group',
+ 'boolean_group',
+ 'int64_group'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_group_parameters" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'required_string_group' is set
+ if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501
+ local_var_params['required_string_group'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
+ # verify the required parameter 'required_boolean_group' is set
+ if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501
+ local_var_params['required_boolean_group'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
+ # verify the required parameter 'required_int64_group' is set
+ if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501
+ local_var_params['required_int64_group'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501
+ query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
+ if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501
+ query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
+ if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501
+ query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
+ if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501
+ query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
+
+ header_params = {}
+ if 'required_boolean_group' in local_var_params:
+ header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
+ if 'boolean_group' in local_var_params:
+ header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = ['bearer_test'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties(request_body, async_req=True)
+ >>> result = thread.get()
+
+ :param request_body: request body (required)
+ :type request_body: dict(str, str)
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
+
+ def test_inline_additional_properties_with_http_info(self, request_body, **kwargs): # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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 request_body: request body (required)
+ :type request_body: dict(str, str)
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'request_body'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_inline_additional_properties" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'request_body' is set
+ if self.api_client.client_side_validation and ('request_body' not in local_var_params or # noqa: E501
+ local_var_params['request_body'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `request_body` when calling `test_inline_additional_properties`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'request_body' in local_var_params:
+ body_params = local_var_params['request_body']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/inline-additionalProperties', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_json_form_data(self, param, param2, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_json_form_data(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
+
+ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'param',
+ 'param2'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_json_form_data" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'param' is set
+ if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501
+ local_var_params['param'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501
+ # verify the required parameter 'param2' is set
+ if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501
+ local_var_params['param2'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'param' in local_var_params:
+ form_params.append(('param', local_var_params['param'])) # noqa: E501
+ if 'param2' in local_var_params:
+ form_params.append(('param2', local_var_params['param2'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/jsonFormData', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: list[str]
+ :param ioutil: (required)
+ :type ioutil: list[str]
+ :param http: (required)
+ :type http: list[str]
+ :param url: (required)
+ :type url: list[str]
+ :param context: (required)
+ :type context: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501
+
+ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: list[str]
+ :param ioutil: (required)
+ :type ioutil: list[str]
+ :param http: (required)
+ :type http: list[str]
+ :param url: (required)
+ :type url: list[str]
+ :param context: (required)
+ :type context: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pipe',
+ 'ioutil',
+ 'http',
+ 'url',
+ 'context'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_query_parameter_collection_format" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pipe' is set
+ if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501
+ local_var_params['pipe'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'ioutil' is set
+ if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501
+ local_var_params['ioutil'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'http' is set
+ if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501
+ local_var_params['http'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'url' is set
+ if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501
+ local_var_params['url'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501
+ # verify the required parameter 'context' is set
+ if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501
+ local_var_params['context'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501
+ query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501
+ collection_formats['pipe'] = 'multi' # noqa: E501
+ if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501
+ query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501
+ collection_formats['ioutil'] = 'csv' # noqa: E501
+ if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501
+ query_params.append(('http', local_var_params['http'])) # noqa: E501
+ collection_formats['http'] = 'ssv' # noqa: E501
+ if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501
+ query_params.append(('url', local_var_params['url'])) # noqa: E501
+ collection_formats['url'] = 'csv' # noqa: E501
+ if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501
+ query_params.append(('context', local_var_params['context'])) # noqa: E501
+ collection_formats['context'] = 'multi' # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/test-query-paramters', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py
new file mode 100755
index 000000000000..533f8b80d894
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py
@@ -0,0 +1,176 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeClassnameTags123Api(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def test_classname(self, client, **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_classname(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
+
+ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_classname_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'client'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_classname" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'client' is set
+ if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
+ local_var_params['client'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'client' in local_var_params:
+ body_params = local_var_params['client']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key_query'] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake_classname_test', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py
new file mode 100755
index 000000000000..6a9d01e46498
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py
@@ -0,0 +1,1323 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class PetApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def add_pet(self, pet, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.add_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
+
+ def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.add_pet_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_hosts = [
+ 'http://petstore.swagger.io/v2',
+ 'http://path-server-test.petstore.local/v2'
+ ]
+ local_var_host = local_var_hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(local_var_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(local_var_host)
+ )
+ local_var_host = local_var_hosts[_host_index]
+ local_var_params = locals()
+
+ all_params = [
+ 'pet'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params and key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method add_pet" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet' is set
+ if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501
+ local_var_params['pet'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet` when calling `add_pet`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'pet' in local_var_params:
+ body_params = local_var_params['pet']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json', 'application/xml']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ _host=local_var_host,
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def delete_pet(self, pet_id, **kwargs): # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'api_key'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_pet" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+ if 'api_key' in local_var_params:
+ header_params['api_key'] = local_var_params['api_key'] # noqa: E501
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def find_pets_by_status(self, status, **kwargs): # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_status(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: list[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
+
+ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'status'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_status" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'status' is set
+ if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501
+ local_var_params['status'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501
+ query_params.append(('status', local_var_params['status'])) # noqa: E501
+ collection_formats['status'] = 'csv' # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "list[Pet]",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByStatus', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def find_pets_by_tags(self, tags, **kwargs): # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_tags(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: list[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
+
+ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: list[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'tags'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_tags" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'tags' is set
+ if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501
+ local_var_params['tags'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501
+ query_params.append(('tags', local_var_params['tags'])) # noqa: E501
+ collection_formats['tags'] = 'csv' # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "list[Pet]",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByTags', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Pet
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ 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 pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_pet_by_id" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key'] # noqa: E501
+
+ response_types_map = {
+ 200: "Pet",
+ 400: None,
+ 404: None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def update_pet(self, pet, **kwargs): # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
+
+ def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_hosts = [
+ 'http://petstore.swagger.io/v2',
+ 'http://path-server-test.petstore.local/v2'
+ ]
+ local_var_host = local_var_hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(local_var_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(local_var_host)
+ )
+ local_var_host = local_var_hosts[_host_index]
+ local_var_params = locals()
+
+ all_params = [
+ 'pet'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params and key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet' is set
+ if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501
+ local_var_params['pet'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet` when calling `update_pet`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'pet' in local_var_params:
+ body_params = local_var_params['pet']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json', 'application/xml']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ _host=local_var_host,
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.update_pet_with_form(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'name',
+ 'status'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet_with_form" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'name' in local_var_params:
+ form_params.append(('name', local_var_params['name'])) # noqa: E501
+ if 'status' in local_var_params:
+ form_params.append(('status', local_var_params['status'])) # noqa: E501
+
+ body_params = None
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/x-www-form-urlencoded']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def upload_file(self, pet_id, **kwargs): # noqa: E501
+ """uploads an image # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: file
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501
+ """uploads an image # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: file
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'additional_metadata',
+ 'file'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'additional_metadata' in local_var_params:
+ form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
+ if 'file' in local_var_params:
+ local_var_files['file'] = local_var_params['file'] # noqa: E501
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['multipart/form-data']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}/uploadImage', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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 pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: file
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
+
+ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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 pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: file
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'pet_id',
+ 'required_file',
+ 'additional_metadata'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file_with_required_file" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'pet_id' is set
+ if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
+ local_var_params['pet_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
+ # verify the required parameter 'required_file' is set
+ if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501
+ local_var_params['required_file'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'pet_id' in local_var_params:
+ path_params['petId'] = local_var_params['pet_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'additional_metadata' in local_var_params:
+ form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
+ if 'required_file' in local_var_params:
+ local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['multipart/form-data']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['petstore_auth'] # noqa: E501
+
+ response_types_map = {
+ 200: "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/fake/{petId}/uploadImageWithRequiredFile', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py
new file mode 100755
index 000000000000..2b22e1371860
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py
@@ -0,0 +1,569 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class StoreApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def delete_order(self, order_id, **kwargs): # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_order(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
+
+ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_order_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'order_id'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_order" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'order_id' is set
+ if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
+ local_var_params['order_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'order_id' in local_var_params:
+ path_params['order_id'] = local_var_params['order_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_inventory(self, **kwargs): # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_inventory(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: dict(str, int)
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_inventory_with_http_info(**kwargs) # noqa: E501
+
+ def get_inventory_with_http_info(self, **kwargs): # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_inventory_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_inventory" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key'] # noqa: E501
+
+ response_types_map = {
+ 200: "dict(str, int)",
+ }
+
+ return self.api_client.call_api(
+ '/store/inventory', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_order_by_id(self, order_id, **kwargs): # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_order_by_id(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
+
+ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'order_id'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_order_by_id" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'order_id' is set
+ if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
+ local_var_params['order_id'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
+
+ if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
+ if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501
+ raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
+ collection_formats = {}
+
+ path_params = {}
+ if 'order_id' in local_var_params:
+ path_params['order_id'] = local_var_params['order_id'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Order",
+ 400: None,
+ 404: None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def place_order(self, order, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.place_order(order, async_req=True)
+ >>> result = thread.get()
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.place_order_with_http_info(order, **kwargs) # noqa: E501
+
+ def place_order_with_http_info(self, order, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.place_order_with_http_info(order, async_req=True)
+ >>> result = thread.get()
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'order'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method place_order" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'order' is set
+ if self.api_client.client_side_validation and ('order' not in local_var_params or # noqa: E501
+ local_var_params['order'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `order` when calling `place_order`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'order' in local_var_params:
+ body_params = local_var_params['order']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "Order",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py
new file mode 100755
index 000000000000..a0a25e7bcbcf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py
@@ -0,0 +1,1101 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class UserApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def create_user(self, user, **kwargs): # noqa: E501
+ """Create user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.create_user(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: Created user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_user_with_http_info(user, **kwargs) # noqa: E501
+
+ def create_user_with_http_info(self, user, **kwargs): # noqa: E501
+ """Create user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.create_user_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: Created user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'user'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'user' is set
+ if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
+ local_var_params['user'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `user` when calling `create_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'user' in local_var_params:
+ body_params = local_var_params['user']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def create_users_with_array_input(self, user, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_array_input(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
+
+ def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'user'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_array_input" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'user' is set
+ if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
+ local_var_params['user'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_array_input`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'user' in local_var_params:
+ body_params = local_var_params['user']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithArray', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def create_users_with_list_input(self, user, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_list_input(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
+
+ def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: list[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'user'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_list_input" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'user' is set
+ if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
+ local_var_params['user'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_list_input`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'user' in local_var_params:
+ body_params = local_var_params['user']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithList', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def delete_user(self, username, **kwargs): # noqa: E501
+ """Delete user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_user(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
+
+ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501
+ """Delete user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_user_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'username' in local_var_params:
+ path_params['username'] = local_var_params['username'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'DELETE',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def get_user_by_name(self, username, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.get_user_by_name(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: User
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
+
+ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_user_by_name" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'username' in local_var_params:
+ path_params['username'] = local_var_params['username'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "User",
+ 400: None,
+ 404: None,
+ }
+
+ return self.api_client.call_api(
+ '/user/{username}', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def login_user(self, username, password, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.login_user(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
+
+ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.login_user_with_http_info(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username',
+ 'password'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method login_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501
+ # verify the required parameter 'password' is set
+ if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501
+ local_var_params['password'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+ if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501
+ query_params.append(('username', local_var_params['username'])) # noqa: E501
+ if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501
+ query_params.append(('password', local_var_params['password'])) # noqa: E501
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {
+ 200: "str",
+ 400: None,
+ }
+
+ return self.api_client.call_api(
+ '/user/login', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def logout_user(self, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.logout_user(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.logout_user_with_http_info(**kwargs) # noqa: E501
+
+ def logout_user_with_http_info(self, **kwargs): # noqa: E501
+ """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_req=True
+
+ >>> thread = api.logout_user_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method logout_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/logout', 'GET',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
+
+ def update_user(self, username, user, **kwargs): # noqa: E501
+ """Updated user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.update_user(username, user, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
+
+ def update_user_with_http_info(self, username, user, **kwargs): # noqa: E501
+ """Updated user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.update_user_with_http_info(username, user, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'username',
+ 'user'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_user" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'username' is set
+ if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
+ local_var_params['username'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501
+ # verify the required parameter 'user' is set
+ if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
+ local_var_params['user'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `user` when calling `update_user`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'username' in local_var_params:
+ path_params['username'] = local_var_params['username'] # noqa: E501
+
+ query_params = []
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'user' in local_var_params:
+ body_params = local_var_params['user']
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
+ ['application/json']) # noqa: E501
+
+ # Authentication setting
+ auth_settings = [] # noqa: E501
+
+ response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'PUT',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ 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'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py
new file mode 100755
index 000000000000..52c58e68a08f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py
@@ -0,0 +1,693 @@
+# coding: utf-8
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+from __future__ import absolute_import
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+# python 2 and python 3 compatibility library
+import six
+from six.moves.urllib.parse import quote
+
+from petstore_api.configuration import Configuration
+import petstore_api.models
+from petstore_api import rest
+from petstore_api.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int if six.PY3 else long, # noqa: F821
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ if configuration is None:
+ configuration = Configuration.get_default_copy()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = 'OpenAPI-Generator/1.0.0/python'
+ self.client_side_validation = configuration.client_side_validation
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
+
+ def close(self):
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+ def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ query_params = self.parameters_to_tuples(query_params,
+ collection_formats)
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ try:
+ # perform request and return response
+ response_data = self.request(
+ method, url, query_params=query_params, headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ e.body = e.body.decode('utf-8') if six.PY3 else e.body
+ raise e
+
+ self.last_response = response_data
+
+ return_data = response_data
+
+ if not _preload_content:
+ return return_data
+
+ response_type = response_types_map.get(response_data.status, None)
+
+ if six.PY3 and response_type not in ["file", "bytes"]:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+
+ if response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+ if _return_http_data_only:
+ return (return_data)
+ else:
+ return (return_data, response_data.status,
+ response_data.getheaders())
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
+ for attr, _ in six.iteritems(obj.openapi_types)
+ if getattr(obj, attr) is not None}
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in six.iteritems(obj_dict)}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('list['):
+ sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('dict('):
+ sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in six.iteritems(data)}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(petstore_api.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None,_preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :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,
+ header, and post parameters.
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.GET(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.HEAD(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.OPTIONS(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.POST(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.PUT(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.PATCH(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.DELETE(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in six.iteritems(files):
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ accepts = [x.lower() for x in accepts]
+
+ if 'application/json' in accepts:
+ return 'application/json'
+ else:
+ return ', '.join(accepts)
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return 'application/json'
+
+ content_types = [x.lower() for x in content_types]
+
+ if 'application/json' in content_types or '*/*' in content_types:
+ return 'application/json'
+ else:
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, querys, auth_settings,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param querys: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, querys, request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, querys, auth_setting)
+
+ def _apply_auth_params(self, headers, querys, auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param querys: Query parameters tuple list to be updated.
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ headers[auth_setting['key']] = auth_setting['value']
+ elif auth_setting['in'] == 'query':
+ querys.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return six.text_type(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+ has_discriminator = False
+ if (hasattr(klass, 'get_real_child_model')
+ and klass.discriminator_value_class_map):
+ has_discriminator = True
+
+ if not klass.openapi_types and has_discriminator is False:
+ return data
+
+ kwargs = {}
+ if (data is not None and
+ klass.openapi_types is not None and
+ isinstance(data, (list, dict))):
+ for attr, attr_type in six.iteritems(klass.openapi_types):
+ if klass.attribute_map[attr] in data:
+ value = data[klass.attribute_map[attr]]
+ kwargs[attr] = self.__deserialize(value, attr_type)
+
+ instance = klass(**kwargs)
+
+ if has_discriminator:
+ klass_name = instance.get_real_child_model(data)
+ if klass_name:
+ instance = self.__deserialize(data, klass_name)
+ return instance
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py
old mode 100644
new mode 100755
similarity index 97%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py
index ca58bb0fc100..f6d116438da4
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py
@@ -10,13 +10,16 @@
"""
+from __future__ import absolute_import
+
import copy
import logging
import multiprocessing
import sys
import urllib3
-from http import client as http_client
+import six
+from six.moves import http_client as httplib
from petstore_api.exceptions import ApiValueError
@@ -274,8 +277,9 @@ def __init__(self, host=None,
# Enable client side validation
self.client_side_validation = True
- # Options to pass down to the underlying urllib3 socket
self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -358,7 +362,7 @@ def logger_file(self, value):
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
@property
@@ -380,17 +384,17 @@ def debug(self, value):
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
- # turn on http_client debug
- http_client.HTTPConnection.debuglevel = 1
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in self.logger.items():
+ for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
- # turn off http_client debug
- http_client.HTTPConnection.debuglevel = 0
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
@@ -556,6 +560,10 @@ def get_host_settings(self):
]
}
}
+ },
+ {
+ 'url': "https://127.0.0.1/no_varaible",
+ 'description': "The local server without variables",
}
]
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py
old mode 100644
new mode 100755
similarity index 84%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py
index fecd2081b818..08181d4775db
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py
@@ -10,6 +10,8 @@
"""
+import six
+
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -126,11 +128,35 @@ def __str__(self):
return error_message
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, int):
+ if isinstance(pth, six.integer_types):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py
new file mode 100755
index 000000000000..f11ff62b2ee2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+# import models into model package
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.animal import Animal
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.foo import Foo
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.inline_object import InlineObject
+from petstore_api.models.inline_object1 import InlineObject1
+from petstore_api.models.inline_object2 import InlineObject2
+from petstore_api.models.inline_object3 import InlineObject3
+from petstore_api.models.inline_object4 import InlineObject4
+from petstore_api.models.inline_object5 import InlineObject5
+from petstore_api.models.inline_response_default import InlineResponseDefault
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.pet import Pet
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.tag import Tag
+from petstore_api.models.user import User
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/animal.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/api_response.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/api_response.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/api_response.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_test.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/array_test.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_test.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/capitalization.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/capitalization.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/cat.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat_all_of.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/cat_all_of.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat_all_of.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/category.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/category.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/category.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/class_model.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/class_model.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/class_model.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/client.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/client.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/client.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/dog.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog_all_of.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/dog_all_of.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog_all_of.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_arrays.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_arrays.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_class.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_class.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_test.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_test.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/file.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/file.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/foo.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/format_test.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/format_test.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/format_test.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/health_check_result.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/health_check_result.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_object.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object1.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_object1.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object1.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object2.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object2.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object3.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_object3.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object3.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object4.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_object4.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object4.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object5.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_object5.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object5.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_response_default.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/inline_response_default.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_response_default.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/list.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/list.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/list.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/map_test.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model200_response.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/model200_response.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_return.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/model_return.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_return.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/name.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/name.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/name.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/number_only.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/number_only.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/number_only.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/order.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/order.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/order.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_composite.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_composite.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_default_value.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_default_value.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer_default_value.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer_default_value.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/pet.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/pet.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/pet.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/read_only_first.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/read_only_first.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_model_name.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_model_name.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/tag.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/tag.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/tag.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/user.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/petstore_api/models/user.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/models/user.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py
old mode 100644
new mode 100755
similarity index 94%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py
rename to samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py
index 9537cea6b1af..17e85148bb30
--- a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py
@@ -10,17 +10,21 @@
"""
+from __future__ import absolute_import
+
import io
import json
import logging
import re
import ssl
-from urllib.parse import urlencode
import certifi
+# python 2 and python 3 compatibility library
+import six
+from six.moves.urllib.parse import urlencode
import urllib3
-from petstore_api.exceptions import ApiException, ApiValueError
+from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
logger = logging.getLogger(__name__)
@@ -140,7 +144,7 @@ def request(self, method, url, query_params=None, headers=None,
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
+ if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
@@ -220,6 +224,18 @@ def request(self, method, url, query_params=None, headers=None,
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
+ if r.status == 401:
+ raise UnauthorizedException(http_resp=r)
+
+ if r.status == 403:
+ raise ForbiddenException(http_resp=r)
+
+ if r.status == 404:
+ raise NotFoundException(http_resp=r)
+
+ if 500 <= r.status <= 599:
+ raise ServiceException(http_resp=r)
+
raise ApiException(http_resp=r)
return r
diff --git a/samples/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-legacy/pom.xml
old mode 100644
new mode 100755
similarity index 89%
rename from samples/client/petstore/python-experimental/pom.xml
rename to samples/openapi3/client/petstore/python-legacy/pom.xml
index 9dc399cc8089..98955483eb8f
--- a/samples/client/petstore/python-experimental/pom.xml
+++ b/samples/openapi3/client/petstore/python-legacy/pom.xml
@@ -1,10 +1,10 @@
4.0.0
org.openapitools
- PythonExperimentalPetstoreClientTests
+ PythonOAS3PetstoreTests
pom
1.0-SNAPSHOT
- Python Experimental OpenAPI Petstore Client
+ Python OpenAPI3 Petstore Client
@@ -35,7 +35,7 @@
make
- test
+ test-all
diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-legacy/requirements.txt
old mode 100644
new mode 100755
similarity index 66%
rename from samples/openapi3/client/petstore/python-experimental/requirements.txt
rename to samples/openapi3/client/petstore/python-legacy/requirements.txt
index 2c2f00fcb27b..eb358efd5bd3
--- a/samples/openapi3/client/petstore/python-experimental/requirements.txt
+++ b/samples/openapi3/client/petstore/python-legacy/requirements.txt
@@ -1,5 +1,6 @@
-nulltype
certifi >= 14.05.14
+future; python_version<="2.7"
+six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
diff --git a/samples/openapi3/client/petstore/python-experimental/setup.cfg b/samples/openapi3/client/petstore/python-legacy/setup.cfg
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/setup.cfg
rename to samples/openapi3/client/petstore/python-legacy/setup.cfg
diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-legacy/setup.py
old mode 100644
new mode 100755
similarity index 88%
rename from samples/openapi3/client/petstore/python-experimental/setup.py
rename to samples/openapi3/client/petstore/python-legacy/setup.py
index 71641535bf53..2a3ca48e06ba
--- a/samples/openapi3/client/petstore/python-experimental/setup.py
+++ b/samples/openapi3/client/petstore/python-legacy/setup.py
@@ -21,14 +21,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = [
- "urllib3 >= 1.15",
- "certifi",
- "python-dateutil",
- "nulltype",
- "pem>=19.3.0",
- "pycryptodome>=3.9.0",
-]
+REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
@@ -38,7 +31,6 @@
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
- python_requires=">=3.5",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
diff --git a/samples/openapi3/client/petstore/python-legacy/test-requirements.txt b/samples/openapi3/client/petstore/python-legacy/test-requirements.txt
new file mode 100755
index 000000000000..4ed3991cbec1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test-requirements.txt
@@ -0,0 +1,3 @@
+pytest~=4.6.7 # needed for python 2.7+3.4
+pytest-cov>=2.8.1
+pytest-randomly==1.2.3 # needed for python 2.7+3.4
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py b/samples/openapi3/client/petstore/python-legacy/test/__init__.py
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py
rename to samples/openapi3/client/petstore/python-legacy/test/__init__.py
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py
new file mode 100644
index 000000000000..4383ae1726b8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAdditionalPropertiesClass(unittest.TestCase):
+ """AdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return AdditionalPropertiesClass(
+ map_property = {
+ 'key' : ''
+ },
+ map_of_map_property = {
+ 'key' : {
+ 'key' : ''
+ }
+ }
+ )
+ else :
+ return AdditionalPropertiesClass(
+ )
+
+ def testAdditionalPropertiesClass(self):
+ """Test AdditionalPropertiesClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_animal.py b/samples/openapi3/client/petstore/python-legacy/test/test_animal.py
new file mode 100644
index 000000000000..d209151de678
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_animal.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.animal import Animal # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAnimal(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Animal
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.animal.Animal() # noqa: E501
+ if include_optional :
+ return Animal(
+ class_name = '',
+ color = 'red'
+ )
+ else :
+ return Animal(
+ class_name = '',
+ )
+
+ def testAnimal(self):
+ """Test Animal"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py
similarity index 86%
rename from samples/client/petstore/python-experimental/test/test_another_fake_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py
index f79966a26961..d95798cfc5a4 100644
--- a/samples/client/petstore/python-experimental/test/test_another_fake_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py
@@ -16,13 +16,14 @@
import petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
+from petstore_api.rest import ApiException
class TestAnotherFakeApi(unittest.TestCase):
"""AnotherFakeApi unit test stubs"""
def setUp(self):
- self.api = AnotherFakeApi() # noqa: E501
+ self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_api_response.py b/samples/openapi3/client/petstore/python-legacy/test/test_api_response.py
new file mode 100644
index 000000000000..95efd33bce57
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_api_response.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.api_response import ApiResponse # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestApiResponse(unittest.TestCase):
+ """ApiResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ApiResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
+ if include_optional :
+ return ApiResponse(
+ code = 56,
+ type = '',
+ message = ''
+ )
+ else :
+ return ApiResponse(
+ )
+
+ def testApiResponse(self):
+ """Test ApiResponse"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py
new file mode 100644
index 000000000000..001b4e565737
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayOfArrayOfNumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
+ if include_optional :
+ return ArrayOfArrayOfNumberOnly(
+ array_array_number = [
+ [
+ 1.337
+ ]
+ ]
+ )
+ else :
+ return ArrayOfArrayOfNumberOnly(
+ )
+
+ def testArrayOfArrayOfNumberOnly(self):
+ """Test ArrayOfArrayOfNumberOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py
new file mode 100644
index 000000000000..a35703ae0dac
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayOfNumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
+ if include_optional :
+ return ArrayOfNumberOnly(
+ array_number = [
+ 1.337
+ ]
+ )
+ else :
+ return ArrayOfNumberOnly(
+ )
+
+ def testArrayOfNumberOnly(self):
+ """Test ArrayOfNumberOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_array_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_array_test.py
new file mode 100644
index 000000000000..8327e415adcd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_array_test.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_test import ArrayTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayTest(unittest.TestCase):
+ """ArrayTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
+ if include_optional :
+ return ArrayTest(
+ array_of_string = [
+ ''
+ ],
+ array_array_of_integer = [
+ [
+ 56
+ ]
+ ],
+ array_array_of_model = [
+ [
+ petstore_api.models.read_only_first.ReadOnlyFirst(
+ bar = '',
+ baz = '', )
+ ]
+ ]
+ )
+ else :
+ return ArrayTest(
+ )
+
+ def testArrayTest(self):
+ """Test ArrayTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py b/samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py
new file mode 100644
index 000000000000..c7a9721dbc00
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.capitalization import Capitalization # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCapitalization(unittest.TestCase):
+ """Capitalization unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Capitalization
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
+ if include_optional :
+ return Capitalization(
+ small_camel = '',
+ capital_camel = '',
+ small_snake = '',
+ capital_snake = '',
+ sca_eth_flow_points = '',
+ att_name = ''
+ )
+ else :
+ return Capitalization(
+ )
+
+ def testCapitalization(self):
+ """Test Capitalization"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-legacy/test/test_cat.py
similarity index 58%
rename from samples/openapi3/client/petstore/python-experimental/test/test_cat.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_cat.py
index 9008ab8f9a92..e04566b1aafd 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_cat.py
@@ -10,18 +10,14 @@
"""
-import sys
+from __future__ import absolute_import
+
import unittest
+import datetime
import petstore_api
-from petstore_api.model.address import Address
-from petstore_api.model.animal import Animal
-from petstore_api.model.cat_all_of import CatAllOf
-globals()['Address'] = Address
-globals()['Animal'] = Animal
-globals()['CatAllOf'] = CatAllOf
-from petstore_api.model.cat import Cat
-
+from petstore_api.models.cat import Cat # noqa: E501
+from petstore_api.rest import ApiException
class TestCat(unittest.TestCase):
"""Cat unit test stubs"""
@@ -34,10 +30,8 @@ def tearDown(self):
def testCat(self):
"""Test Cat"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Cat() # noqa: E501
- pass
-
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py
new file mode 100644
index 000000000000..4708bf8bba3e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.cat_all_of import CatAllOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCatAllOf(unittest.TestCase):
+ """CatAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CatAllOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501
+ if include_optional :
+ return CatAllOf(
+ declawed = True
+ )
+ else :
+ return CatAllOf(
+ )
+
+ def testCatAllOf(self):
+ """Test CatAllOf"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_category.py b/samples/openapi3/client/petstore/python-legacy/test/test_category.py
new file mode 100644
index 000000000000..9b8a8faa0976
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_category.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.category import Category # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCategory(unittest.TestCase):
+ """Category unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Category
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.category.Category() # noqa: E501
+ if include_optional :
+ return Category(
+ id = 56,
+ name = 'default-name'
+ )
+ else :
+ return Category(
+ name = 'default-name',
+ )
+
+ def testCategory(self):
+ """Test Category"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_class_model.py b/samples/openapi3/client/petstore/python-legacy/test/test_class_model.py
new file mode 100644
index 000000000000..511843f2dcfd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_class_model.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.class_model import ClassModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestClassModel(unittest.TestCase):
+ """ClassModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ClassModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.class_model.ClassModel() # noqa: E501
+ if include_optional :
+ return ClassModel(
+ _class = ''
+ )
+ else :
+ return ClassModel(
+ )
+
+ def testClassModel(self):
+ """Test ClassModel"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_client.py b/samples/openapi3/client/petstore/python-legacy/test/test_client.py
new file mode 100644
index 000000000000..9209bb2c3f03
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_client.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.client import Client # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestClient(unittest.TestCase):
+ """Client unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Client
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.client.Client() # noqa: E501
+ if include_optional :
+ return Client(
+ client = ''
+ )
+ else :
+ return Client(
+ )
+
+ def testClient(self):
+ """Test Client"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python/test/test_configuration.py b/samples/openapi3/client/petstore/python-legacy/test/test_configuration.py
old mode 100644
new mode 100755
similarity index 97%
rename from samples/openapi3/client/petstore/python/test/test_configuration.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_configuration.py
index e71080725e7d..d41ffa63ba8a
--- a/samples/openapi3/client/petstore/python/test/test_configuration.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_configuration.py
@@ -20,7 +20,7 @@
class TestConfiguration(unittest.TestCase):
- """Confgiruation unit test stubs"""
+ """Configuration unit test stubs"""
def setUp(self):
self.config= Configuration()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_default_api.py
similarity index 81%
rename from samples/openapi3/client/petstore/python-experimental/test/test_default_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_default_api.py
index caf174d6d4ba..50e7c57bd0bf 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_default_api.py
@@ -10,17 +10,20 @@
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.default_api import DefaultApi # noqa: E501
+from petstore_api.rest import ApiException
class TestDefaultApi(unittest.TestCase):
"""DefaultApi unit test stubs"""
def setUp(self):
- self.api = DefaultApi() # noqa: E501
+ self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-legacy/test/test_dog.py
similarity index 63%
rename from samples/openapi3/client/petstore/python-experimental/test/test_dog.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_dog.py
index cfd84be56688..af75161287e1 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_dog.py
@@ -10,16 +10,14 @@
"""
-import sys
+from __future__ import absolute_import
+
import unittest
+import datetime
import petstore_api
-from petstore_api.model.animal import Animal
-from petstore_api.model.dog_all_of import DogAllOf
-globals()['Animal'] = Animal
-globals()['DogAllOf'] = DogAllOf
-from petstore_api.model.dog import Dog
-
+from petstore_api.models.dog import Dog # noqa: E501
+from petstore_api.rest import ApiException
class TestDog(unittest.TestCase):
"""Dog unit test stubs"""
@@ -32,10 +30,8 @@ def tearDown(self):
def testDog(self):
"""Test Dog"""
- # FIXME: construct object with mandatory attributes with example values
- # model = Dog() # noqa: E501
- pass
-
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py
new file mode 100644
index 000000000000..44a266577a41
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dog_all_of import DogAllOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDogAllOf(unittest.TestCase):
+ """DogAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DogAllOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501
+ if include_optional :
+ return DogAllOf(
+ breed = ''
+ )
+ else :
+ return DogAllOf(
+ )
+
+ def testDogAllOf(self):
+ """Test DogAllOf"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py
new file mode 100644
index 000000000000..31aae13158ed
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumArrays(unittest.TestCase):
+ """EnumArrays unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumArrays
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
+ if include_optional :
+ return EnumArrays(
+ just_symbol = '>=',
+ array_enum = [
+ 'fish'
+ ]
+ )
+ else :
+ return EnumArrays(
+ )
+
+ def testEnumArrays(self):
+ """Test EnumArrays"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py
new file mode 100644
index 000000000000..5d7e2c398977
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_class import EnumClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumClass(unittest.TestCase):
+ """EnumClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_class.EnumClass() # noqa: E501
+ if include_optional :
+ return EnumClass(
+ )
+ else :
+ return EnumClass(
+ )
+
+ def testEnumClass(self):
+ """Test EnumClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py
new file mode 100644
index 000000000000..88a9614dd548
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_test import EnumTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumTest(unittest.TestCase):
+ """EnumTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
+ if include_optional :
+ return EnumTest(
+ enum_string = 'UPPER',
+ enum_string_required = 'UPPER',
+ enum_integer = 1,
+ enum_number = 1.1,
+ outer_enum = 'placed',
+ outer_enum_integer = 0,
+ outer_enum_default_value = 'placed',
+ outer_enum_integer_default_value = 0
+ )
+ else :
+ return EnumTest(
+ enum_string_required = 'UPPER',
+ )
+
+ def testEnumTest(self):
+ """Test EnumTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py
similarity index 70%
rename from samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py
index 48230221f42e..0f4028bc96b0 100644
--- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py
@@ -10,80 +10,58 @@
"""
+from __future__ import absolute_import
+
import unittest
import petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
+from petstore_api.rest import ApiException
class TestFakeApi(unittest.TestCase):
"""FakeApi unit test stubs"""
def setUp(self):
- self.api = FakeApi() # noqa: E501
+ self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
def tearDown(self):
pass
- def test_additional_properties_with_array_of_enums(self):
- """Test case for additional_properties_with_array_of_enums
-
- Additional Properties with Array of Enums # noqa: E501
- """
- pass
-
- def test_array_model(self):
- """Test case for array_model
-
- """
- pass
-
- def test_array_of_enums(self):
- """Test case for array_of_enums
-
- Array of Enums # noqa: E501
- """
- pass
-
- def test_boolean(self):
- """Test case for boolean
-
- """
- pass
-
- def test_composed_one_of_number_with_validations(self):
- """Test case for composed_one_of_number_with_validations
+ def test_fake_health_get(self):
+ """Test case for fake_health_get
+ Health check endpoint # noqa: E501
"""
pass
- def test_fake_health_get(self):
- """Test case for fake_health_get
+ def test_fake_http_signature_test(self):
+ """Test case for fake_http_signature_test
- Health check endpoint # noqa: E501
+ test http signature authentication # noqa: E501
"""
pass
- def test_number_with_validations(self):
- """Test case for number_with_validations
+ def test_fake_outer_boolean_serialize(self):
+ """Test case for fake_outer_boolean_serialize
"""
pass
- def test_object_model_with_ref_props(self):
- """Test case for object_model_with_ref_props
+ def test_fake_outer_composite_serialize(self):
+ """Test case for fake_outer_composite_serialize
"""
pass
- def test_string(self):
- """Test case for string
+ def test_fake_outer_number_serialize(self):
+ """Test case for fake_outer_number_serialize
"""
pass
- def test_string_enum(self):
- """Test case for string_enum
+ def test_fake_outer_string_serialize(self):
+ """Test case for fake_outer_string_serialize
"""
pass
diff --git a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py
similarity index 85%
rename from samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py
index 1ade31405a62..f54e0d06644f 100644
--- a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py
@@ -11,18 +11,19 @@
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
+from petstore_api.rest import ApiException
class TestFakeClassnameTags123Api(unittest.TestCase):
"""FakeClassnameTags123Api unit test stubs"""
def setUp(self):
- self.api = FakeClassnameTags123Api() # noqa: E501
+ self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_file.py b/samples/openapi3/client/petstore/python-legacy/test/test_file.py
new file mode 100644
index 000000000000..3c9b91972d91
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_file.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file import File # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFile(unittest.TestCase):
+ """File unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test File
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file.File() # noqa: E501
+ if include_optional :
+ return File(
+ source_uri = ''
+ )
+ else :
+ return File(
+ )
+
+ def testFile(self):
+ """Test File"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py
new file mode 100644
index 000000000000..2834ddc05413
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFileSchemaTestClass(unittest.TestCase):
+ """FileSchemaTestClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FileSchemaTestClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
+ if include_optional :
+ return FileSchemaTestClass(
+ file = petstore_api.models.file.File(
+ source_uri = '', ),
+ files = [
+ petstore_api.models.file.File(
+ source_uri = '', )
+ ]
+ )
+ else :
+ return FileSchemaTestClass(
+ )
+
+ def testFileSchemaTestClass(self):
+ """Test FileSchemaTestClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_foo.py b/samples/openapi3/client/petstore/python-legacy/test/test_foo.py
new file mode 100644
index 000000000000..f592b1c37018
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_foo.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.foo import Foo # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFoo(unittest.TestCase):
+ """Foo unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Foo
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.foo.Foo() # noqa: E501
+ if include_optional :
+ return Foo(
+ bar = 'bar'
+ )
+ else :
+ return Foo(
+ )
+
+ def testFoo(self):
+ """Test Foo"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_format_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_format_test.py
new file mode 100644
index 000000000000..b21dd314879c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_format_test.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.format_test import FormatTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFormatTest(unittest.TestCase):
+ """FormatTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FormatTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.format_test.FormatTest() # noqa: E501
+ if include_optional :
+ return FormatTest(
+ integer = 10,
+ int32 = 20,
+ int64 = 56,
+ number = 32.1,
+ float = 54.3,
+ double = 67.8,
+ decimal = 1,
+ string = 'a',
+ byte = 'YQ==',
+ binary = bytes(b'blah'),
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
+ password = '0123456789',
+ pattern_with_digits = '0480728880',
+ pattern_with_digits_and_delimiter = 'image_480'
+ )
+ else :
+ return FormatTest(
+ number = 32.1,
+ byte = 'YQ==',
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ password = '0123456789',
+ )
+
+ def testFormatTest(self):
+ """Test FormatTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py
new file mode 100644
index 000000000000..2a8d2df6a0f8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestHasOnlyReadOnly(unittest.TestCase):
+ """HasOnlyReadOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test HasOnlyReadOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
+ if include_optional :
+ return HasOnlyReadOnly(
+ bar = '',
+ foo = ''
+ )
+ else :
+ return HasOnlyReadOnly(
+ )
+
+ def testHasOnlyReadOnly(self):
+ """Test HasOnlyReadOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py
new file mode 100644
index 000000000000..21c52053ea22
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestHealthCheckResult(unittest.TestCase):
+ """HealthCheckResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test HealthCheckResult
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
+ if include_optional :
+ return HealthCheckResult(
+ nullable_message = ''
+ )
+ else :
+ return HealthCheckResult(
+ )
+
+ def testHealthCheckResult(self):
+ """Test HealthCheckResult"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py
new file mode 100644
index 000000000000..b2569c80b8f7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_object import InlineObject # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineObject(unittest.TestCase):
+ """InlineObject unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineObject
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_object.InlineObject() # noqa: E501
+ if include_optional :
+ return InlineObject(
+ name = '',
+ status = ''
+ )
+ else :
+ return InlineObject(
+ )
+
+ def testInlineObject(self):
+ """Test InlineObject"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py
new file mode 100644
index 000000000000..548e61b7ce22
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_object1 import InlineObject1 # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineObject1(unittest.TestCase):
+ """InlineObject1 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineObject1
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_object1.InlineObject1() # noqa: E501
+ if include_optional :
+ return InlineObject1(
+ additional_metadata = '',
+ file = bytes(b'blah')
+ )
+ else :
+ return InlineObject1(
+ )
+
+ def testInlineObject1(self):
+ """Test InlineObject1"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py
new file mode 100644
index 000000000000..749e24ebb8d0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_object2 import InlineObject2 # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineObject2(unittest.TestCase):
+ """InlineObject2 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineObject2
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_object2.InlineObject2() # noqa: E501
+ if include_optional :
+ return InlineObject2(
+ enum_form_string_array = [
+ '$'
+ ],
+ enum_form_string = '-efg'
+ )
+ else :
+ return InlineObject2(
+ )
+
+ def testInlineObject2(self):
+ """Test InlineObject2"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py
new file mode 100644
index 000000000000..a4a7e8e11af2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_object3 import InlineObject3 # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineObject3(unittest.TestCase):
+ """InlineObject3 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineObject3
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_object3.InlineObject3() # noqa: E501
+ if include_optional :
+ return InlineObject3(
+ integer = 10,
+ int32 = 20,
+ int64 = 56,
+ number = 32.1,
+ float = 1.337,
+ double = 67.8,
+ string = 'a',
+ pattern_without_delimiter = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>',
+ byte = 'YQ==',
+ binary = bytes(b'blah'),
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ password = '0123456789',
+ callback = ''
+ )
+ else :
+ return InlineObject3(
+ number = 32.1,
+ double = 67.8,
+ pattern_without_delimiter = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>',
+ byte = 'YQ==',
+ )
+
+ def testInlineObject3(self):
+ """Test InlineObject3"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py
new file mode 100644
index 000000000000..6212dff6e6e9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_object4 import InlineObject4 # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineObject4(unittest.TestCase):
+ """InlineObject4 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineObject4
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_object4.InlineObject4() # noqa: E501
+ if include_optional :
+ return InlineObject4(
+ param = '',
+ param2 = ''
+ )
+ else :
+ return InlineObject4(
+ param = '',
+ param2 = '',
+ )
+
+ def testInlineObject4(self):
+ """Test InlineObject4"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py
new file mode 100644
index 000000000000..62b39f159423
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_object5 import InlineObject5 # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineObject5(unittest.TestCase):
+ """InlineObject5 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineObject5
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_object5.InlineObject5() # noqa: E501
+ if include_optional :
+ return InlineObject5(
+ additional_metadata = '',
+ required_file = bytes(b'blah')
+ )
+ else :
+ return InlineObject5(
+ required_file = bytes(b'blah'),
+ )
+
+ def testInlineObject5(self):
+ """Test InlineObject5"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py
new file mode 100644
index 000000000000..dfb772dbe61a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.inline_response_default import InlineResponseDefault # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestInlineResponseDefault(unittest.TestCase):
+ """InlineResponseDefault unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InlineResponseDefault
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.inline_response_default.InlineResponseDefault() # noqa: E501
+ if include_optional :
+ return InlineResponseDefault(
+ string = petstore_api.models.foo.Foo(
+ bar = 'bar', )
+ )
+ else :
+ return InlineResponseDefault(
+ )
+
+ def testInlineResponseDefault(self):
+ """Test InlineResponseDefault"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_list.py b/samples/openapi3/client/petstore/python-legacy/test/test_list.py
new file mode 100644
index 000000000000..4c603a5e9b1e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_list.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.list import List # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestList(unittest.TestCase):
+ """List unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test List
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.list.List() # noqa: E501
+ if include_optional :
+ return List(
+ _123_list = ''
+ )
+ else :
+ return List(
+ )
+
+ def testList(self):
+ """Test List"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_map_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_map_test.py
new file mode 100644
index 000000000000..71608e979f81
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_map_test.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.map_test import MapTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMapTest(unittest.TestCase):
+ """MapTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MapTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.map_test.MapTest() # noqa: E501
+ if include_optional :
+ return MapTest(
+ map_map_of_string = {
+ 'key' : {
+ 'key' : ''
+ }
+ },
+ map_of_enum_string = {
+ 'UPPER' : 'UPPER'
+ },
+ direct_map = {
+ 'key' : True
+ },
+ indirect_map = {
+ 'key' : True
+ }
+ )
+ else :
+ return MapTest(
+ )
+
+ def testMapTest(self):
+ """Test MapTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py
new file mode 100644
index 000000000000..d217b1143656
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
+ """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MixedPropertiesAndAdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ uuid = '',
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ map = {
+ 'key' : petstore_api.models.animal.Animal(
+ class_name = '',
+ color = 'red', )
+ }
+ )
+ else :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ )
+
+ def testMixedPropertiesAndAdditionalPropertiesClass(self):
+ """Test MixedPropertiesAndAdditionalPropertiesClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py b/samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py
new file mode 100644
index 000000000000..f7e9677e0074
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.model200_response import Model200Response # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestModel200Response(unittest.TestCase):
+ """Model200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Model200Response
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.model200_response.Model200Response() # noqa: E501
+ if include_optional :
+ return Model200Response(
+ name = 56,
+ _class = ''
+ )
+ else :
+ return Model200Response(
+ )
+
+ def testModel200Response(self):
+ """Test Model200Response"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_model_return.py b/samples/openapi3/client/petstore/python-legacy/test/test_model_return.py
new file mode 100644
index 000000000000..b0f9d9c4f7f9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_model_return.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.model_return import ModelReturn # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestModelReturn(unittest.TestCase):
+ """ModelReturn unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ModelReturn
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.model_return.ModelReturn() # noqa: E501
+ if include_optional :
+ return ModelReturn(
+ _return = 56
+ )
+ else :
+ return ModelReturn(
+ )
+
+ def testModelReturn(self):
+ """Test ModelReturn"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_name.py b/samples/openapi3/client/petstore/python-legacy/test/test_name.py
new file mode 100644
index 000000000000..bbf11fd231ea
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_name.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.name import Name # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestName(unittest.TestCase):
+ """Name unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Name
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.name.Name() # noqa: E501
+ if include_optional :
+ return Name(
+ name = 56,
+ snake_case = 56,
+ _property = '',
+ _123_number = 56
+ )
+ else :
+ return Name(
+ name = 56,
+ )
+
+ def testName(self):
+ """Test Name"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py
new file mode 100644
index 000000000000..f570c74fc052
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.nullable_class import NullableClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestNullableClass(unittest.TestCase):
+ """NullableClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test NullableClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
+ if include_optional :
+ return NullableClass(
+ integer_prop = 56,
+ number_prop = 1.337,
+ boolean_prop = True,
+ string_prop = '',
+ date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ array_nullable_prop = [
+ None
+ ],
+ array_and_items_nullable_prop = [
+ None
+ ],
+ array_items_nullable = [
+ None
+ ],
+ object_nullable_prop = {
+ 'key' : None
+ },
+ object_and_items_nullable_prop = {
+ 'key' : None
+ },
+ object_items_nullable = {
+ 'key' : None
+ }
+ )
+ else :
+ return NullableClass(
+ )
+
+ def testNullableClass(self):
+ """Test NullableClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_number_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_number_only.py
new file mode 100644
index 000000000000..776946c3d774
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_number_only.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.number_only import NumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestNumberOnly(unittest.TestCase):
+ """NumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test NumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.number_only.NumberOnly() # noqa: E501
+ if include_optional :
+ return NumberOnly(
+ just_number = 1.337
+ )
+ else :
+ return NumberOnly(
+ )
+
+ def testNumberOnly(self):
+ """Test NumberOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_order.py b/samples/openapi3/client/petstore/python-legacy/test/test_order.py
new file mode 100644
index 000000000000..d6ec36f83a0d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_order.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.order import Order # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOrder(unittest.TestCase):
+ """Order unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Order
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.order.Order() # noqa: E501
+ if include_optional :
+ return Order(
+ id = 56,
+ pet_id = 56,
+ quantity = 56,
+ ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ status = 'placed',
+ complete = True
+ )
+ else :
+ return Order(
+ )
+
+ def testOrder(self):
+ """Test Order"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py
new file mode 100644
index 000000000000..c6fd58849377
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_composite import OuterComposite # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterComposite(unittest.TestCase):
+ """OuterComposite unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterComposite
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
+ if include_optional :
+ return OuterComposite(
+ my_number = 1.337,
+ my_string = '',
+ my_boolean = True
+ )
+ else :
+ return OuterComposite(
+ )
+
+ def testOuterComposite(self):
+ """Test OuterComposite"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py
new file mode 100644
index 000000000000..6e3ed657f709
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum import OuterEnum # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnum(unittest.TestCase):
+ """OuterEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterEnum
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501
+ if include_optional :
+ return OuterEnum(
+ )
+ else :
+ return OuterEnum(
+ )
+
+ def testOuterEnum(self):
+ """Test OuterEnum"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py
new file mode 100644
index 000000000000..640ceb335458
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumDefaultValue(unittest.TestCase):
+ """OuterEnumDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterEnumDefaultValue
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_enum_default_value.OuterEnumDefaultValue() # noqa: E501
+ if include_optional :
+ return OuterEnumDefaultValue(
+ )
+ else :
+ return OuterEnumDefaultValue(
+ )
+
+ def testOuterEnumDefaultValue(self):
+ """Test OuterEnumDefaultValue"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py
new file mode 100644
index 000000000000..7faf5baa6c99
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumInteger(unittest.TestCase):
+ """OuterEnumInteger unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterEnumInteger
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_enum_integer.OuterEnumInteger() # noqa: E501
+ if include_optional :
+ return OuterEnumInteger(
+ )
+ else :
+ return OuterEnumInteger(
+ )
+
+ def testOuterEnumInteger(self):
+ """Test OuterEnumInteger"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py
similarity index 59%
rename from samples/openapi3/client/petstore/python/test/test_outer_enum_integer_default_value.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py
index 1854a628b83e..5a83017f7f46 100644
--- a/samples/openapi3/client/petstore/python/test/test_outer_enum_integer_default_value.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py
@@ -5,7 +5,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
@@ -13,12 +13,12 @@
from __future__ import absolute_import
import unittest
+import datetime
import petstore_api
from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
from petstore_api.rest import ApiException
-
class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
"""OuterEnumIntegerDefaultValue unit test stubs"""
@@ -28,12 +28,23 @@ def setUp(self):
def tearDown(self):
pass
- def testOuterEnumIntegerDefaultValue(self):
- """Test OuterEnumIntegerDefaultValue"""
- # FIXME: construct object with mandatory attributes with example values
+ def make_instance(self, include_optional):
+ """Test OuterEnumIntegerDefaultValue
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
# model = petstore_api.models.outer_enum_integer_default_value.OuterEnumIntegerDefaultValue() # noqa: E501
- pass
+ if include_optional :
+ return OuterEnumIntegerDefaultValue(
+ )
+ else :
+ return OuterEnumIntegerDefaultValue(
+ )
+ def testOuterEnumIntegerDefaultValue(self):
+ """Test OuterEnumIntegerDefaultValue"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_pet.py b/samples/openapi3/client/petstore/python-legacy/test/test_pet.py
new file mode 100644
index 000000000000..6d3fd2f35b04
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_pet.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.pet import Pet # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestPet(unittest.TestCase):
+ """Pet unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Pet
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.pet.Pet() # noqa: E501
+ if include_optional :
+ return Pet(
+ id = 56,
+ category = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ tags = [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ],
+ status = 'available'
+ )
+ else :
+ return Pet(
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ )
+
+ def testPet(self):
+ """Test Pet"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py
similarity index 94%
rename from samples/client/petstore/python-experimental/test/test_pet_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py
index 091b30cf8ac0..77665df879f1 100644
--- a/samples/client/petstore/python-experimental/test/test_pet_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py
@@ -11,18 +11,19 @@
from __future__ import absolute_import
-import sys
+
import unittest
import petstore_api
from petstore_api.api.pet_api import PetApi # noqa: E501
+from petstore_api.rest import ApiException
class TestPetApi(unittest.TestCase):
"""PetApi unit test stubs"""
def setUp(self):
- self.api = PetApi() # noqa: E501
+ self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py
new file mode 100644
index 000000000000..310e4b1aebbe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestReadOnlyFirst(unittest.TestCase):
+ """ReadOnlyFirst unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ReadOnlyFirst
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
+ if include_optional :
+ return ReadOnlyFirst(
+ bar = '',
+ baz = ''
+ )
+ else :
+ return ReadOnlyFirst(
+ )
+
+ def testReadOnlyFirst(self):
+ """Test ReadOnlyFirst"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py
new file mode 100644
index 000000000000..eb487cd42fc1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSpecialModelName(unittest.TestCase):
+ """SpecialModelName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SpecialModelName
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
+ if include_optional :
+ return SpecialModelName(
+ special_property_name = 56
+ )
+ else :
+ return SpecialModelName(
+ )
+
+ def testSpecialModelName(self):
+ """Test SpecialModelName"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_store_api.py
similarity index 91%
rename from samples/client/petstore/python-experimental/test/test_store_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_store_api.py
index 0d9cc3dd36ea..81848d24a67e 100644
--- a/samples/client/petstore/python-experimental/test/test_store_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_store_api.py
@@ -16,13 +16,14 @@
import petstore_api
from petstore_api.api.store_api import StoreApi # noqa: E501
+from petstore_api.rest import ApiException
class TestStoreApi(unittest.TestCase):
"""StoreApi unit test stubs"""
def setUp(self):
- self.api = StoreApi() # noqa: E501
+ self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_tag.py b/samples/openapi3/client/petstore/python-legacy/test/test_tag.py
new file mode 100644
index 000000000000..9680300032f1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_tag.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.tag import Tag # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestTag(unittest.TestCase):
+ """Tag unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Tag
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.tag.Tag() # noqa: E501
+ if include_optional :
+ return Tag(
+ id = 56,
+ name = ''
+ )
+ else :
+ return Tag(
+ )
+
+ def testTag(self):
+ """Test Tag"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_user.py b/samples/openapi3/client/petstore/python-legacy/test/test_user.py
new file mode 100644
index 000000000000..174c8e06be5d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_user.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.user import User # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestUser(unittest.TestCase):
+ """User unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test User
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.user.User() # noqa: E501
+ if include_optional :
+ return User(
+ id = 56,
+ username = '',
+ first_name = '',
+ last_name = '',
+ email = '',
+ password = '',
+ phone = '',
+ user_status = 56
+ )
+ else :
+ return User(
+ )
+
+ def testUser(self):
+ """Test User"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_user_api.py
similarity index 94%
rename from samples/client/petstore/python-experimental/test/test_user_api.py
rename to samples/openapi3/client/petstore/python-legacy/test/test_user_api.py
index df306da07761..6df730fba2b1 100644
--- a/samples/client/petstore/python-experimental/test/test_user_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/test/test_user_api.py
@@ -16,13 +16,14 @@
import petstore_api
from petstore_api.api.user_api import UserApi # noqa: E501
+from petstore_api.rest import ApiException
class TestUserApi(unittest.TestCase):
"""UserApi unit test stubs"""
def setUp(self):
- self.api = UserApi() # noqa: E501
+ self.api = petstore_api.api.user_api.UserApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python/test_python2.sh b/samples/openapi3/client/petstore/python-legacy/test_python2.sh
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/test_python2.sh
rename to samples/openapi3/client/petstore/python-legacy/test_python2.sh
diff --git a/samples/openapi3/client/petstore/python/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh
old mode 100644
new mode 100755
similarity index 100%
rename from samples/openapi3/client/petstore/python/test_python2_and_3.sh
rename to samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh
diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-legacy/tox.ini
old mode 100644
new mode 100755
similarity index 87%
rename from samples/openapi3/client/petstore/python-experimental/tox.ini
rename to samples/openapi3/client/petstore/python-legacy/tox.ini
index 8989fc3c4d96..169d895329bf
--- a/samples/openapi3/client/petstore/python-experimental/tox.ini
+++ b/samples/openapi3/client/petstore/python-legacy/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py3
+envlist = py27, py3
[testenv]
deps=-r{toxinidir}/requirements.txt
diff --git a/samples/openapi3/client/petstore/python/.gitlab-ci.yml b/samples/openapi3/client/petstore/python/.gitlab-ci.yml
index 142ce3712ed0..611e425676ee 100644
--- a/samples/openapi3/client/petstore/python/.gitlab-ci.yml
+++ b/samples/openapi3/client/petstore/python/.gitlab-ci.yml
@@ -3,31 +3,22 @@
stages:
- test
-.nosetest:
+.tests:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
-nosetest-2.7:
- extends: .nosetest
- image: python:2.7-alpine
-nosetest-3.3:
- extends: .nosetest
- image: python:3.3-alpine
-nosetest-3.4:
- extends: .nosetest
- image: python:3.4-alpine
-nosetest-3.5:
- extends: .nosetest
+test-3.5:
+ extends: .tests
image: python:3.5-alpine
-nosetest-3.6:
- extends: .nosetest
+test-3.6:
+ extends: .tests
image: python:3.6-alpine
-nosetest-3.7:
- extends: .nosetest
+test-3.7:
+ extends: .tests
image: python:3.7-alpine
-nosetest-3.8:
- extends: .nosetest
+test-3.8:
+ extends: .tests
image: python:3.8-alpine
diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES
index 1607b2b462b9..3721f9fc336a 100644
--- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES
+++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES
@@ -3,30 +3,50 @@
.travis.yml
README.md
docs/AdditionalPropertiesClass.md
+docs/AdditionalPropertiesWithArrayOfEnums.md
+docs/Address.md
docs/Animal.md
+docs/AnimalFarm.md
docs/AnotherFakeApi.md
docs/ApiResponse.md
+docs/Apple.md
+docs/AppleReq.md
docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfEnums.md
docs/ArrayOfNumberOnly.md
docs/ArrayTest.md
+docs/Banana.md
+docs/BananaReq.md
+docs/BasquePig.md
docs/Capitalization.md
docs/Cat.md
docs/CatAllOf.md
docs/Category.md
+docs/ChildCat.md
+docs/ChildCatAllOf.md
docs/ClassModel.md
docs/Client.md
+docs/ComplexQuadrilateral.md
+docs/ComposedOneOfNumberWithValidations.md
+docs/DanishPig.md
docs/DefaultApi.md
docs/Dog.md
docs/DogAllOf.md
+docs/Drawing.md
docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
+docs/EquilateralTriangle.md
docs/FakeApi.md
docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
docs/Foo.md
docs/FormatTest.md
+docs/Fruit.md
+docs/FruitReq.md
+docs/GmFruit.md
+docs/GrandparentAnimal.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
@@ -36,28 +56,50 @@ docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
+docs/IntegerEnum.md
+docs/IntegerEnumOneValue.md
+docs/IntegerEnumWithDefaultValue.md
+docs/IsoscelesTriangle.md
docs/List.md
+docs/Mammal.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
docs/ModelReturn.md
docs/Name.md
docs/NullableClass.md
+docs/NullableShape.md
docs/NumberOnly.md
+docs/NumberWithValidations.md
+docs/ObjectInterface.md
+docs/ObjectModelWithRefProps.md
+docs/ObjectWithValidations.md
docs/Order.md
-docs/OuterComposite.md
-docs/OuterEnum.md
-docs/OuterEnumDefaultValue.md
-docs/OuterEnumInteger.md
-docs/OuterEnumIntegerDefaultValue.md
+docs/ParentPet.md
docs/Pet.md
docs/PetApi.md
+docs/Pig.md
+docs/Quadrilateral.md
+docs/QuadrilateralInterface.md
docs/ReadOnlyFirst.md
+docs/ScaleneTriangle.md
+docs/Shape.md
+docs/ShapeInterface.md
+docs/ShapeOrNull.md
+docs/SimpleQuadrilateral.md
+docs/SomeObject.md
docs/SpecialModelName.md
docs/StoreApi.md
+docs/StringBooleanMap.md
+docs/StringEnum.md
+docs/StringEnumWithDefaultValue.md
docs/Tag.md
+docs/Triangle.md
+docs/TriangleInterface.md
docs/User.md
docs/UserApi.md
+docs/Whale.md
+docs/Zebra.md
git_push.sh
petstore_api/__init__.py
petstore_api/api/__init__.py
@@ -69,59 +111,105 @@ petstore_api/api/pet_api.py
petstore_api/api/store_api.py
petstore_api/api/user_api.py
petstore_api/api_client.py
+petstore_api/apis/__init__.py
petstore_api/configuration.py
petstore_api/exceptions.py
+petstore_api/model/additional_properties_class.py
+petstore_api/model/additional_properties_with_array_of_enums.py
+petstore_api/model/address.py
+petstore_api/model/animal.py
+petstore_api/model/animal_farm.py
+petstore_api/model/api_response.py
+petstore_api/model/apple.py
+petstore_api/model/apple_req.py
+petstore_api/model/array_of_array_of_number_only.py
+petstore_api/model/array_of_enums.py
+petstore_api/model/array_of_number_only.py
+petstore_api/model/array_test.py
+petstore_api/model/banana.py
+petstore_api/model/banana_req.py
+petstore_api/model/basque_pig.py
+petstore_api/model/capitalization.py
+petstore_api/model/cat.py
+petstore_api/model/cat_all_of.py
+petstore_api/model/category.py
+petstore_api/model/child_cat.py
+petstore_api/model/child_cat_all_of.py
+petstore_api/model/class_model.py
+petstore_api/model/client.py
+petstore_api/model/complex_quadrilateral.py
+petstore_api/model/composed_one_of_number_with_validations.py
+petstore_api/model/danish_pig.py
+petstore_api/model/dog.py
+petstore_api/model/dog_all_of.py
+petstore_api/model/drawing.py
+petstore_api/model/enum_arrays.py
+petstore_api/model/enum_class.py
+petstore_api/model/enum_test.py
+petstore_api/model/equilateral_triangle.py
+petstore_api/model/file.py
+petstore_api/model/file_schema_test_class.py
+petstore_api/model/foo.py
+petstore_api/model/format_test.py
+petstore_api/model/fruit.py
+petstore_api/model/fruit_req.py
+petstore_api/model/gm_fruit.py
+petstore_api/model/grandparent_animal.py
+petstore_api/model/has_only_read_only.py
+petstore_api/model/health_check_result.py
+petstore_api/model/inline_object.py
+petstore_api/model/inline_object1.py
+petstore_api/model/inline_object2.py
+petstore_api/model/inline_object3.py
+petstore_api/model/inline_object4.py
+petstore_api/model/inline_object5.py
+petstore_api/model/inline_response_default.py
+petstore_api/model/integer_enum.py
+petstore_api/model/integer_enum_one_value.py
+petstore_api/model/integer_enum_with_default_value.py
+petstore_api/model/isosceles_triangle.py
+petstore_api/model/list.py
+petstore_api/model/mammal.py
+petstore_api/model/map_test.py
+petstore_api/model/mixed_properties_and_additional_properties_class.py
+petstore_api/model/model200_response.py
+petstore_api/model/model_return.py
+petstore_api/model/name.py
+petstore_api/model/nullable_class.py
+petstore_api/model/nullable_shape.py
+petstore_api/model/number_only.py
+petstore_api/model/number_with_validations.py
+petstore_api/model/object_interface.py
+petstore_api/model/object_model_with_ref_props.py
+petstore_api/model/object_with_validations.py
+petstore_api/model/order.py
+petstore_api/model/parent_pet.py
+petstore_api/model/pet.py
+petstore_api/model/pig.py
+petstore_api/model/quadrilateral.py
+petstore_api/model/quadrilateral_interface.py
+petstore_api/model/read_only_first.py
+petstore_api/model/scalene_triangle.py
+petstore_api/model/shape.py
+petstore_api/model/shape_interface.py
+petstore_api/model/shape_or_null.py
+petstore_api/model/simple_quadrilateral.py
+petstore_api/model/some_object.py
+petstore_api/model/special_model_name.py
+petstore_api/model/string_boolean_map.py
+petstore_api/model/string_enum.py
+petstore_api/model/string_enum_with_default_value.py
+petstore_api/model/tag.py
+petstore_api/model/triangle.py
+petstore_api/model/triangle_interface.py
+petstore_api/model/user.py
+petstore_api/model/whale.py
+petstore_api/model/zebra.py
+petstore_api/model_utils.py
+petstore_api/models/__init__.py
petstore_api/models/__init__.py
-petstore_api/models/additional_properties_class.py
-petstore_api/models/animal.py
-petstore_api/models/api_response.py
-petstore_api/models/array_of_array_of_number_only.py
-petstore_api/models/array_of_number_only.py
-petstore_api/models/array_test.py
-petstore_api/models/capitalization.py
-petstore_api/models/cat.py
-petstore_api/models/cat_all_of.py
-petstore_api/models/category.py
-petstore_api/models/class_model.py
-petstore_api/models/client.py
-petstore_api/models/dog.py
-petstore_api/models/dog_all_of.py
-petstore_api/models/enum_arrays.py
-petstore_api/models/enum_class.py
-petstore_api/models/enum_test.py
-petstore_api/models/file.py
-petstore_api/models/file_schema_test_class.py
-petstore_api/models/foo.py
-petstore_api/models/format_test.py
-petstore_api/models/has_only_read_only.py
-petstore_api/models/health_check_result.py
-petstore_api/models/inline_object.py
-petstore_api/models/inline_object1.py
-petstore_api/models/inline_object2.py
-petstore_api/models/inline_object3.py
-petstore_api/models/inline_object4.py
-petstore_api/models/inline_object5.py
-petstore_api/models/inline_response_default.py
-petstore_api/models/list.py
-petstore_api/models/map_test.py
-petstore_api/models/mixed_properties_and_additional_properties_class.py
-petstore_api/models/model200_response.py
-petstore_api/models/model_return.py
-petstore_api/models/name.py
-petstore_api/models/nullable_class.py
-petstore_api/models/number_only.py
-petstore_api/models/order.py
-petstore_api/models/outer_composite.py
-petstore_api/models/outer_enum.py
-petstore_api/models/outer_enum_default_value.py
-petstore_api/models/outer_enum_integer.py
-petstore_api/models/outer_enum_integer_default_value.py
-petstore_api/models/pet.py
-petstore_api/models/read_only_first.py
-petstore_api/models/special_model_name.py
-petstore_api/models/tag.py
-petstore_api/models/user.py
petstore_api/rest.py
+petstore_api/signing.py
requirements.txt
setup.cfg
setup.py
diff --git a/samples/openapi3/client/petstore/python/.travis.yml b/samples/openapi3/client/petstore/python/.travis.yml
index fcd7e31c7ccf..f931f0f74b96 100644
--- a/samples/openapi3/client/petstore/python/.travis.yml
+++ b/samples/openapi3/client/petstore/python/.travis.yml
@@ -1,10 +1,6 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- - "2.7"
- - "3.2"
- - "3.3"
- - "3.4"
- "3.5"
- "3.6"
- "3.7"
diff --git a/samples/openapi3/client/petstore/python/Makefile b/samples/openapi3/client/petstore/python/Makefile
index ba5c5e73c63c..f8957d5ed65d 100644
--- a/samples/openapi3/client/petstore/python/Makefile
+++ b/samples/openapi3/client/petstore/python/Makefile
@@ -1,5 +1,3 @@
- #!/bin/bash
-
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
@@ -15,7 +13,4 @@ clean:
find . -name "__pycache__" -delete
test: clean
- bash ./test_python2.sh
-
-test-all: clean
- bash ./test_python2_and_3.sh
+ bash ./test_python.sh
diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md
index 2cf7fdb9636d..f2155266d238 100644
--- a/samples/openapi3/client/petstore/python/README.md
+++ b/samples/openapi3/client/petstore/python/README.md
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
## Requirements.
-Python 2.7 and 3.4+
+Python >= 3.5
## Installation & Usage
### pip install
@@ -45,13 +45,12 @@ import petstore_api
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
-from __future__ import print_function
import datetime
import time
import petstore_api
-from petstore_api.rest import ApiException
from pprint import pprint
-
+from petstore_api.api import another_fake_api
+from petstore_api.model.client import Client
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
@@ -63,16 +62,17 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.AnotherFakeApi(api_client)
- client = petstore_api.Client() # Client | client model
+ api_instance = another_fake_api.AnotherFakeApi(api_client)
+ client = Client(
+ client="client_example",
+ ) # Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
-
```
## Documentation for API Endpoints
@@ -83,12 +83,17 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
+*FakeApi* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
+*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
+*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums
+*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean |
+*FakeApi* | [**composed_one_of_number_with_validations**](docs/FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations |
*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
-*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
-*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
-*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
-*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
-*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal |
+*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
+*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
+*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
+*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
@@ -125,26 +130,46 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md)
+ - [Address](docs/Address.md)
- [Animal](docs/Animal.md)
+ - [AnimalFarm](docs/AnimalFarm.md)
- [ApiResponse](docs/ApiResponse.md)
+ - [Apple](docs/Apple.md)
+ - [AppleReq](docs/AppleReq.md)
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfEnums](docs/ArrayOfEnums.md)
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
+ - [Banana](docs/Banana.md)
+ - [BananaReq](docs/BananaReq.md)
+ - [BasquePig](docs/BasquePig.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [CatAllOf](docs/CatAllOf.md)
- [Category](docs/Category.md)
+ - [ChildCat](docs/ChildCat.md)
+ - [ChildCatAllOf](docs/ChildCatAllOf.md)
- [ClassModel](docs/ClassModel.md)
- [Client](docs/Client.md)
+ - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
+ - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md)
+ - [DanishPig](docs/DanishPig.md)
- [Dog](docs/Dog.md)
- [DogAllOf](docs/DogAllOf.md)
+ - [Drawing](docs/Drawing.md)
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
+ - [EquilateralTriangle](docs/EquilateralTriangle.md)
- [File](docs/File.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FormatTest](docs/FormatTest.md)
+ - [Fruit](docs/Fruit.md)
+ - [FruitReq](docs/FruitReq.md)
+ - [GmFruit](docs/GmFruit.md)
+ - [GrandparentAnimal](docs/GrandparentAnimal.md)
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [HealthCheckResult](docs/HealthCheckResult.md)
- [InlineObject](docs/InlineObject.md)
@@ -154,25 +179,47 @@ Class | Method | HTTP request | Description
- [InlineObject4](docs/InlineObject4.md)
- [InlineObject5](docs/InlineObject5.md)
- [InlineResponseDefault](docs/InlineResponseDefault.md)
+ - [IntegerEnum](docs/IntegerEnum.md)
+ - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md)
+ - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md)
+ - [IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [List](docs/List.md)
+ - [Mammal](docs/Mammal.md)
- [MapTest](docs/MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model200Response.md)
- [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md)
- [NullableClass](docs/NullableClass.md)
+ - [NullableShape](docs/NullableShape.md)
- [NumberOnly](docs/NumberOnly.md)
+ - [NumberWithValidations](docs/NumberWithValidations.md)
+ - [ObjectInterface](docs/ObjectInterface.md)
+ - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md)
+ - [ObjectWithValidations](docs/ObjectWithValidations.md)
- [Order](docs/Order.md)
- - [OuterComposite](docs/OuterComposite.md)
- - [OuterEnum](docs/OuterEnum.md)
- - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- - [OuterEnumInteger](docs/OuterEnumInteger.md)
- - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
+ - [ParentPet](docs/ParentPet.md)
- [Pet](docs/Pet.md)
+ - [Pig](docs/Pig.md)
+ - [Quadrilateral](docs/Quadrilateral.md)
+ - [QuadrilateralInterface](docs/QuadrilateralInterface.md)
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [ScaleneTriangle](docs/ScaleneTriangle.md)
+ - [Shape](docs/Shape.md)
+ - [ShapeInterface](docs/ShapeInterface.md)
+ - [ShapeOrNull](docs/ShapeOrNull.md)
+ - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
+ - [SomeObject](docs/SomeObject.md)
- [SpecialModelName](docs/SpecialModelName.md)
+ - [StringBooleanMap](docs/StringBooleanMap.md)
+ - [StringEnum](docs/StringEnum.md)
+ - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md)
- [Tag](docs/Tag.md)
+ - [Triangle](docs/Triangle.md)
+ - [TriangleInterface](docs/TriangleInterface.md)
- [User](docs/User.md)
+ - [Whale](docs/Whale.md)
+ - [Zebra](docs/Zebra.md)
## Documentation For Authorization
@@ -204,6 +251,7 @@ Class | Method | HTTP request | Description
## http_signature_test
+- **Type**: HTTP signature authentication
## petstore_auth
@@ -221,3 +269,22 @@ Class | Method | HTTP request | Description
+## Notes for Large OpenAPI documents
+If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a
+RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
+
+Solution 1:
+Use specific imports for apis and models like:
+- `from petstore_api.api.default_api import DefaultApi`
+- `from petstore_api.model.pet import Pet`
+
+Solution 1:
+Before importing the package, adjust the maximum recursion limit as shown below:
+```
+import sys
+sys.setrecursionlimit(1500)
+import petstore_api
+from petstore_api.apis import *
+from petstore_api.models import *
+```
+
diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md
index 796a789d4c4b..e54a02329f1b 100644
--- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md
+++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md
@@ -3,8 +3,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_property** | **dict(str, str)** | | [optional]
-**map_of_map_property** | **dict(str, dict(str, str))** | | [optional]
+**map_property** | **{str: (str,)}** | | [optional]
+**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional]
+**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
+**map_with_undeclared_properties_anytype_1** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
+**map_with_undeclared_properties_anytype_2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
+**map_with_undeclared_properties_anytype_3** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
+**empty_map** | **bool, date, datetime, dict, float, int, list, str** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional]
+**map_with_undeclared_properties_string** | **{str: (str,)}** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md
rename to samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Address.md b/samples/openapi3/client/petstore/python/docs/Address.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Address.md
rename to samples/openapi3/client/petstore/python/docs/Address.md
diff --git a/samples/openapi3/client/petstore/python/docs/Animal.md b/samples/openapi3/client/petstore/python/docs/Animal.md
index 7ed4ba541fa3..698dc711aeb9 100644
--- a/samples/openapi3/client/petstore/python/docs/Animal.md
+++ b/samples/openapi3/client/petstore/python/docs/Animal.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
-**color** | **str** | | [optional] [default to 'red']
+**color** | **str** | | [optional] if omitted the server will use the default value of "red"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python/docs/AnimalFarm.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md
rename to samples/openapi3/client/petstore/python/docs/AnimalFarm.md
diff --git a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md
index ecd52ad7705d..402031d6beef 100644
--- a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md
+++ b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md
@@ -17,10 +17,10 @@ To test special tags and operation ID starting with number
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import another_fake_api
+from petstore_api.model.client import Client
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -32,14 +32,17 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.AnotherFakeApi(api_client)
- client = petstore_api.Client() # Client | client model
+ api_instance = another_fake_api.AnotherFakeApi(api_client)
+ client = Client(
+ client="client_example",
+ ) # Client | client model
+ # example passing only required values which don't have defaults set
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
```
@@ -47,7 +50,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **client** | [**Client**](Client.md)| client model |
+ **client** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Apple.md b/samples/openapi3/client/petstore/python/docs/Apple.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Apple.md
rename to samples/openapi3/client/petstore/python/docs/Apple.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md b/samples/openapi3/client/petstore/python/docs/AppleReq.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md
rename to samples/openapi3/client/petstore/python/docs/AppleReq.md
diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
index aa3988ab1679..1a68df0090bb 100644
--- a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
+++ b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_array_number** | **list[list[float]]** | | [optional]
+**array_array_number** | **[[float]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md
rename to samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md
diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md
index 2c3de967aec6..b8a760f56dc2 100644
--- a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md
+++ b/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_number** | **list[float]** | | [optional]
+**array_number** | **[float]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/ArrayTest.md b/samples/openapi3/client/petstore/python/docs/ArrayTest.md
index 6ab0d1378065..b94f23fd2271 100644
--- a/samples/openapi3/client/petstore/python/docs/ArrayTest.md
+++ b/samples/openapi3/client/petstore/python/docs/ArrayTest.md
@@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**array_of_string** | **list[str]** | | [optional]
-**array_array_of_integer** | **list[list[int]]** | | [optional]
-**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional]
+**array_of_string** | **[str]** | | [optional]
+**array_array_of_integer** | **[[int]]** | | [optional]
+**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Banana.md b/samples/openapi3/client/petstore/python/docs/Banana.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Banana.md
rename to samples/openapi3/client/petstore/python/docs/Banana.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md b/samples/openapi3/client/petstore/python/docs/BananaReq.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md
rename to samples/openapi3/client/petstore/python/docs/BananaReq.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md b/samples/openapi3/client/petstore/python/docs/BasquePig.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md
rename to samples/openapi3/client/petstore/python/docs/BasquePig.md
diff --git a/samples/openapi3/client/petstore/python/docs/Cat.md b/samples/openapi3/client/petstore/python/docs/Cat.md
index 8d30565d014e..86f6c0e11dcf 100644
--- a/samples/openapi3/client/petstore/python/docs/Cat.md
+++ b/samples/openapi3/client/petstore/python/docs/Cat.md
@@ -3,7 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
**declawed** | **bool** | | [optional]
+**color** | **str** | | [optional] if omitted the server will use the default value of "red"
+**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/Category.md b/samples/openapi3/client/petstore/python/docs/Category.md
index 7e5c1e316499..287225d66fd7 100644
--- a/samples/openapi3/client/petstore/python/docs/Category.md
+++ b/samples/openapi3/client/petstore/python/docs/Category.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**name** | **str** | | defaults to "default-name"
**id** | **int** | | [optional]
-**name** | **str** | | [default to 'default-name']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md b/samples/openapi3/client/petstore/python/docs/ChildCat.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md
rename to samples/openapi3/client/petstore/python/docs/ChildCat.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md
rename to samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python/docs/ComplexQuadrilateral.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md
rename to samples/openapi3/client/petstore/python/docs/ComplexQuadrilateral.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md b/samples/openapi3/client/petstore/python/docs/ComposedOneOfNumberWithValidations.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md
rename to samples/openapi3/client/petstore/python/docs/ComposedOneOfNumberWithValidations.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md b/samples/openapi3/client/petstore/python/docs/DanishPig.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md
rename to samples/openapi3/client/petstore/python/docs/DanishPig.md
diff --git a/samples/openapi3/client/petstore/python/docs/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/DefaultApi.md
index 7f022fd7d3eb..3fffa95ff343 100644
--- a/samples/openapi3/client/petstore/python/docs/DefaultApi.md
+++ b/samples/openapi3/client/petstore/python/docs/DefaultApi.md
@@ -15,10 +15,10 @@ Method | HTTP request | Description
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import default_api
+from petstore_api.model.inline_response_default import InlineResponseDefault
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -30,12 +30,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.DefaultApi(api_client)
-
+ api_instance = default_api.DefaultApi(api_client)
+
+ # example, this endpoint has no required or optional parameters
try:
api_response = api_instance.foo_get()
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling DefaultApi->foo_get: %s\n" % e)
```
diff --git a/samples/openapi3/client/petstore/python/docs/Dog.md b/samples/openapi3/client/petstore/python/docs/Dog.md
index f727487975c4..fa9568060923 100644
--- a/samples/openapi3/client/petstore/python/docs/Dog.md
+++ b/samples/openapi3/client/petstore/python/docs/Dog.md
@@ -3,7 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
**breed** | **str** | | [optional]
+**color** | **str** | | [optional] if omitted the server will use the default value of "red"
+**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md b/samples/openapi3/client/petstore/python/docs/Drawing.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Drawing.md
rename to samples/openapi3/client/petstore/python/docs/Drawing.md
diff --git a/samples/openapi3/client/petstore/python/docs/EnumArrays.md b/samples/openapi3/client/petstore/python/docs/EnumArrays.md
index e15a5f1fd049..e0b5582e9d5b 100644
--- a/samples/openapi3/client/petstore/python/docs/EnumArrays.md
+++ b/samples/openapi3/client/petstore/python/docs/EnumArrays.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**just_symbol** | **str** | | [optional]
-**array_enum** | **list[str]** | | [optional]
+**array_enum** | **[str]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/EnumClass.md b/samples/openapi3/client/petstore/python/docs/EnumClass.md
index 67f017becd0c..6dda7fd8a77f 100644
--- a/samples/openapi3/client/petstore/python/docs/EnumClass.md
+++ b/samples/openapi3/client/petstore/python/docs/EnumClass.md
@@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/EnumTest.md b/samples/openapi3/client/petstore/python/docs/EnumTest.md
index bd1e2beb90d3..70969239ca25 100644
--- a/samples/openapi3/client/petstore/python/docs/EnumTest.md
+++ b/samples/openapi3/client/petstore/python/docs/EnumTest.md
@@ -3,14 +3,15 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**enum_string** | **str** | | [optional]
**enum_string_required** | **str** | |
+**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
-**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
-**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
-**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
-**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
+**string_enum** | [**StringEnum**](StringEnum.md) | | [optional]
+**integer_enum** | [**IntegerEnum**](IntegerEnum.md) | | [optional]
+**string_enum_with_default_value** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional]
+**integer_enum_with_default_value** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional]
+**integer_enum_one_value** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/python/docs/EquilateralTriangle.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md
rename to samples/openapi3/client/petstore/python/docs/EquilateralTriangle.md
diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md
index 50de8cc758fa..a5cbcb9e0f7e 100644
--- a/samples/openapi3/client/petstore/python/docs/FakeApi.md
+++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md
@@ -4,12 +4,17 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
+[**additional_properties_with_array_of_enums**](FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
+[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
+[**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums
+[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean |
+[**composed_one_of_number_with_validations**](FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations |
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
-[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
-[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
-[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
-[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
-[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+[**mammal**](FakeApi.md#mammal) | **POST** /fake/refs/mammal |
+[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
+[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
+[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
+[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
@@ -21,18 +26,18 @@ Method | HTTP request | Description
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
-# **fake_health_get**
-> HealthCheckResult fake_health_get()
+# **additional_properties_with_array_of_enums**
+> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums()
-Health check endpoint
+Additional Properties with Array of Enums
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -44,22 +49,32 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
-
+ api_instance = fake_api.FakeApi(api_client)
+ additional_properties_with_array_of_enums = AdditionalPropertiesWithArrayOfEnums(
+ "key": [
+ EnumClass("-efg"),
+ ],
+ ) # AdditionalPropertiesWithArrayOfEnums | Input enum (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- # Health check endpoint
- api_response = api_instance.fake_health_get()
+ # Additional Properties with Array of Enums
+ api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums=additional_properties_with_array_of_enums)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e)
```
### Parameters
-This endpoint does not need any parameter.
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **additional_properties_with_array_of_enums** | [**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional]
### Return type
-[**HealthCheckResult**](HealthCheckResult.md)
+[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)
### Authorization
@@ -67,28 +82,30 @@ No authorization required
### HTTP request headers
- - **Content-Type**: Not defined
+ - **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | The instance started successfully | - |
+**200** | Got object with additional properties with array of enums | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_http_signature_test**
-> fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+# **array_model**
+> AnimalFarm array_model()
-test http signature authentication
+
+
+Test serialization of ArrayModel
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.animal_farm import AnimalFarm
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -96,116 +113,116 @@ configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-# Configure HTTP message signature: http_signature_test
-# The HTTP Signature Header mechanism that can be used by a client to
-# authenticate the sender of a message and ensure that particular headers
-# have not been modified in transit.
-#
-# You can specify the signing key-id, private key path, signing scheme,
-# signing algorithm, list of signed headers and signature max validity.
-# The 'key_id' parameter is an opaque string that the API server can use
-# to lookup the client and validate the signature.
-# The 'private_key_path' parameter should be the path to a file that
-# contains a DER or base-64 encoded private key.
-# The 'private_key_passphrase' parameter is optional. Set the passphrase
-# if the private key is encrypted.
-# The 'signed_headers' parameter is used to specify the list of
-# HTTP headers included when generating the signature for the message.
-# You can specify HTTP headers that you want to protect with a cryptographic
-# signature. Note that proxies may add, modify or remove HTTP headers
-# for legitimate reasons, so you should only add headers that you know
-# will not be modified. For example, if you want to protect the HTTP request
-# body, you can specify the Digest header. In that case, the client calculates
-# the digest of the HTTP request body and includes the digest in the message
-# signature.
-# The 'signature_max_validity' parameter is optional. It is configured as a
-# duration to express when the signature ceases to be valid. The client calculates
-# the expiration date every time it generates the cryptographic signature
-# of an HTTP request. The API server may have its own security policy
-# that controls the maximum validity of the signature. The client max validity
-# must be lower than the server max validity.
-# The time on the client and server must be synchronized, otherwise the
-# server may reject the client signature.
-#
-# The client must use a combination of private key, signing scheme,
-# signing algorithm and hash algorithm that matches the security policy of
-# the API server.
-#
-# See petstore_api.signing for a list of all supported parameters.
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ body = AnimalFarm([
+ Animal(),
+ ]) # AnimalFarm | Input model (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ api_response = api_instance.array_model(body=body)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->array_model: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional]
+
+### Return type
+
+[**AnimalFarm**](AnimalFarm.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output model | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **array_of_enums**
+> ArrayOfEnums array_of_enums()
+
+Array of Enums
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from petstore_api.model.array_of_enums import ArrayOfEnums
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
- host = "http://petstore.swagger.io:80/v2",
- signing_info = petstore_api.signing.HttpSigningConfiguration(
- key_id = 'my-key-id',
- private_key_path = 'private_key.pem',
- private_key_passphrase = 'YOUR_PASSPHRASE',
- signing_scheme = petstore_api.signing.SCHEME_HS2019,
- signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
- hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
- signed_headers = [
- petstore_api.signing.HEADER_REQUEST_TARGET,
- petstore_api.signing.HEADER_CREATED,
- petstore_api.signing.HEADER_EXPIRES,
- petstore_api.signing.HEADER_HOST,
- petstore_api.signing.HEADER_DATE,
- petstore_api.signing.HEADER_DIGEST,
- 'Content-Type',
- 'Content-Length',
- 'User-Agent'
- ],
- signature_max_validity = datetime.timedelta(minutes=5)
- )
+ host = "http://petstore.swagger.io:80/v2"
)
+
# Enter a context with an instance of the API client
-with petstore_api.ApiClient(configuration) as api_client:
+with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
-query_1 = 'query_1_example' # str | query parameter (optional)
-header_1 = 'header_1_example' # str | header parameter (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ array_of_enums = ArrayOfEnums([
+ StringEnum("placed"),
+ ]) # ArrayOfEnums | Input enum (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- # test http signature authentication
- api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
+ # Array of Enums
+ api_response = api_instance.array_of_enums(array_of_enums=array_of_enums)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->array_of_enums: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
- **query_1** | **str**| query parameter | [optional]
- **header_1** | **str**| header parameter | [optional]
+ **array_of_enums** | [**ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional]
### Return type
-void (empty response body)
+[**ArrayOfEnums**](ArrayOfEnums.md)
### Authorization
-[http_signature_test](../README.md#http_signature_test)
+No authorization required
### HTTP request headers
- - **Content-Type**: application/json, application/xml
- - **Accept**: Not defined
+ - **Content-Type**: application/json
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | The instance started successfully | - |
+**200** | Got named array of enums | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_boolean_serialize**
-> bool fake_outer_boolean_serialize(body=body)
+# **boolean**
+> bool boolean()
@@ -214,10 +231,9 @@ Test serialization of outer boolean types
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -229,21 +245,23 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
+ api_instance = fake_api.FakeApi(api_client)
body = True # bool | Input boolean as post body (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_boolean_serialize(body=body)
+ api_response = api_instance.boolean(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->boolean: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **bool**| Input boolean as post body | [optional]
+ **body** | **bool**| Input boolean as post body | [optional]
### Return type
@@ -256,7 +274,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: */*
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
@@ -265,20 +283,81 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_composite_serialize**
-> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
+# **composed_one_of_number_with_validations**
+> ComposedOneOfNumberWithValidations composed_one_of_number_with_validations()
+
+
+
+Test serialization of object with $refed properties
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ composed_one_of_number_with_validations = ComposedOneOfNumberWithValidations() # ComposedOneOfNumberWithValidations | Input model (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations=composed_one_of_number_with_validations)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->composed_one_of_number_with_validations: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **composed_one_of_number_with_validations** | [**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional]
+
+### Return type
+
+[**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output model | - |
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-Test serialization of object with outer number type
+# **fake_health_get**
+> HealthCheckResult fake_health_get()
+
+Health check endpoint
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.health_check_result import HealthCheckResult
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -290,25 +369,89 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
+ api_instance = fake_api.FakeApi(api_client)
+
+ # example, this endpoint has no required or optional parameters
+ try:
+ # Health check endpoint
+ api_response = api_instance.fake_health_get()
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **mammal**
+> Mammal mammal(mammal)
+
+
+
+Test serialization of mammals
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from petstore_api.model.mammal import Mammal
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ mammal = Mammal(
+ has_baleen=True,
+ has_teeth=True,
+ class_name="whale",
+ ) # Mammal | Input mammal
+
+ # example passing only required values which don't have defaults set
try:
- api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
+ api_response = api_instance.mammal(mammal)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->mammal: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+ **mammal** | [**Mammal**](Mammal.md)| Input mammal |
### Return type
-[**OuterComposite**](OuterComposite.md)
+[**Mammal**](Mammal.md)
### Authorization
@@ -317,17 +460,17 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: */*
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Output composite | - |
+**200** | Output mammal | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_number_serialize**
-> float fake_outer_number_serialize(body=body)
+# **number_with_validations**
+> NumberWithValidations number_with_validations()
@@ -336,10 +479,10 @@ Test serialization of outer number types
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.number_with_validations import NumberWithValidations
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -351,25 +494,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = 3.4 # float | Input number as post body (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ body = NumberWithValidations(10) # NumberWithValidations | Input number as post body (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_number_serialize(body=body)
+ api_response = api_instance.number_with_validations(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->number_with_validations: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **float**| Input number as post body | [optional]
+ **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional]
### Return type
-**float**
+[**NumberWithValidations**](NumberWithValidations.md)
### Authorization
@@ -378,7 +523,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: */*
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
@@ -387,8 +532,75 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **fake_outer_string_serialize**
-> str fake_outer_string_serialize(body=body)
+# **object_model_with_ref_props**
+> ObjectModelWithRefProps object_model_with_ref_props()
+
+
+
+Test serialization of object with $refed properties
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ body = ObjectModelWithRefProps(
+ my_number=NumberWithValidations(10),
+ my_string="my_string_example",
+ my_boolean=True,
+ ) # ObjectModelWithRefProps | Input model (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ api_response = api_instance.object_model_with_ref_props(body=body)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional]
+
+### Return type
+
+[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output model | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **string**
+> str string()
@@ -397,10 +609,9 @@ Test serialization of outer string types
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -412,21 +623,23 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- body = 'body_example' # str | Input string as post body (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ body = "body_example" # str | Input string as post body (optional)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
- api_response = api_instance.fake_outer_string_serialize(body=body)
+ api_response = api_instance.string(body=body)
pprint(api_response)
- except ApiException as e:
- print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->string: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | **str**| Input string as post body | [optional]
+ **body** | **str**| Input string as post body | [optional]
### Return type
@@ -439,7 +652,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: */*
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
@@ -448,6 +661,69 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+# **string_enum**
+> StringEnum string_enum()
+
+
+
+Test serialization of outer enum
+
+### Example
+
+```python
+import time
+import petstore_api
+from petstore_api.api import fake_api
+from petstore_api.model.string_enum import StringEnum
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = fake_api.FakeApi(api_client)
+ body = StringEnum("placed") # StringEnum | Input enum (optional)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
+ try:
+ api_response = api_instance.string_enum(body=body)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->string_enum: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional]
+
+### Return type
+
+[**StringEnum**](StringEnum.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output enum | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
# **test_body_with_file_schema**
> test_body_with_file_schema(file_schema_test_class)
@@ -458,10 +734,10 @@ For this test, the body for this request much reference a schema named `File`.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -473,12 +749,22 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
-
+ api_instance = fake_api.FakeApi(api_client)
+ file_schema_test_class = FileSchemaTestClass(
+ file=File(
+ source_uri="source_uri_example",
+ ),
+ files=[
+ File(
+ source_uri="source_uri_example",
+ ),
+ ],
+ ) # FileSchemaTestClass |
+
+ # example passing only required values which don't have defaults set
try:
api_instance.test_body_with_file_schema(file_schema_test_class)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
@@ -486,7 +772,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+ **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
@@ -516,10 +802,10 @@ No authorization required
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -531,13 +817,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- query = 'query_example' # str |
-user = petstore_api.User() # User |
-
+ api_instance = fake_api.FakeApi(api_client)
+ query = "query_example" # str |
+ user = User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ object_with_no_declared_props={},
+ object_with_no_declared_props_nullable={},
+ any_type_prop=None,
+ any_type_prop_nullable=None,
+ ) # User |
+
+ # example passing only required values which don't have defaults set
try:
api_instance.test_body_with_query_params(query, user)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
@@ -545,8 +845,8 @@ user = petstore_api.User() # User |
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **query** | **str**| |
- **user** | [**User**](User.md)| |
+ **query** | **str**| |
+ **user** | [**User**](User.md)| |
### Return type
@@ -578,10 +878,10 @@ To test \"client\" model
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
+from petstore_api.model.client import Client
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -593,14 +893,17 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- client = petstore_api.Client() # Client | client model
+ api_instance = fake_api.FakeApi(api_client)
+ client = Client(
+ client="client_example",
+ ) # Client | client model
+ # example passing only required values which don't have defaults set
try:
# To test \"client\" model
api_response = api_instance.test_client_model(client)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
```
@@ -608,7 +911,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **client** | [**Client**](Client.md)| client model |
+ **client** | [**Client**](Client.md)| client model |
### Return type
@@ -631,7 +934,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_endpoint_parameters**
-> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -641,10 +944,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
* Basic Authentication (http_basic_test):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -666,26 +968,35 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- number = 3.4 # float | None
-double = 3.4 # float | None
-pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
-byte = 'byte_example' # str | None
-integer = 56 # int | None (optional)
-int32 = 56 # int | None (optional)
-int64 = 56 # int | None (optional)
-float = 3.4 # float | None (optional)
-string = 'string_example' # str | None (optional)
-binary = '/path/to/file' # file | None (optional)
-date = '2013-10-20' # date | None (optional)
-date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
-password = 'password_example' # str | None (optional)
-param_callback = 'param_callback_example' # str | None (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ number = 32.1 # float | None
+ double = 67.8 # float | None
+ pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C" # str | None
+ byte = 'YQ==' # str | None
+ integer = 10 # int | None (optional)
+ int32 = 20 # int | None (optional)
+ int64 = 1 # int | None (optional)
+ float = 3.14 # float | None (optional)
+ string = "a" # str | None (optional)
+ binary = open('/path/to/file', 'rb') # file_type | None (optional)
+ date = dateutil_parser('1970-01-01').date() # date | None (optional)
+ date_time = dateutil_parser('2020-02-02T20:20:20.22222Z') # datetime | None (optional) if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
+ password = "password_example" # str | None (optional)
+ param_callback = "param_callback_example" # str | None (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
```
@@ -693,20 +1004,20 @@ param_callback = 'param_callback_example' # str | None (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **number** | **float**| None |
- **double** | **float**| None |
- **pattern_without_delimiter** | **str**| None |
- **byte** | **str**| None |
- **integer** | **int**| None | [optional]
- **int32** | **int**| None | [optional]
- **int64** | **int**| None | [optional]
- **float** | **float**| None | [optional]
- **string** | **str**| None | [optional]
- **binary** | **file**| None | [optional]
- **date** | **date**| None | [optional]
- **date_time** | **datetime**| None | [optional]
- **password** | **str**| None | [optional]
- **param_callback** | **str**| None | [optional]
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **file_type**| None | [optional]
+ **date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
### Return type
@@ -730,7 +1041,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_enum_parameters**
-> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
+> test_enum_parameters()
To test enum parameters
@@ -739,10 +1050,9 @@ To test enum parameters
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -754,20 +1064,26 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional)
-enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg')
-enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional)
-enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg')
-enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
-enum_query_double = 3.4 # float | Query parameter enum test (double) (optional)
-enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$')
-enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg')
-
+ api_instance = fake_api.FakeApi(api_client)
+ enum_header_string_array = [
+ "$",
+ ] # [str] | Header parameter enum test (string array) (optional)
+ enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
+ enum_query_string_array = [
+ "$",
+ ] # [str] | Query parameter enum test (string array) (optional)
+ enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
+ enum_query_integer = 1 # int | Query parameter enum test (double) (optional)
+ enum_query_double = 1.1 # float | Query parameter enum test (double) (optional)
+ enum_form_string_array = "$" # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$"
+ enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg"
+
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# To test enum parameters
api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e)
```
@@ -775,14 +1091,14 @@ enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional]
- **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg']
- **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional]
- **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg']
- **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
- **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
- **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$']
- **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg']
+ **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional]
+ **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+ **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional]
+ **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
+ **enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
+ **enum_query_double** | **float**| Query parameter enum test (double) | [optional]
+ **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$"
+ **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
### Return type
@@ -806,7 +1122,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_group_parameters**
-> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
Fake endpoint to test group parameters (optional)
@@ -816,10 +1132,9 @@ Fake endpoint to test group parameters (optional)
* Bearer (JWT) Authentication (bearer_test):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -840,18 +1155,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- required_string_group = 56 # int | Required String in group parameters
-required_boolean_group = True # bool | Required Boolean in group parameters
-required_int64_group = 56 # int | Required Integer in group parameters
-string_group = 56 # int | String in group parameters (optional)
-boolean_group = True # bool | Boolean in group parameters (optional)
-int64_group = 56 # int | Integer in group parameters (optional)
+ api_instance = fake_api.FakeApi(api_client)
+ required_string_group = 1 # int | Required String in group parameters
+ required_boolean_group = True # bool | Required Boolean in group parameters
+ required_int64_group = 1 # int | Required Integer in group parameters
+ string_group = 1 # int | String in group parameters (optional)
+ boolean_group = True # bool | Boolean in group parameters (optional)
+ int64_group = 1 # int | Integer in group parameters (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Fake endpoint to test group parameters (optional)
+ api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
+ except petstore_api.ApiException as e:
+ print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Fake endpoint to test group parameters (optional)
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
```
@@ -859,12 +1183,12 @@ int64_group = 56 # int | Integer in group parameters (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **required_string_group** | **int**| Required String in group parameters |
- **required_boolean_group** | **bool**| Required Boolean in group parameters |
- **required_int64_group** | **int**| Required Integer in group parameters |
- **string_group** | **int**| String in group parameters | [optional]
- **boolean_group** | **bool**| Boolean in group parameters | [optional]
- **int64_group** | **int**| Integer in group parameters | [optional]
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
### Return type
@@ -894,10 +1218,9 @@ test inline additionalProperties
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -909,13 +1232,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- request_body = {'key': 'request_body_example'} # dict(str, str) | request body
+ api_instance = fake_api.FakeApi(api_client)
+ request_body = {
+ "key": "key_example",
+ } # {str: (str,)} | request body
+ # example passing only required values which don't have defaults set
try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(request_body)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
@@ -923,7 +1249,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **request_body** | [**dict(str, str)**](str.md)| request body |
+ **request_body** | **{str: (str,)}**| request body |
### Return type
@@ -953,10 +1279,9 @@ test json serialization of form data
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -968,14 +1293,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- param = 'param_example' # str | field1
-param2 = 'param2_example' # str | field2
+ api_instance = fake_api.FakeApi(api_client)
+ param = "param_example" # str | field1
+ param2 = "param2_example" # str | field2
+ # example passing only required values which don't have defaults set
try:
# test json serialization of form data
api_instance.test_json_form_data(param, param2)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
```
@@ -983,8 +1309,8 @@ param2 = 'param2_example' # str | field2
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | **str**| field1 |
- **param2** | **str**| field2 |
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
### Return type
@@ -1016,10 +1342,9 @@ To test the collection format in query parameters
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -1031,16 +1356,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeApi(api_client)
- pipe = ['pipe_example'] # list[str] |
-ioutil = ['ioutil_example'] # list[str] |
-http = ['http_example'] # list[str] |
-url = ['url_example'] # list[str] |
-context = ['context_example'] # list[str] |
-
+ api_instance = fake_api.FakeApi(api_client)
+ pipe = [
+ "pipe_example",
+ ] # [str] |
+ ioutil = [
+ "ioutil_example",
+ ] # [str] |
+ http = [
+ "http_example",
+ ] # [str] |
+ url = [
+ "url_example",
+ ] # [str] |
+ context = [
+ "context_example",
+ ] # [str] |
+
+ # example passing only required values which don't have defaults set
try:
api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
```
@@ -1048,11 +1384,11 @@ context = ['context_example'] # list[str] |
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pipe** | [**list[str]**](str.md)| |
- **ioutil** | [**list[str]**](str.md)| |
- **http** | [**list[str]**](str.md)| |
- **url** | [**list[str]**](str.md)| |
- **context** | [**list[str]**](str.md)| |
+ **pipe** | **[str]**| |
+ **ioutil** | **[str]**| |
+ **http** | **[str]**| |
+ **url** | **[str]**| |
+ **context** | **[str]**| |
### Return type
diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md
index 1b02ad93eff6..e7a43d577d88 100644
--- a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md
+++ b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md
@@ -18,10 +18,10 @@ To test class name in snake case
* Api Key Authentication (api_key_query):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import fake_classname_tags_123_api
+from petstore_api.model.client import Client
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -43,14 +43,17 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.FakeClassnameTags123Api(api_client)
- client = petstore_api.Client() # Client | client model
+ api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client)
+ client = Client(
+ client="client_example",
+ ) # Client | client model
+ # example passing only required values which don't have defaults set
try:
# To test class name in snake case
api_response = api_instance.test_classname(client)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
```
@@ -58,7 +61,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **client** | [**Client**](Client.md)| client model |
+ **client** | [**Client**](Client.md)| client model |
### Return type
diff --git a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md
index dc3722289887..d0a8bbaaba95 100644
--- a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md
+++ b/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**File**](File.md) | | [optional]
-**files** | [**list[File]**](File.md) | | [optional]
+**files** | [**[File]**](File.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/Foo.md b/samples/openapi3/client/petstore/python/docs/Foo.md
index c55aa2cf103c..3e9080e7f48a 100644
--- a/samples/openapi3/client/petstore/python/docs/Foo.md
+++ b/samples/openapi3/client/petstore/python/docs/Foo.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**bar** | **str** | | [optional] [default to 'bar']
+**bar** | **str** | | [optional] if omitted the server will use the default value of "bar"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/FormatTest.md b/samples/openapi3/client/petstore/python/docs/FormatTest.md
index 919d954bf525..18e7d495e0f5 100644
--- a/samples/openapi3/client/petstore/python/docs/FormatTest.md
+++ b/samples/openapi3/client/petstore/python/docs/FormatTest.md
@@ -3,20 +3,20 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**number** | **float** | |
+**byte** | **str** | |
+**date** | **date** | |
+**password** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
-**number** | **float** | |
**float** | **float** | | [optional]
**double** | **float** | | [optional]
-**decimal** | [**Decimal**](Decimal.md) | | [optional]
**string** | **str** | | [optional]
-**byte** | **str** | |
-**binary** | **file** | | [optional]
-**date** | **date** | |
+**binary** | **file_type** | | [optional]
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
-**password** | **str** | |
+**uuid_no_example** | **str** | | [optional]
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md b/samples/openapi3/client/petstore/python/docs/Fruit.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Fruit.md
rename to samples/openapi3/client/petstore/python/docs/Fruit.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md b/samples/openapi3/client/petstore/python/docs/FruitReq.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md
rename to samples/openapi3/client/petstore/python/docs/FruitReq.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md b/samples/openapi3/client/petstore/python/docs/GmFruit.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md
rename to samples/openapi3/client/petstore/python/docs/GmFruit.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md
rename to samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md
diff --git a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md
index 7cde5c093292..50cf84f69133 100644
--- a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md
+++ b/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md
@@ -4,7 +4,7 @@ Just a string to inform instance is up and running. Make it nullable in hope to
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**nullable_message** | **str** | | [optional]
+**nullable_message** | **str, none_type** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject1.md b/samples/openapi3/client/petstore/python/docs/InlineObject1.md
index 42d38efa3013..4349ad73e3b7 100644
--- a/samples/openapi3/client/petstore/python/docs/InlineObject1.md
+++ b/samples/openapi3/client/petstore/python/docs/InlineObject1.md
@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additional_metadata** | **str** | Additional data to pass to server | [optional]
-**file** | **file** | file to upload | [optional]
+**file** | **file_type** | file to upload | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject2.md b/samples/openapi3/client/petstore/python/docs/InlineObject2.md
index 9bfba12f6f15..9312bc7e3a19 100644
--- a/samples/openapi3/client/petstore/python/docs/InlineObject2.md
+++ b/samples/openapi3/client/petstore/python/docs/InlineObject2.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional]
-**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg']
+**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional]
+**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject3.md b/samples/openapi3/client/petstore/python/docs/InlineObject3.md
index ef9845fcd9c6..34d5eb478457 100644
--- a/samples/openapi3/client/petstore/python/docs/InlineObject3.md
+++ b/samples/openapi3/client/petstore/python/docs/InlineObject3.md
@@ -3,18 +3,18 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**number** | **float** | None |
+**double** | **float** | None |
+**pattern_without_delimiter** | **str** | None |
+**byte** | **str** | None |
**integer** | **int** | None | [optional]
**int32** | **int** | None | [optional]
**int64** | **int** | None | [optional]
-**number** | **float** | None |
**float** | **float** | None | [optional]
-**double** | **float** | None |
**string** | **str** | None | [optional]
-**pattern_without_delimiter** | **str** | None |
-**byte** | **str** | None |
-**binary** | **file** | None | [optional]
+**binary** | **file_type** | None | [optional]
**date** | **date** | None | [optional]
-**date_time** | **datetime** | None | [optional]
+**date_time** | **datetime** | None | [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
**password** | **str** | None | [optional]
**callback** | **str** | None | [optional]
diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject5.md b/samples/openapi3/client/petstore/python/docs/InlineObject5.md
index c4502f70f9c8..8f8662c434db 100644
--- a/samples/openapi3/client/petstore/python/docs/InlineObject5.md
+++ b/samples/openapi3/client/petstore/python/docs/InlineObject5.md
@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**required_file** | **file_type** | file to upload |
**additional_metadata** | **str** | Additional data to pass to server | [optional]
-**required_file** | **file** | file to upload |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python/docs/IntegerEnum.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md
rename to samples/openapi3/client/petstore/python/docs/IntegerEnum.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md
rename to samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md
rename to samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md
rename to samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md b/samples/openapi3/client/petstore/python/docs/Mammal.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Mammal.md
rename to samples/openapi3/client/petstore/python/docs/Mammal.md
diff --git a/samples/openapi3/client/petstore/python/docs/MapTest.md b/samples/openapi3/client/petstore/python/docs/MapTest.md
index a5601691f885..ad561b7220bf 100644
--- a/samples/openapi3/client/petstore/python/docs/MapTest.md
+++ b/samples/openapi3/client/petstore/python/docs/MapTest.md
@@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
-**map_of_enum_string** | **dict(str, str)** | | [optional]
-**direct_map** | **dict(str, bool)** | | [optional]
-**indirect_map** | **dict(str, bool)** | | [optional]
+**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional]
+**map_of_enum_string** | **{str: (str,)}** | | [optional]
+**direct_map** | **{str: (bool,)}** | | [optional]
+**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index b9808d5275e5..1484c0638d83 100644
--- a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
+**map** | [**{str: (Animal,)}**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/NullableClass.md b/samples/openapi3/client/petstore/python/docs/NullableClass.md
index c8b74746ae97..0789eb8ad1a4 100644
--- a/samples/openapi3/client/petstore/python/docs/NullableClass.md
+++ b/samples/openapi3/client/petstore/python/docs/NullableClass.md
@@ -3,18 +3,19 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**integer_prop** | **int** | | [optional]
-**number_prop** | **float** | | [optional]
-**boolean_prop** | **bool** | | [optional]
-**string_prop** | **str** | | [optional]
-**date_prop** | **date** | | [optional]
-**datetime_prop** | **datetime** | | [optional]
-**array_nullable_prop** | **list[object]** | | [optional]
-**array_and_items_nullable_prop** | **list[object]** | | [optional]
-**array_items_nullable** | **list[object]** | | [optional]
-**object_nullable_prop** | **dict(str, object)** | | [optional]
-**object_and_items_nullable_prop** | **dict(str, object)** | | [optional]
-**object_items_nullable** | **dict(str, object)** | | [optional]
+**integer_prop** | **int, none_type** | | [optional]
+**number_prop** | **float, none_type** | | [optional]
+**boolean_prop** | **bool, none_type** | | [optional]
+**string_prop** | **str, none_type** | | [optional]
+**date_prop** | **date, none_type** | | [optional]
+**datetime_prop** | **datetime, none_type** | | [optional]
+**array_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | | [optional]
+**array_and_items_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type** | | [optional]
+**array_items_nullable** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]** | | [optional]
+**object_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type** | | [optional]
+**object_and_items_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type** | | [optional]
+**object_items_nullable** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}** | | [optional]
+**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md b/samples/openapi3/client/petstore/python/docs/NullableShape.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md
rename to samples/openapi3/client/petstore/python/docs/NullableShape.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python/docs/NumberWithValidations.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md
rename to samples/openapi3/client/petstore/python/docs/NumberWithValidations.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectInterface.md b/samples/openapi3/client/petstore/python/docs/ObjectInterface.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ObjectInterface.md
rename to samples/openapi3/client/petstore/python/docs/ObjectInterface.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md
rename to samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithValidations.md b/samples/openapi3/client/petstore/python/docs/ObjectWithValidations.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ObjectWithValidations.md
rename to samples/openapi3/client/petstore/python/docs/ObjectWithValidations.md
diff --git a/samples/openapi3/client/petstore/python/docs/Order.md b/samples/openapi3/client/petstore/python/docs/Order.md
index b5f7b22d34cf..c21210a3bd59 100644
--- a/samples/openapi3/client/petstore/python/docs/Order.md
+++ b/samples/openapi3/client/petstore/python/docs/Order.md
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional]
**ship_date** | **datetime** | | [optional]
**status** | **str** | Order Status | [optional]
-**complete** | **bool** | | [optional] [default to False]
+**complete** | **bool** | | [optional] if omitted the server will use the default value of False
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md b/samples/openapi3/client/petstore/python/docs/ParentPet.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md
rename to samples/openapi3/client/petstore/python/docs/ParentPet.md
diff --git a/samples/openapi3/client/petstore/python/docs/Pet.md b/samples/openapi3/client/petstore/python/docs/Pet.md
index 9e15090300f8..1d3349fa9b43 100644
--- a/samples/openapi3/client/petstore/python/docs/Pet.md
+++ b/samples/openapi3/client/petstore/python/docs/Pet.md
@@ -1,13 +1,14 @@
# Pet
+Pet object that needs to be added to the store
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**name** | **str** | |
+**photo_urls** | **[str]** | |
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
-**name** | **str** | |
-**photo_urls** | **list[str]** | |
-**tags** | [**list[Tag]**](Tag.md) | | [optional]
+**tags** | [**[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md
index 186933485eee..21323c72c953 100644
--- a/samples/openapi3/client/petstore/python/docs/PetApi.md
+++ b/samples/openapi3/client/petstore/python/docs/PetApi.md
@@ -24,10 +24,10 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -40,6 +40,66 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
@@ -49,13 +109,31 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
-
+ api_instance = pet_api.PetApi(api_client)
+ pet = Pet(
+ id=1,
+ category=Category(
+ id=1,
+ name="default-name",
+ ),
+ name="doggie",
+ photo_urls=[
+ "photo_urls_example",
+ ],
+ tags=[
+ Tag(
+ id=1,
+ name="name_example",
+ ),
+ ],
+ status="available",
+ ) # Pet | Pet object that needs to be added to the store
+
+ # example passing only required values which don't have defaults set
try:
# Add a new pet to the store
api_instance.add_pet(pet)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
@@ -63,7 +141,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -71,7 +149,7 @@ void (empty response body)
### Authorization
-[petstore_auth](../README.md#petstore_auth)
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
@@ -86,7 +164,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete_pet**
-> delete_pet(pet_id, api_key=api_key)
+> delete_pet(pet_id)
Deletes a pet
@@ -94,10 +172,9 @@ Deletes a pet
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -119,14 +196,23 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | Pet id to delete
-api_key = 'api_key_example' # str | (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | Pet id to delete
+ api_key = "api_key_example" # str | (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # Deletes a pet
+ api_instance.delete_pet(pet_id)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->delete_pet: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Deletes a pet
api_instance.delete_pet(pet_id, api_key=api_key)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->delete_pet: %s\n" % e)
```
@@ -134,8 +220,8 @@ api_key = 'api_key_example' # str | (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| Pet id to delete |
- **api_key** | **str**| | [optional]
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
### Return type
@@ -158,7 +244,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **find_pets_by_status**
-> list[Pet] find_pets_by_status(status)
+> [Pet] find_pets_by_status(status)
Finds Pets by status
@@ -168,10 +254,10 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -184,6 +270,66 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
@@ -193,14 +339,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- status = ['status_example'] # list[str] | Status values that need to be considered for filter
+ api_instance = pet_api.PetApi(api_client)
+ status = [
+ "available",
+ ] # [str] | Status values that need to be considered for filter
+ # example passing only required values which don't have defaults set
try:
# Finds Pets by status
api_response = api_instance.find_pets_by_status(status)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
```
@@ -208,15 +357,15 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | [**list[str]**](str.md)| Status values that need to be considered for filter |
+ **status** | **[str]**| Status values that need to be considered for filter |
### Return type
-[**list[Pet]**](Pet.md)
+[**[Pet]**](Pet.md)
### Authorization
-[petstore_auth](../README.md#petstore_auth)
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
@@ -232,7 +381,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **find_pets_by_tags**
-> list[Pet] find_pets_by_tags(tags)
+> [Pet] find_pets_by_tags(tags)
Finds Pets by tags
@@ -242,10 +391,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -258,6 +407,66 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
@@ -267,14 +476,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- tags = ['tags_example'] # list[str] | Tags to filter by
+ api_instance = pet_api.PetApi(api_client)
+ tags = [
+ "tags_example",
+ ] # [str] | Tags to filter by
+ # example passing only required values which don't have defaults set
try:
# Finds Pets by tags
api_response = api_instance.find_pets_by_tags(tags)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
```
@@ -282,15 +494,15 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **tags** | [**list[str]**](str.md)| Tags to filter by |
+ **tags** | **[str]**| Tags to filter by |
### Return type
-[**list[Pet]**](Pet.md)
+[**[Pet]**](Pet.md)
### Authorization
-[petstore_auth](../README.md#petstore_auth)
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
@@ -316,10 +528,10 @@ Returns a single pet
* Api Key Authentication (api_key):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -341,14 +553,15 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet to return
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet to return
+ # example passing only required values which don't have defaults set
try:
# Find pet by ID
api_response = api_instance.get_pet_by_id(pet_id)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
```
@@ -356,7 +569,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to return |
+ **pet_id** | **int**| ID of pet to return |
### Return type
@@ -389,10 +602,10 @@ Update an existing pet
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.pet import Pet
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -405,6 +618,66 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
@@ -414,13 +687,31 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
-
+ api_instance = pet_api.PetApi(api_client)
+ pet = Pet(
+ id=1,
+ category=Category(
+ id=1,
+ name="default-name",
+ ),
+ name="doggie",
+ photo_urls=[
+ "photo_urls_example",
+ ],
+ tags=[
+ Tag(
+ id=1,
+ name="name_example",
+ ),
+ ],
+ status="available",
+ ) # Pet | Pet object that needs to be added to the store
+
+ # example passing only required values which don't have defaults set
try:
# Update an existing pet
api_instance.update_pet(pet)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
@@ -428,7 +719,7 @@ with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -436,7 +727,7 @@ void (empty response body)
### Authorization
-[petstore_auth](../README.md#petstore_auth)
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
@@ -453,7 +744,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_pet_with_form**
-> update_pet_with_form(pet_id, name=name, status=status)
+> update_pet_with_form(pet_id)
Updates a pet in the store with form data
@@ -461,10 +752,9 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -486,15 +776,24 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet that needs to be updated
-name = 'name_example' # str | Updated name of the pet (optional)
-status = 'status_example' # str | Updated status of the pet (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet that needs to be updated
+ name = "name_example" # str | Updated name of the pet (optional)
+ status = "status_example" # str | Updated status of the pet (optional)
+ # example passing only required values which don't have defaults set
+ try:
+ # Updates a pet in the store with form data
+ api_instance.update_pet_with_form(pet_id)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# Updates a pet in the store with form data
api_instance.update_pet_with_form(pet_id, name=name, status=status)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
```
@@ -502,9 +801,9 @@ status = 'status_example' # str | Updated status of the pet (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet that needs to be updated |
- **name** | **str**| Updated name of the pet | [optional]
- **status** | **str**| Updated status of the pet | [optional]
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
### Return type
@@ -527,7 +826,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file**
-> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+> ApiResponse upload_file(pet_id)
uploads an image
@@ -535,10 +834,10 @@ uploads an image
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.api_response import ApiResponse
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -560,16 +859,26 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet to update
-additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
-file = '/path/to/file' # file | file to upload (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet to update
+ additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
+ file = open('/path/to/file', 'rb') # file_type | file to upload (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # uploads an image
+ api_response = api_instance.upload_file(pet_id)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->upload_file: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# uploads an image
api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file: %s\n" % e)
```
@@ -577,9 +886,9 @@ file = '/path/to/file' # file | file to upload (optional)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
- **file** | **file**| file to upload | [optional]
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **file_type**| file to upload | [optional]
### Return type
@@ -602,7 +911,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+> ApiResponse upload_file_with_required_file(pet_id, required_file)
uploads an image (required)
@@ -610,10 +919,10 @@ uploads an image (required)
* OAuth Authentication (petstore_auth):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import pet_api
+from petstore_api.model.api_response import ApiResponse
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -635,16 +944,26 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.PetApi(api_client)
- pet_id = 56 # int | ID of pet to update
-required_file = '/path/to/file' # file | file to upload
-additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+ api_instance = pet_api.PetApi(api_client)
+ pet_id = 1 # int | ID of pet to update
+ required_file = open('/path/to/file', 'rb') # file_type | file to upload
+ additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional)
+
+ # example passing only required values which don't have defaults set
+ try:
+ # uploads an image (required)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file)
+ pprint(api_response)
+ except petstore_api.ApiException as e:
+ print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+ # example passing only required values which don't have defaults set
+ # and optional values
try:
# uploads an image (required)
api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
```
@@ -652,9 +971,9 @@ additional_metadata = 'additional_metadata_example' # str | Additional data to p
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **pet_id** | **int**| ID of pet to update |
- **required_file** | **file**| file to upload |
- **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **file_type**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pig.md b/samples/openapi3/client/petstore/python/docs/Pig.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Pig.md
rename to samples/openapi3/client/petstore/python/docs/Pig.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md b/samples/openapi3/client/petstore/python/docs/Quadrilateral.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md
rename to samples/openapi3/client/petstore/python/docs/Quadrilateral.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md
rename to samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/python/docs/ScaleneTriangle.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md
rename to samples/openapi3/client/petstore/python/docs/ScaleneTriangle.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Shape.md b/samples/openapi3/client/petstore/python/docs/Shape.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Shape.md
rename to samples/openapi3/client/petstore/python/docs/Shape.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md b/samples/openapi3/client/petstore/python/docs/ShapeInterface.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md
rename to samples/openapi3/client/petstore/python/docs/ShapeInterface.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/python/docs/ShapeOrNull.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md
rename to samples/openapi3/client/petstore/python/docs/ShapeOrNull.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python/docs/SimpleQuadrilateral.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md
rename to samples/openapi3/client/petstore/python/docs/SimpleQuadrilateral.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SomeObject.md b/samples/openapi3/client/petstore/python/docs/SomeObject.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/SomeObject.md
rename to samples/openapi3/client/petstore/python/docs/SomeObject.md
diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python/docs/StoreApi.md
index 6704d5844be7..c052c02c9b45 100644
--- a/samples/openapi3/client/petstore/python/docs/StoreApi.md
+++ b/samples/openapi3/client/petstore/python/docs/StoreApi.md
@@ -20,10 +20,9 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -35,13 +34,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
- order_id = 'order_id_example' # str | ID of the order that needs to be deleted
+ api_instance = store_api.StoreApi(api_client)
+ order_id = "order_id_example" # str | ID of the order that needs to be deleted
+ # example passing only required values which don't have defaults set
try:
# Delete purchase order by ID
api_instance.delete_order(order_id)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->delete_order: %s\n" % e)
```
@@ -49,7 +49,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **str**| ID of the order that needs to be deleted |
+ **order_id** | **str**| ID of the order that needs to be deleted |
### Return type
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> dict(str, int) get_inventory()
+> {str: (int,)} get_inventory()
Returns pet inventories by status
@@ -83,10 +83,9 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key):
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -108,13 +107,14 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
-
+ api_instance = store_api.StoreApi(api_client)
+
+ # example, this endpoint has no required or optional parameters
try:
# Returns pet inventories by status
api_response = api_instance.get_inventory()
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->get_inventory: %s\n" % e)
```
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**dict(str, int)**
+**{str: (int,)}**
### Authorization
@@ -151,10 +151,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
+from petstore_api.model.order import Order
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -166,14 +166,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
- order_id = 56 # int | ID of pet that needs to be fetched
+ api_instance = store_api.StoreApi(api_client)
+ order_id = 1 # int | ID of pet that needs to be fetched
+ # example passing only required values which don't have defaults set
try:
# Find purchase order by ID
api_response = api_instance.get_order_by_id(order_id)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
```
@@ -181,7 +182,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order_id** | **int**| ID of pet that needs to be fetched |
+ **order_id** | **int**| ID of pet that needs to be fetched |
### Return type
@@ -213,10 +214,10 @@ Place an order for a pet
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import store_api
+from petstore_api.model.order import Order
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -228,14 +229,22 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.StoreApi(api_client)
- order = petstore_api.Order() # Order | order placed for purchasing the pet
-
+ api_instance = store_api.StoreApi(api_client)
+ order = Order(
+ id=1,
+ pet_id=1,
+ quantity=1,
+ ship_date=dateutil_parser('2020-02-02T20:20:20.000222Z'),
+ status="placed",
+ complete=False,
+ ) # Order | order placed for purchasing the pet
+
+ # example passing only required values which don't have defaults set
try:
# Place an order for a pet
api_response = api_instance.place_order(order)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
```
@@ -243,7 +252,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python/docs/StringBooleanMap.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md
rename to samples/openapi3/client/petstore/python/docs/StringBooleanMap.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md b/samples/openapi3/client/petstore/python/docs/StringEnum.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md
rename to samples/openapi3/client/petstore/python/docs/StringEnum.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md
rename to samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md b/samples/openapi3/client/petstore/python/docs/Triangle.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Triangle.md
rename to samples/openapi3/client/petstore/python/docs/Triangle.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python/docs/TriangleInterface.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md
rename to samples/openapi3/client/petstore/python/docs/TriangleInterface.md
diff --git a/samples/openapi3/client/petstore/python/docs/User.md b/samples/openapi3/client/petstore/python/docs/User.md
index 443ac123fdca..5fc54dce871b 100644
--- a/samples/openapi3/client/petstore/python/docs/User.md
+++ b/samples/openapi3/client/petstore/python/docs/User.md
@@ -11,6 +11,10 @@ Name | Type | Description | Notes
**password** | **str** | | [optional]
**phone** | **str** | | [optional]
**user_status** | **int** | User Status | [optional]
+**object_with_no_declared_props** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional]
+**object_with_no_declared_props_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional]
+**any_type_prop** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional]
+**any_type_prop_nullable** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md
index 32a62c8add92..59eeff9a3366 100644
--- a/samples/openapi3/client/petstore/python/docs/UserApi.md
+++ b/samples/openapi3/client/petstore/python/docs/UserApi.md
@@ -24,10 +24,10 @@ This can only be done by the logged in user.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -39,13 +39,27 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- user = petstore_api.User() # User | Created user object
-
+ api_instance = user_api.UserApi(api_client)
+ user = User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ object_with_no_declared_props={},
+ object_with_no_declared_props_nullable={},
+ any_type_prop=None,
+ any_type_prop_nullable=None,
+ ) # User | Created user object
+
+ # example passing only required values which don't have defaults set
try:
# Create user
api_instance.create_user(user)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
@@ -53,7 +67,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**User**](User.md)| Created user object |
+ **user** | [**User**](User.md)| Created user object |
### Return type
@@ -83,10 +97,10 @@ Creates list of users with given input array
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -98,13 +112,29 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- user = [petstore_api.User()] # list[User] | List of user object
-
+ api_instance = user_api.UserApi(api_client)
+ user = [
+ User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ object_with_no_declared_props={},
+ object_with_no_declared_props_nullable={},
+ any_type_prop=None,
+ any_type_prop_nullable=None,
+ ),
+ ] # [User] | List of user object
+
+ # example passing only required values which don't have defaults set
try:
# Creates list of users with given input array
api_instance.create_users_with_array_input(user)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
@@ -112,7 +142,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**list[User]**](User.md)| List of user object |
+ **user** | [**[User]**](User.md)| List of user object |
### Return type
@@ -142,10 +172,10 @@ Creates list of users with given input array
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -157,13 +187,29 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- user = [petstore_api.User()] # list[User] | List of user object
-
+ api_instance = user_api.UserApi(api_client)
+ user = [
+ User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ object_with_no_declared_props={},
+ object_with_no_declared_props_nullable={},
+ any_type_prop=None,
+ any_type_prop_nullable=None,
+ ),
+ ] # [User] | List of user object
+
+ # example passing only required values which don't have defaults set
try:
# Creates list of users with given input array
api_instance.create_users_with_list_input(user)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
@@ -171,7 +217,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**list[User]**](User.md)| List of user object |
+ **user** | [**[User]**](User.md)| List of user object |
### Return type
@@ -203,10 +249,9 @@ This can only be done by the logged in user.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -218,13 +263,14 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | The name that needs to be deleted
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | The name that needs to be deleted
+ # example passing only required values which don't have defaults set
try:
# Delete user
api_instance.delete_user(username)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->delete_user: %s\n" % e)
```
@@ -232,7 +278,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be deleted |
+ **username** | **str**| The name that needs to be deleted |
### Return type
@@ -263,10 +309,10 @@ Get user by user name
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -278,14 +324,15 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | The name that needs to be fetched. Use user1 for testing.
+ # example passing only required values which don't have defaults set
try:
# Get user by user name
api_response = api_instance.get_user_by_name(username)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
```
@@ -293,7 +340,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
+ **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
### Return type
@@ -325,10 +372,9 @@ Logs user into the system
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -340,15 +386,16 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | The user name for login
-password = 'password_example' # str | The password for login in clear text
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | The user name for login
+ password = "password_example" # str | The password for login in clear text
+ # example passing only required values which don't have defaults set
try:
# Logs user into the system
api_response = api_instance.login_user(username, password)
pprint(api_response)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->login_user: %s\n" % e)
```
@@ -356,8 +403,8 @@ password = 'password_example' # str | The password for login in clear text
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| The user name for login |
- **password** | **str**| The password for login in clear text |
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
### Return type
@@ -388,10 +435,9 @@ Logs out current logged in user session
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -403,12 +449,13 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
-
+ api_instance = user_api.UserApi(api_client)
+
+ # example, this endpoint has no required or optional parameters
try:
# Logs out current logged in user session
api_instance.logout_user()
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->logout_user: %s\n" % e)
```
@@ -445,10 +492,10 @@ This can only be done by the logged in user.
### Example
```python
-from __future__ import print_function
import time
import petstore_api
-from petstore_api.rest import ApiException
+from petstore_api.api import user_api
+from petstore_api.model.user import User
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -460,14 +507,28 @@ configuration = petstore_api.Configuration(
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
- api_instance = petstore_api.UserApi(api_client)
- username = 'username_example' # str | name that need to be deleted
-user = petstore_api.User() # User | Updated user object
-
+ api_instance = user_api.UserApi(api_client)
+ username = "username_example" # str | name that need to be deleted
+ user = User(
+ id=1,
+ username="username_example",
+ first_name="first_name_example",
+ last_name="last_name_example",
+ email="email_example",
+ password="password_example",
+ phone="phone_example",
+ user_status=1,
+ object_with_no_declared_props={},
+ object_with_no_declared_props_nullable={},
+ any_type_prop=None,
+ any_type_prop_nullable=None,
+ ) # User | Updated user object
+
+ # example passing only required values which don't have defaults set
try:
# Updated user
api_instance.update_user(username, user)
- except ApiException as e:
+ except petstore_api.ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
```
@@ -475,8 +536,8 @@ user = petstore_api.User() # User | Updated user object
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **str**| name that need to be deleted |
- **user** | [**User**](User.md)| Updated user object |
+ **username** | **str**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
### Return type
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Whale.md b/samples/openapi3/client/petstore/python/docs/Whale.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Whale.md
rename to samples/openapi3/client/petstore/python/docs/Whale.md
diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md b/samples/openapi3/client/petstore/python/docs/Zebra.md
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/docs/Zebra.md
rename to samples/openapi3/client/petstore/python/docs/Zebra.md
diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py
index 8a91e73ea15b..1605d7d67c05 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py
@@ -12,76 +12,21 @@
"""
-from __future__ import absolute_import
-
__version__ = "1.0.0"
-# import apis into sdk package
-from petstore_api.api.another_fake_api import AnotherFakeApi
-from petstore_api.api.default_api import DefaultApi
-from petstore_api.api.fake_api import FakeApi
-from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
-from petstore_api.api.pet_api import PetApi
-from petstore_api.api.store_api import StoreApi
-from petstore_api.api.user_api import UserApi
-
# import ApiClient
from petstore_api.api_client import ApiClient
+
+# import Configuration
from petstore_api.configuration import Configuration
+from petstore_api.signing import HttpSigningConfiguration
+
+# import exceptions
from petstore_api.exceptions import OpenApiException
+from petstore_api.exceptions import ApiAttributeError
from petstore_api.exceptions import ApiTypeError
from petstore_api.exceptions import ApiValueError
from petstore_api.exceptions import ApiKeyError
-from petstore_api.exceptions import ApiAttributeError
from petstore_api.exceptions import ApiException
-# import models into sdk package
-from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
-from petstore_api.models.animal import Animal
-from petstore_api.models.api_response import ApiResponse
-from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
-from petstore_api.models.array_test import ArrayTest
-from petstore_api.models.capitalization import Capitalization
-from petstore_api.models.cat import Cat
-from petstore_api.models.cat_all_of import CatAllOf
-from petstore_api.models.category import Category
-from petstore_api.models.class_model import ClassModel
-from petstore_api.models.client import Client
-from petstore_api.models.dog import Dog
-from petstore_api.models.dog_all_of import DogAllOf
-from petstore_api.models.enum_arrays import EnumArrays
-from petstore_api.models.enum_class import EnumClass
-from petstore_api.models.enum_test import EnumTest
-from petstore_api.models.file import File
-from petstore_api.models.file_schema_test_class import FileSchemaTestClass
-from petstore_api.models.foo import Foo
-from petstore_api.models.format_test import FormatTest
-from petstore_api.models.has_only_read_only import HasOnlyReadOnly
-from petstore_api.models.health_check_result import HealthCheckResult
-from petstore_api.models.inline_object import InlineObject
-from petstore_api.models.inline_object1 import InlineObject1
-from petstore_api.models.inline_object2 import InlineObject2
-from petstore_api.models.inline_object3 import InlineObject3
-from petstore_api.models.inline_object4 import InlineObject4
-from petstore_api.models.inline_object5 import InlineObject5
-from petstore_api.models.inline_response_default import InlineResponseDefault
-from petstore_api.models.list import List
-from petstore_api.models.map_test import MapTest
-from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-from petstore_api.models.model200_response import Model200Response
-from petstore_api.models.model_return import ModelReturn
-from petstore_api.models.name import Name
-from petstore_api.models.nullable_class import NullableClass
-from petstore_api.models.number_only import NumberOnly
-from petstore_api.models.order import Order
-from petstore_api.models.outer_composite import OuterComposite
-from petstore_api.models.outer_enum import OuterEnum
-from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
-from petstore_api.models.outer_enum_integer import OuterEnumInteger
-from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
-from petstore_api.models.pet import Pet
-from petstore_api.models.read_only_first import ReadOnlyFirst
-from petstore_api.models.special_model_name import SpecialModelName
-from petstore_api.models.tag import Tag
-from petstore_api.models.user import User
+__import__('sys').setrecursionlimit(1234)
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py
index fa4e54a80091..840e9f0cd908 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py
@@ -1,12 +1,3 @@
-from __future__ import absolute_import
-
-# flake8: noqa
-
-# import apis into api package
-from petstore_api.api.another_fake_api import AnotherFakeApi
-from petstore_api.api.default_api import DefaultApi
-from petstore_api.api.fake_api import FakeApi
-from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
-from petstore_api.api.pet_api import PetApi
-from petstore_api.api.store_api import StoreApi
-from petstore_api.api.user_api import UserApi
+# do not import all apis into this module because that uses a lot of memory and stack frames
+# if you need the ability to import all apis from one package, import them with
+# from petstore_api.apis import AnotherFakeApi
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py
index af8d8fd0f25e..af80014fe0cf 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.client import Client
class AnotherFakeApi(object):
@@ -36,141 +38,120 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def call_123_test_special_tags(self, client, **kwargs): # noqa: E501
- """To test special tags # noqa: E501
-
- To test special tags and operation ID starting with number # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.call_123_test_special_tags(client, async_req=True)
- >>> result = thread.get()
-
- :param client: client model (required)
- :type client: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Client
- """
- kwargs['_return_http_data_only'] = True
- return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501
-
- def call_123_test_special_tags_with_http_info(self, client, **kwargs): # noqa: E501
- """To test special tags # noqa: E501
-
- To test special tags and operation ID starting with number # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.call_123_test_special_tags_with_http_info(client, async_req=True)
- >>> result = thread.get()
-
- :param client: client model (required)
- :type client: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'client'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __call_123_test_special_tags(
+ self,
+ client,
+ **kwargs
+ ):
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags(client, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ client (Client): client model
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Client
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['client'] = \
+ client
+ return self.call_with_http_info(**kwargs)
+
+ self.call_123_test_special_tags = Endpoint(
+ settings={
+ 'response_type': (Client,),
+ 'auth': [],
+ 'endpoint_path': '/another-fake/dummy',
+ 'operation_id': 'call_123_test_special_tags',
+ 'http_method': 'PATCH',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'client',
+ ],
+ 'required': [
+ 'client',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'client':
+ (Client,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'client': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__call_123_test_special_tags
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method call_123_test_special_tags" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'client' is set
- if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
- local_var_params['client'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `client` when calling `call_123_test_special_tags`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'client' in local_var_params:
- body_params = local_var_params['client']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Client",
- }
-
- return self.api_client.call_api(
- '/another-fake/dummy', 'PATCH',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py
index 98554918aaec..c64ea731eba0 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.inline_response_default import InlineResponseDefault
class DefaultApi(object):
@@ -36,123 +38,106 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def foo_get(self, **kwargs): # noqa: E501
- """foo_get # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.foo_get(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: InlineResponseDefault
- """
- kwargs['_return_http_data_only'] = True
- return self.foo_get_with_http_info(**kwargs) # noqa: E501
-
- def foo_get_with_http_info(self, **kwargs): # noqa: E501
- """foo_get # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.foo_get_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(InlineResponseDefault, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __foo_get(
+ self,
+ **kwargs
+ ):
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ InlineResponseDefault
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.foo_get = Endpoint(
+ settings={
+ 'response_type': (InlineResponseDefault,),
+ 'auth': [],
+ 'endpoint_path': '/foo',
+ 'operation_id': 'foo_get',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__foo_get
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method foo_get" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- }
-
- return self.api_client.call_api(
- '/foo', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py
index a5038873bb40..7654e5916de7 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py
@@ -10,18 +10,31 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
+from petstore_api.model.animal_farm import AnimalFarm
+from petstore_api.model.array_of_enums import ArrayOfEnums
+from petstore_api.model.client import Client
+from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+from petstore_api.model.health_check_result import HealthCheckResult
+from petstore_api.model.mammal import Mammal
+from petstore_api.model.number_with_validations import NumberWithValidations
+from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
+from petstore_api.model.string_enum import StringEnum
+from petstore_api.model.user import User
class FakeApi(object):
@@ -36,2291 +49,2611 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def fake_health_get(self, **kwargs): # noqa: E501
- """Health check endpoint # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.fake_health_get(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: HealthCheckResult
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_health_get_with_http_info(**kwargs) # noqa: E501
-
- def fake_health_get_with_http_info(self, **kwargs): # noqa: E501
- """Health check endpoint # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.fake_health_get_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(HealthCheckResult, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __additional_properties_with_array_of_enums(
+ self,
+ **kwargs
+ ):
+ """Additional Properties with Array of Enums # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.additional_properties_with_array_of_enums(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ AdditionalPropertiesWithArrayOfEnums
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.additional_properties_with_array_of_enums = Endpoint(
+ settings={
+ 'response_type': (AdditionalPropertiesWithArrayOfEnums,),
+ 'auth': [],
+ 'endpoint_path': '/fake/additional-properties-with-array-of-enums',
+ 'operation_id': 'additional_properties_with_array_of_enums',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'additional_properties_with_array_of_enums',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'additional_properties_with_array_of_enums':
+ (AdditionalPropertiesWithArrayOfEnums,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'additional_properties_with_array_of_enums': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__additional_properties_with_array_of_enums
+ )
+
+ def __array_model(
+ self,
+ **kwargs
+ ):
+ """array_model # noqa: E501
+
+ Test serialization of ArrayModel # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.array_model(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (AnimalFarm): Input model. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ AnimalFarm
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.array_model = Endpoint(
+ settings={
+ 'response_type': (AnimalFarm,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/arraymodel',
+ 'operation_id': 'array_model',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (AnimalFarm,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__array_model
+ )
+
+ def __array_of_enums(
+ self,
+ **kwargs
+ ):
+ """Array of Enums # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.array_of_enums(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ array_of_enums (ArrayOfEnums): Input enum. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ArrayOfEnums
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.array_of_enums = Endpoint(
+ settings={
+ 'response_type': (ArrayOfEnums,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/array-of-enums',
+ 'operation_id': 'array_of_enums',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'array_of_enums',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'array_of_enums':
+ (ArrayOfEnums,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'array_of_enums': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__array_of_enums
+ )
+
+ def __boolean(
+ self,
+ **kwargs
+ ):
+ """boolean # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.boolean(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (bool): Input boolean as post body. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ bool
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.boolean = Endpoint(
+ settings={
+ 'response_type': (bool,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/boolean',
+ 'operation_id': 'boolean',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (bool,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__boolean
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_health_get" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "HealthCheckResult",
- }
-
- return self.api_client.call_api(
- '/fake/health', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_http_signature_test(self, pet, **kwargs): # noqa: E501
- """test http signature authentication # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.fake_http_signature_test(pet, async_req=True)
- >>> result = thread.get()
-
- :param pet: Pet object that needs to be added to the store (required)
- :type pet: Pet
- :param query_1: query parameter
- :type query_1: str
- :param header_1: header parameter
- :type header_1: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_http_signature_test_with_http_info(pet, **kwargs) # noqa: E501
-
- def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501
- """test http signature authentication # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.fake_http_signature_test_with_http_info(pet, async_req=True)
- >>> result = thread.get()
-
- :param pet: Pet object that needs to be added to the store (required)
- :type pet: Pet
- :param query_1: query parameter
- :type query_1: str
- :param header_1: header parameter
- :type header_1: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet',
- 'query_1',
- 'header_1'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __composed_one_of_number_with_validations(
+ self,
+ **kwargs
+ ):
+ """composed_one_of_number_with_validations # noqa: E501
+
+ Test serialization of object with $refed properties # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.composed_one_of_number_with_validations(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ComposedOneOfNumberWithValidations
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.composed_one_of_number_with_validations = Endpoint(
+ settings={
+ 'response_type': (ComposedOneOfNumberWithValidations,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/composed_one_of_number_with_validations',
+ 'operation_id': 'composed_one_of_number_with_validations',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'composed_one_of_number_with_validations',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'composed_one_of_number_with_validations':
+ (ComposedOneOfNumberWithValidations,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'composed_one_of_number_with_validations': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__composed_one_of_number_with_validations
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_http_signature_test" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet' is set
- if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501
- local_var_params['pet'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet` when calling `fake_http_signature_test`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'query_1' in local_var_params and local_var_params['query_1'] is not None: # noqa: E501
- query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501
-
- header_params = {}
- if 'header_1' in local_var_params:
- header_params['header_1'] = local_var_params['header_1'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'pet' in local_var_params:
- body_params = local_var_params['pet']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json', 'application/xml']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['http_signature_test'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/http-signature-test', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501
- """fake_outer_boolean_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_boolean_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input boolean as post body
- :type body: bool
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: bool
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_boolean_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input boolean as post body
- :type body: bool
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __fake_health_get(
+ self,
+ **kwargs
+ ):
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ HealthCheckResult
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.fake_health_get = Endpoint(
+ settings={
+ 'response_type': (HealthCheckResult,),
+ 'auth': [],
+ 'endpoint_path': '/fake/health',
+ 'operation_id': 'fake_health_get',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__fake_health_get
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_boolean_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "bool",
- }
-
- return self.api_client.call_api(
- '/fake/outer/boolean', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_composite_serialize(self, **kwargs): # noqa: E501
- """fake_outer_composite_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_composite_serialize(async_req=True)
- >>> result = thread.get()
-
- :param outer_composite: Input composite as post body
- :type outer_composite: OuterComposite
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: OuterComposite
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_composite_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param outer_composite: Input composite as post body
- :type outer_composite: OuterComposite
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'outer_composite'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __mammal(
+ self,
+ mammal,
+ **kwargs
+ ):
+ """mammal # noqa: E501
+
+ Test serialization of mammals # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.mammal(mammal, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ mammal (Mammal): Input mammal
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Mammal
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['mammal'] = \
+ mammal
+ return self.call_with_http_info(**kwargs)
+
+ self.mammal = Endpoint(
+ settings={
+ 'response_type': (Mammal,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/mammal',
+ 'operation_id': 'mammal',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'mammal',
+ ],
+ 'required': [
+ 'mammal',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'mammal':
+ (Mammal,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'mammal': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__mammal
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_composite_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'outer_composite' in local_var_params:
- body_params = local_var_params['outer_composite']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "OuterComposite",
- }
-
- return self.api_client.call_api(
- '/fake/outer/composite', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_number_serialize(self, **kwargs): # noqa: E501
- """fake_outer_number_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_number_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input number as post body
- :type body: float
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: float
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_number_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input number as post body
- :type body: float
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __number_with_validations(
+ self,
+ **kwargs
+ ):
+ """number_with_validations # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.number_with_validations(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (NumberWithValidations): Input number as post body. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ NumberWithValidations
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.number_with_validations = Endpoint(
+ settings={
+ 'response_type': (NumberWithValidations,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/number',
+ 'operation_id': 'number_with_validations',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (NumberWithValidations,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__number_with_validations
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_number_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "float",
- }
-
- return self.api_client.call_api(
- '/fake/outer/number', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def fake_outer_string_serialize(self, **kwargs): # noqa: E501
- """fake_outer_string_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_string_serialize(async_req=True)
- >>> result = thread.get()
-
- :param body: Input string as post body
- :type body: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: str
- """
- kwargs['_return_http_data_only'] = True
- return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501
-
- def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501
- """fake_outer_string_serialize # noqa: E501
-
- 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_req=True
-
- >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param body: Input string as post body
- :type body: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __object_model_with_ref_props(
+ self,
+ **kwargs
+ ):
+ """object_model_with_ref_props # noqa: E501
+
+ Test serialization of object with $refed properties # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.object_model_with_ref_props(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (ObjectModelWithRefProps): Input model. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ObjectModelWithRefProps
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.object_model_with_ref_props = Endpoint(
+ settings={
+ 'response_type': (ObjectModelWithRefProps,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/object_model_with_ref_props',
+ 'operation_id': 'object_model_with_ref_props',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (ObjectModelWithRefProps,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__object_model_with_ref_props
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method fake_outer_string_serialize" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['*/*']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "str",
- }
-
- return self.api_client.call_api(
- '/fake/outer/string', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_body_with_file_schema(self, file_schema_test_class, **kwargs): # noqa: E501
- """test_body_with_file_schema # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
- >>> result = thread.get()
-
- :param file_schema_test_class: (required)
- :type file_schema_test_class: FileSchemaTestClass
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
-
- def test_body_with_file_schema_with_http_info(self, file_schema_test_class, **kwargs): # noqa: E501
- """test_body_with_file_schema # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
- >>> result = thread.get()
-
- :param file_schema_test_class: (required)
- :type file_schema_test_class: FileSchemaTestClass
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'file_schema_test_class'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __string(
+ self,
+ **kwargs
+ ):
+ """string # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.string(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (str): Input string as post body. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ str
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.string = Endpoint(
+ settings={
+ 'response_type': (str,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/string',
+ 'operation_id': 'string',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (str,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__string
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_body_with_file_schema" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'file_schema_test_class' is set
- if self.api_client.client_side_validation and ('file_schema_test_class' not in local_var_params or # noqa: E501
- local_var_params['file_schema_test_class'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `file_schema_test_class` when calling `test_body_with_file_schema`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'file_schema_test_class' in local_var_params:
- body_params = local_var_params['file_schema_test_class']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/body-with-file-schema', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_body_with_query_params(self, query, user, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_body_with_query_params(query, user, async_req=True)
- >>> result = thread.get()
-
- :param query: (required)
- :type query: str
- :param user: (required)
- :type user: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
-
- def test_body_with_query_params_with_http_info(self, query, user, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
- >>> result = thread.get()
-
- :param query: (required)
- :type query: str
- :param user: (required)
- :type user: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'query',
- 'user'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __string_enum(
+ self,
+ **kwargs
+ ):
+ """string_enum # noqa: E501
+
+ Test serialization of outer enum # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.string_enum(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ body (StringEnum): Input enum. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ StringEnum
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.string_enum = Endpoint(
+ settings={
+ 'response_type': (StringEnum,),
+ 'auth': [],
+ 'endpoint_path': '/fake/refs/enum',
+ 'operation_id': 'string_enum',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'body',
+ ],
+ 'required': [],
+ 'nullable': [
+ 'body',
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'body':
+ (StringEnum,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__string_enum
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_body_with_query_params" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'query' is set
- if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501
- local_var_params['query'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501
- # verify the required parameter 'user' is set
- if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
- local_var_params['user'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `user` when calling `test_body_with_query_params`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501
- query_params.append(('query', local_var_params['query'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'user' in local_var_params:
- body_params = local_var_params['user']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/body-with-query-params', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_client_model(self, client, **kwargs): # noqa: E501
- """To test \"client\" model # noqa: E501
-
- To test \"client\" model # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_client_model(client, async_req=True)
- >>> result = thread.get()
-
- :param client: client model (required)
- :type client: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Client
- """
- kwargs['_return_http_data_only'] = True
- return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
-
- def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501
- """To test \"client\" model # noqa: E501
-
- To test \"client\" model # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_client_model_with_http_info(client, async_req=True)
- >>> result = thread.get()
-
- :param client: client model (required)
- :type client: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'client'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_body_with_file_schema(
+ self,
+ file_schema_test_class,
+ **kwargs
+ ):
+ """test_body_with_file_schema # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ file_schema_test_class (FileSchemaTestClass):
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['file_schema_test_class'] = \
+ file_schema_test_class
+ return self.call_with_http_info(**kwargs)
+
+ self.test_body_with_file_schema = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/body-with-file-schema',
+ 'operation_id': 'test_body_with_file_schema',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'file_schema_test_class',
+ ],
+ 'required': [
+ 'file_schema_test_class',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'file_schema_test_class':
+ (FileSchemaTestClass,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'file_schema_test_class': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_body_with_file_schema
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_client_model" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'client' is set
- if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
- local_var_params['client'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `client` when calling `test_client_model`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'client' in local_var_params:
- body_params = local_var_params['client']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Client",
- }
-
- return self.api_client.call_api(
- '/fake', 'PATCH',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
- """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
- >>> result = thread.get()
-
- :param number: None (required)
- :type number: float
- :param double: None (required)
- :type double: float
- :param pattern_without_delimiter: None (required)
- :type pattern_without_delimiter: str
- :param byte: None (required)
- :type byte: str
- :param integer: None
- :type integer: int
- :param int32: None
- :type int32: int
- :param int64: None
- :type int64: int
- :param float: None
- :type float: float
- :param string: None
- :type string: str
- :param binary: None
- :type binary: file
- :param date: None
- :type date: date
- :param date_time: None
- :type date_time: datetime
- :param password: None
- :type password: str
- :param param_callback: None
- :type param_callback: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501
-
- def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501
- """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True)
- >>> result = thread.get()
-
- :param number: None (required)
- :type number: float
- :param double: None (required)
- :type double: float
- :param pattern_without_delimiter: None (required)
- :type pattern_without_delimiter: str
- :param byte: None (required)
- :type byte: str
- :param integer: None
- :type integer: int
- :param int32: None
- :type int32: int
- :param int64: None
- :type int64: int
- :param float: None
- :type float: float
- :param string: None
- :type string: str
- :param binary: None
- :type binary: file
- :param date: None
- :type date: date
- :param date_time: None
- :type date_time: datetime
- :param password: None
- :type password: str
- :param param_callback: None
- :type param_callback: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'number',
- 'double',
- 'pattern_without_delimiter',
- 'byte',
- 'integer',
- 'int32',
- 'int64',
- 'float',
- 'string',
- 'binary',
- 'date',
- 'date_time',
- 'password',
- 'param_callback'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_body_with_query_params(
+ self,
+ query,
+ user,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.test_body_with_query_params(query, user, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ query (str):
+ user (User):
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['query'] = \
+ query
+ kwargs['user'] = \
+ user
+ return self.call_with_http_info(**kwargs)
+
+ self.test_body_with_query_params = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/body-with-query-params',
+ 'operation_id': 'test_body_with_query_params',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'query',
+ 'user',
+ ],
+ 'required': [
+ 'query',
+ 'user',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'query':
+ (str,),
+ 'user':
+ (User,),
+ },
+ 'attribute_map': {
+ 'query': 'query',
+ },
+ 'location_map': {
+ 'query': 'query',
+ 'user': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_body_with_query_params
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_endpoint_parameters" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'number' is set
- if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501
- local_var_params['number'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501
- # verify the required parameter 'double' is set
- if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501
- local_var_params['double'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501
- # verify the required parameter 'pattern_without_delimiter' is set
- if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501
- local_var_params['pattern_without_delimiter'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501
- # verify the required parameter 'byte' is set
- if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501
- local_var_params['byte'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501
-
- if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501
- raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501
- if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501
- raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501
- if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501
- raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501
- if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501
- raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501
- if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501
- raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501
- if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501
- raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501
- if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501
- raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501
- if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501
- raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501
- if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501
- raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501
- if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501
- raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501
- if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501
- raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501
- if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
- len(local_var_params['password']) > 64): # noqa: E501
- raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501
- if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501
- len(local_var_params['password']) < 10): # noqa: E501
- raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'integer' in local_var_params:
- form_params.append(('integer', local_var_params['integer'])) # noqa: E501
- if 'int32' in local_var_params:
- form_params.append(('int32', local_var_params['int32'])) # noqa: E501
- if 'int64' in local_var_params:
- form_params.append(('int64', local_var_params['int64'])) # noqa: E501
- if 'number' in local_var_params:
- form_params.append(('number', local_var_params['number'])) # noqa: E501
- if 'float' in local_var_params:
- form_params.append(('float', local_var_params['float'])) # noqa: E501
- if 'double' in local_var_params:
- form_params.append(('double', local_var_params['double'])) # noqa: E501
- if 'string' in local_var_params:
- form_params.append(('string', local_var_params['string'])) # noqa: E501
- if 'pattern_without_delimiter' in local_var_params:
- form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501
- if 'byte' in local_var_params:
- form_params.append(('byte', local_var_params['byte'])) # noqa: E501
- if 'binary' in local_var_params:
- local_var_files['binary'] = local_var_params['binary'] # noqa: E501
- if 'date' in local_var_params:
- form_params.append(('date', local_var_params['date'])) # noqa: E501
- if 'date_time' in local_var_params:
- form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501
- if 'password' in local_var_params:
- form_params.append(('password', local_var_params['password'])) # noqa: E501
- if 'param_callback' in local_var_params:
- form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['http_basic_test'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_enum_parameters(self, **kwargs): # noqa: E501
- """To test enum parameters # noqa: E501
-
- To test enum parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_enum_parameters(async_req=True)
- >>> result = thread.get()
-
- :param enum_header_string_array: Header parameter enum test (string array)
- :type enum_header_string_array: list[str]
- :param enum_header_string: Header parameter enum test (string)
- :type enum_header_string: str
- :param enum_query_string_array: Query parameter enum test (string array)
- :type enum_query_string_array: list[str]
- :param enum_query_string: Query parameter enum test (string)
- :type enum_query_string: str
- :param enum_query_integer: Query parameter enum test (double)
- :type enum_query_integer: int
- :param enum_query_double: Query parameter enum test (double)
- :type enum_query_double: float
- :param enum_form_string_array: Form parameter enum test (string array)
- :type enum_form_string_array: list[str]
- :param enum_form_string: Form parameter enum test (string)
- :type enum_form_string: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501
-
- def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501
- """To test enum parameters # noqa: E501
-
- To test enum parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_enum_parameters_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param enum_header_string_array: Header parameter enum test (string array)
- :type enum_header_string_array: list[str]
- :param enum_header_string: Header parameter enum test (string)
- :type enum_header_string: str
- :param enum_query_string_array: Query parameter enum test (string array)
- :type enum_query_string_array: list[str]
- :param enum_query_string: Query parameter enum test (string)
- :type enum_query_string: str
- :param enum_query_integer: Query parameter enum test (double)
- :type enum_query_integer: int
- :param enum_query_double: Query parameter enum test (double)
- :type enum_query_double: float
- :param enum_form_string_array: Form parameter enum test (string array)
- :type enum_form_string_array: list[str]
- :param enum_form_string: Form parameter enum test (string)
- :type enum_form_string: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- 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'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_client_model(
+ self,
+ client,
+ **kwargs
+ ):
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model(client, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ client (Client): client model
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Client
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['client'] = \
+ client
+ return self.call_with_http_info(**kwargs)
+
+ self.test_client_model = Endpoint(
+ settings={
+ 'response_type': (Client,),
+ 'auth': [],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_client_model',
+ 'http_method': 'PATCH',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'client',
+ ],
+ 'required': [
+ 'client',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'client':
+ (Client,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'client': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_client_model
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_enum_parameters" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501
- query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501
- collection_formats['enum_query_string_array'] = 'multi' # noqa: E501
- if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501
- query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501
- if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501
- query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501
- if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501
- query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501
-
- header_params = {}
- if 'enum_header_string_array' in local_var_params:
- header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501
- collection_formats['enum_header_string_array'] = 'csv' # noqa: E501
- if 'enum_header_string' in local_var_params:
- header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501
-
- form_params = []
- local_var_files = {}
- if 'enum_form_string_array' in local_var_params:
- form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501
- collection_formats['enum_form_string_array'] = 'csv' # noqa: E501
- if 'enum_form_string' in local_var_params:
- form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
- """Fake endpoint to test group parameters (optional) # noqa: E501
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
- >>> result = thread.get()
-
- :param required_string_group: Required String in group parameters (required)
- :type required_string_group: int
- :param required_boolean_group: Required Boolean in group parameters (required)
- :type required_boolean_group: bool
- :param required_int64_group: Required Integer in group parameters (required)
- :type required_int64_group: int
- :param string_group: String in group parameters
- :type string_group: int
- :param boolean_group: Boolean in group parameters
- :type boolean_group: bool
- :param int64_group: Integer in group parameters
- :type int64_group: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
-
- def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
- """Fake endpoint to test group parameters (optional) # noqa: E501
-
- Fake endpoint to test group parameters (optional) # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
- >>> result = thread.get()
-
- :param required_string_group: Required String in group parameters (required)
- :type required_string_group: int
- :param required_boolean_group: Required Boolean in group parameters (required)
- :type required_boolean_group: bool
- :param required_int64_group: Required Integer in group parameters (required)
- :type required_int64_group: int
- :param string_group: String in group parameters
- :type string_group: int
- :param boolean_group: Boolean in group parameters
- :type boolean_group: bool
- :param int64_group: Integer in group parameters
- :type int64_group: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'required_string_group',
- 'required_boolean_group',
- 'required_int64_group',
- 'string_group',
- 'boolean_group',
- 'int64_group'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_endpoint_parameters(
+ self,
+ number,
+ double,
+ pattern_without_delimiter,
+ byte,
+ **kwargs
+ ):
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ number (float): None
+ double (float): None
+ pattern_without_delimiter (str): None
+ byte (str): None
+
+ Keyword Args:
+ integer (int): None. [optional]
+ int32 (int): None. [optional]
+ int64 (int): None. [optional]
+ float (float): None. [optional]
+ string (str): None. [optional]
+ binary (file_type): None. [optional]
+ date (date): None. [optional]
+ date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00')
+ password (str): None. [optional]
+ param_callback (str): None. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['number'] = \
+ number
+ kwargs['double'] = \
+ double
+ kwargs['pattern_without_delimiter'] = \
+ pattern_without_delimiter
+ kwargs['byte'] = \
+ byte
+ return self.call_with_http_info(**kwargs)
+
+ self.test_endpoint_parameters = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'http_basic_test'
+ ],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_endpoint_parameters',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ 'integer',
+ 'int32',
+ 'int64',
+ 'float',
+ 'string',
+ 'binary',
+ 'date',
+ 'date_time',
+ 'password',
+ 'param_callback',
+ ],
+ 'required': [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'integer',
+ 'int32',
+ 'float',
+ 'string',
+ 'password',
+ ]
+ },
+ root_map={
+ 'validations': {
+ ('number',): {
+
+ 'inclusive_maximum': 543.2,
+ 'inclusive_minimum': 32.1,
+ },
+ ('double',): {
+
+ 'inclusive_maximum': 123.4,
+ 'inclusive_minimum': 67.8,
+ },
+ ('pattern_without_delimiter',): {
+
+ 'regex': {
+ 'pattern': r'^[A-Z].*', # noqa: E501
+ },
+ },
+ ('integer',): {
+
+ 'inclusive_maximum': 100,
+ 'inclusive_minimum': 10,
+ },
+ ('int32',): {
+
+ 'inclusive_maximum': 200,
+ 'inclusive_minimum': 20,
+ },
+ ('float',): {
+
+ 'inclusive_maximum': 987.6,
+ },
+ ('string',): {
+
+ 'regex': {
+ 'pattern': r'[a-z]', # noqa: E501
+ 'flags': (re.IGNORECASE)
+ },
+ },
+ ('password',): {
+ 'max_length': 64,
+ 'min_length': 10,
+ },
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'number':
+ (float,),
+ 'double':
+ (float,),
+ 'pattern_without_delimiter':
+ (str,),
+ 'byte':
+ (str,),
+ 'integer':
+ (int,),
+ 'int32':
+ (int,),
+ 'int64':
+ (int,),
+ 'float':
+ (float,),
+ 'string':
+ (str,),
+ 'binary':
+ (file_type,),
+ 'date':
+ (date,),
+ 'date_time':
+ (datetime,),
+ 'password':
+ (str,),
+ 'param_callback':
+ (str,),
+ },
+ 'attribute_map': {
+ 'number': 'number',
+ 'double': 'double',
+ 'pattern_without_delimiter': 'pattern_without_delimiter',
+ 'byte': 'byte',
+ 'integer': 'integer',
+ 'int32': 'int32',
+ 'int64': 'int64',
+ 'float': 'float',
+ 'string': 'string',
+ 'binary': 'binary',
+ 'date': 'date',
+ 'date_time': 'dateTime',
+ 'password': 'password',
+ 'param_callback': 'callback',
+ },
+ 'location_map': {
+ 'number': 'form',
+ 'double': 'form',
+ 'pattern_without_delimiter': 'form',
+ 'byte': 'form',
+ 'integer': 'form',
+ 'int32': 'form',
+ 'int64': 'form',
+ 'float': 'form',
+ 'string': 'form',
+ 'binary': 'form',
+ 'date': 'form',
+ 'date_time': 'form',
+ 'password': 'form',
+ 'param_callback': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_endpoint_parameters
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_group_parameters" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'required_string_group' is set
- if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501
- local_var_params['required_string_group'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
- # verify the required parameter 'required_boolean_group' is set
- if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501
- local_var_params['required_boolean_group'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
- # verify the required parameter 'required_int64_group' is set
- if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501
- local_var_params['required_int64_group'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501
- query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
- if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501
- query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
- if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501
- query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
- if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501
- query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
-
- header_params = {}
- if 'required_boolean_group' in local_var_params:
- header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
- if 'boolean_group' in local_var_params:
- header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = ['bearer_test'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501
- """test inline additionalProperties # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_inline_additional_properties(request_body, async_req=True)
- >>> result = thread.get()
-
- :param request_body: request body (required)
- :type request_body: dict(str, str)
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
-
- def test_inline_additional_properties_with_http_info(self, request_body, **kwargs): # noqa: E501
- """test inline additionalProperties # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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 request_body: request body (required)
- :type request_body: dict(str, str)
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'request_body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_enum_parameters(
+ self,
+ **kwargs
+ ):
+ """To test enum parameters # noqa: E501
+
+ To test enum parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_enum_parameters(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ enum_header_string_array ([str]): Header parameter enum test (string array). [optional]
+ enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
+ enum_query_string_array ([str]): Query parameter enum test (string array). [optional]
+ enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
+ enum_query_integer (int): Query parameter enum test (double). [optional]
+ enum_query_double (float): Query parameter enum test (double). [optional]
+ enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$"
+ enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg"
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.test_enum_parameters = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_enum_parameters',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ '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',
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ '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',
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ ('enum_header_string_array',): {
+
+ ">": ">",
+ "$": "$"
+ },
+ ('enum_header_string',): {
+
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ },
+ ('enum_query_string_array',): {
+
+ ">": ">",
+ "$": "$"
+ },
+ ('enum_query_string',): {
+
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ },
+ ('enum_query_integer',): {
+
+ "1": 1,
+ "-2": -2
+ },
+ ('enum_query_double',): {
+
+ "1.1": 1.1,
+ "-1.2": -1.2
+ },
+ ('enum_form_string_array',): {
+
+ ">": ">",
+ "$": "$"
+ },
+ ('enum_form_string',): {
+
+ "_ABC": "_abc",
+ "-EFG": "-efg",
+ "(XYZ)": "(xyz)"
+ },
+ },
+ 'openapi_types': {
+ 'enum_header_string_array':
+ ([str],),
+ 'enum_header_string':
+ (str,),
+ 'enum_query_string_array':
+ ([str],),
+ 'enum_query_string':
+ (str,),
+ 'enum_query_integer':
+ (int,),
+ 'enum_query_double':
+ (float,),
+ 'enum_form_string_array':
+ ([str],),
+ 'enum_form_string':
+ (str,),
+ },
+ 'attribute_map': {
+ 'enum_header_string_array': 'enum_header_string_array',
+ 'enum_header_string': 'enum_header_string',
+ 'enum_query_string_array': 'enum_query_string_array',
+ 'enum_query_string': 'enum_query_string',
+ 'enum_query_integer': 'enum_query_integer',
+ 'enum_query_double': 'enum_query_double',
+ 'enum_form_string_array': 'enum_form_string_array',
+ 'enum_form_string': 'enum_form_string',
+ },
+ 'location_map': {
+ 'enum_header_string_array': 'header',
+ 'enum_header_string': 'header',
+ 'enum_query_string_array': 'query',
+ 'enum_query_string': 'query',
+ 'enum_query_integer': 'query',
+ 'enum_query_double': 'query',
+ 'enum_form_string_array': 'form',
+ 'enum_form_string': 'form',
+ },
+ 'collection_format_map': {
+ 'enum_header_string_array': 'csv',
+ 'enum_query_string_array': 'multi',
+ 'enum_form_string_array': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_enum_parameters
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_inline_additional_properties" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'request_body' is set
- if self.api_client.client_side_validation and ('request_body' not in local_var_params or # noqa: E501
- local_var_params['request_body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `request_body` when calling `test_inline_additional_properties`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'request_body' in local_var_params:
- body_params = local_var_params['request_body']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/inline-additionalProperties', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_json_form_data(self, param, param2, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_json_form_data(param, param2, async_req=True)
- >>> result = thread.get()
-
- :param param: field1 (required)
- :type param: str
- :param param2: field2 (required)
- :type param2: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
-
- def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
- >>> result = thread.get()
-
- :param param: field1 (required)
- :type param: str
- :param param2: field2 (required)
- :type param2: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'param',
- 'param2'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_group_parameters(
+ self,
+ required_string_group,
+ required_boolean_group,
+ required_int64_group,
+ **kwargs
+ ):
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ required_string_group (int): Required String in group parameters
+ required_boolean_group (bool): Required Boolean in group parameters
+ required_int64_group (int): Required Integer in group parameters
+
+ Keyword Args:
+ string_group (int): String in group parameters. [optional]
+ boolean_group (bool): Boolean in group parameters. [optional]
+ int64_group (int): Integer in group parameters. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['required_string_group'] = \
+ required_string_group
+ kwargs['required_boolean_group'] = \
+ required_boolean_group
+ kwargs['required_int64_group'] = \
+ required_int64_group
+ return self.call_with_http_info(**kwargs)
+
+ self.test_group_parameters = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'bearer_test'
+ ],
+ 'endpoint_path': '/fake',
+ 'operation_id': 'test_group_parameters',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ 'string_group',
+ 'boolean_group',
+ 'int64_group',
+ ],
+ 'required': [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'required_string_group':
+ (int,),
+ 'required_boolean_group':
+ (bool,),
+ 'required_int64_group':
+ (int,),
+ 'string_group':
+ (int,),
+ 'boolean_group':
+ (bool,),
+ 'int64_group':
+ (int,),
+ },
+ 'attribute_map': {
+ 'required_string_group': 'required_string_group',
+ 'required_boolean_group': 'required_boolean_group',
+ 'required_int64_group': 'required_int64_group',
+ 'string_group': 'string_group',
+ 'boolean_group': 'boolean_group',
+ 'int64_group': 'int64_group',
+ },
+ 'location_map': {
+ 'required_string_group': 'query',
+ 'required_boolean_group': 'header',
+ 'required_int64_group': 'query',
+ 'string_group': 'query',
+ 'boolean_group': 'header',
+ 'int64_group': 'query',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__test_group_parameters
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_json_form_data" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'param' is set
- if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501
- local_var_params['param'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501
- # verify the required parameter 'param2' is set
- if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501
- local_var_params['param2'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'param' in local_var_params:
- form_params.append(('param', local_var_params['param'])) # noqa: E501
- if 'param2' in local_var_params:
- form_params.append(('param2', local_var_params['param2'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/jsonFormData', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
- """test_query_parameter_collection_format # noqa: E501
-
- To test the collection format in query parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True)
- >>> result = thread.get()
-
- :param pipe: (required)
- :type pipe: list[str]
- :param ioutil: (required)
- :type ioutil: list[str]
- :param http: (required)
- :type http: list[str]
- :param url: (required)
- :type url: list[str]
- :param context: (required)
- :type context: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501
-
- def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501
- """test_query_parameter_collection_format # noqa: E501
-
- To test the collection format in query parameters # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True)
- >>> result = thread.get()
-
- :param pipe: (required)
- :type pipe: list[str]
- :param ioutil: (required)
- :type ioutil: list[str]
- :param http: (required)
- :type http: list[str]
- :param url: (required)
- :type url: list[str]
- :param context: (required)
- :type context: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pipe',
- 'ioutil',
- 'http',
- 'url',
- 'context'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_inline_additional_properties(
+ self,
+ request_body,
+ **kwargs
+ ):
+ """test inline additionalProperties # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties(request_body, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ request_body ({str: (str,)}): request body
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['request_body'] = \
+ request_body
+ return self.call_with_http_info(**kwargs)
+
+ self.test_inline_additional_properties = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/inline-additionalProperties',
+ 'operation_id': 'test_inline_additional_properties',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'request_body',
+ ],
+ 'required': [
+ 'request_body',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'request_body':
+ ({str: (str,)},),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'request_body': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_inline_additional_properties
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_query_parameter_collection_format" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pipe' is set
- if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501
- local_var_params['pipe'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'ioutil' is set
- if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501
- local_var_params['ioutil'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'http' is set
- if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501
- local_var_params['http'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'url' is set
- if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501
- local_var_params['url'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501
- # verify the required parameter 'context' is set
- if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501
- local_var_params['context'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501
- query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501
- collection_formats['pipe'] = 'multi' # noqa: E501
- if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501
- query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501
- collection_formats['ioutil'] = 'csv' # noqa: E501
- if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501
- query_params.append(('http', local_var_params['http'])) # noqa: E501
- collection_formats['http'] = 'ssv' # noqa: E501
- if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501
- query_params.append(('url', local_var_params['url'])) # noqa: E501
- collection_formats['url'] = 'csv' # noqa: E501
- if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501
- query_params.append(('context', local_var_params['context'])) # noqa: E501
- collection_formats['context'] = 'multi' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/fake/test-query-paramters', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
+ def __test_json_form_data(
+ self,
+ param,
+ param2,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.test_json_form_data(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ param (str): field1
+ param2 (str): field2
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['param'] = \
+ param
+ kwargs['param2'] = \
+ param2
+ return self.call_with_http_info(**kwargs)
+
+ self.test_json_form_data = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/jsonFormData',
+ 'operation_id': 'test_json_form_data',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'param',
+ 'param2',
+ ],
+ 'required': [
+ 'param',
+ 'param2',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'param':
+ (str,),
+ 'param2':
+ (str,),
+ },
+ 'attribute_map': {
+ 'param': 'param',
+ 'param2': 'param2',
+ },
+ 'location_map': {
+ 'param': 'form',
+ 'param2': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_json_form_data
+ )
+
+ def __test_query_parameter_collection_format(
+ self,
+ pipe,
+ ioutil,
+ http,
+ url,
+ context,
+ **kwargs
+ ):
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pipe ([str]):
+ ioutil ([str]):
+ http ([str]):
+ url ([str]):
+ context ([str]):
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pipe'] = \
+ pipe
+ kwargs['ioutil'] = \
+ ioutil
+ kwargs['http'] = \
+ http
+ kwargs['url'] = \
+ url
+ kwargs['context'] = \
+ context
+ return self.call_with_http_info(**kwargs)
+
+ self.test_query_parameter_collection_format = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/fake/test-query-paramters',
+ 'operation_id': 'test_query_parameter_collection_format',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pipe',
+ 'ioutil',
+ 'http',
+ 'url',
+ 'context',
+ ],
+ 'required': [
+ 'pipe',
+ 'ioutil',
+ 'http',
+ 'url',
+ 'context',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pipe':
+ ([str],),
+ 'ioutil':
+ ([str],),
+ 'http':
+ ([str],),
+ 'url':
+ ([str],),
+ 'context':
+ ([str],),
+ },
+ 'attribute_map': {
+ 'pipe': 'pipe',
+ 'ioutil': 'ioutil',
+ 'http': 'http',
+ 'url': 'url',
+ 'context': 'context',
+ },
+ 'location_map': {
+ 'pipe': 'query',
+ 'ioutil': 'query',
+ 'http': 'query',
+ 'url': 'query',
+ 'context': 'query',
+ },
+ 'collection_format_map': {
+ 'pipe': 'multi',
+ 'ioutil': 'csv',
+ 'http': 'ssv',
+ 'url': 'csv',
+ 'context': 'multi',
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__test_query_parameter_collection_format
+ )
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py
index 533f8b80d894..40f8039b3cb1 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.client import Client
class FakeClassnameTags123Api(object):
@@ -36,141 +38,122 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def test_classname(self, client, **kwargs): # noqa: E501
- """To test class name in snake case # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_classname(client, async_req=True)
- >>> result = thread.get()
-
- :param client: client model (required)
- :type client: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Client
- """
- kwargs['_return_http_data_only'] = True
- return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
-
- def test_classname_with_http_info(self, client, **kwargs): # noqa: E501
- """To test class name in snake case # noqa: E501
-
- 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_req=True
-
- >>> thread = api.test_classname_with_http_info(client, async_req=True)
- >>> result = thread.get()
-
- :param client: client model (required)
- :type client: Client
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'client'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __test_classname(
+ self,
+ client,
+ **kwargs
+ ):
+ """To test class name in snake case # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.test_classname(client, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ client (Client): client model
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Client
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['client'] = \
+ client
+ return self.call_with_http_info(**kwargs)
+
+ self.test_classname = Endpoint(
+ settings={
+ 'response_type': (Client,),
+ 'auth': [
+ 'api_key_query'
+ ],
+ 'endpoint_path': '/fake_classname_test',
+ 'operation_id': 'test_classname',
+ 'http_method': 'PATCH',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'client',
+ ],
+ 'required': [
+ 'client',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'client':
+ (Client,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'client': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__test_classname
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method test_classname" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'client' is set
- if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
- local_var_params['client'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'client' in local_var_params:
- body_params = local_var_params['client']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['api_key_query'] # noqa: E501
-
- response_types_map = {
- 200: "Client",
- }
-
- return self.api_client.call_api(
- '/fake_classname_test', 'PATCH',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py
index 6a9d01e46498..3a20006d3929 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py
@@ -10,18 +10,21 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.api_response import ApiResponse
+from petstore_api.model.pet import Pet
class PetApi(object):
@@ -36,1288 +39,1149 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def add_pet(self, pet, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.add_pet(pet, async_req=True)
- >>> result = thread.get()
-
- :param pet: Pet object that needs to be added to the store (required)
- :type pet: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
-
- def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.add_pet_with_http_info(pet, async_req=True)
- >>> result = thread.get()
-
- :param pet: Pet object that needs to be added to the store (required)
- :type pet: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_hosts = [
- 'http://petstore.swagger.io/v2',
- 'http://path-server-test.petstore.local/v2'
- ]
- local_var_host = local_var_hosts[0]
- if kwargs.get('_host_index'):
- _host_index = int(kwargs.get('_host_index'))
- if _host_index < 0 or _host_index >= len(local_var_hosts):
- raise ApiValueError(
- "Invalid host index. Must be 0 <= index < %s"
- % len(local_var_host)
- )
- local_var_host = local_var_hosts[_host_index]
- local_var_params = locals()
-
- all_params = [
- 'pet'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __add_pet(
+ self,
+ pet,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.add_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet (Pet): Pet object that needs to be added to the store
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet'] = \
+ pet
+ return self.call_with_http_info(**kwargs)
+
+ self.add_pet = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'http_signature_test',
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet',
+ 'operation_id': 'add_pet',
+ 'http_method': 'POST',
+ 'servers': [
+ {
+ 'url': "http://petstore.swagger.io/v2",
+ 'description': "No description provided",
+ },
+ {
+ 'url': "http://path-server-test.petstore.local/v2",
+ 'description': "No description provided",
+ },
+ ]
+ },
+ params_map={
+ 'all': [
+ 'pet',
+ ],
+ 'required': [
+ 'pet',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet':
+ (Pet,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'pet': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json',
+ 'application/xml'
+ ]
+ },
+ api_client=api_client,
+ callable=__add_pet
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params and key != "_host_index":
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method add_pet" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet' is set
- if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501
- local_var_params['pet'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet` when calling `add_pet`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'pet' in local_var_params:
- body_params = local_var_params['pet']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json', 'application/xml']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- _host=local_var_host,
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def delete_pet(self, pet_id, **kwargs): # noqa: E501
- """Deletes a pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.delete_pet(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: Pet id to delete (required)
- :type pet_id: int
- :param api_key:
- :type api_key: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """Deletes a pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: Pet id to delete (required)
- :type pet_id: int
- :param api_key:
- :type api_key: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'api_key'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __delete_pet(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """Deletes a pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): Pet id to delete
+
+ Keyword Args:
+ api_key (str): [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.delete_pet = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/{petId}',
+ 'operation_id': 'delete_pet',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'api_key',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'api_key':
+ (str,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'api_key': 'api_key',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'api_key': 'header',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__delete_pet
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_pet" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
- if 'api_key' in local_var_params:
- header_params['api_key'] = local_var_params['api_key'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet/{petId}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def find_pets_by_status(self, status, **kwargs): # noqa: E501
- """Finds Pets by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_status(status, async_req=True)
- >>> result = thread.get()
-
- :param status: Status values that need to be considered for filter (required)
- :type status: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: list[Pet]
- """
- kwargs['_return_http_data_only'] = True
- return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
-
- def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501
- """Finds Pets by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
- >>> result = thread.get()
-
- :param status: Status values that need to be considered for filter (required)
- :type status: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'status'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __find_pets_by_status(
+ self,
+ status,
+ **kwargs
+ ):
+ """Finds Pets by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_status(status, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ status ([str]): Status values that need to be considered for filter
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ [Pet]
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['status'] = \
+ status
+ return self.call_with_http_info(**kwargs)
+
+ self.find_pets_by_status = Endpoint(
+ settings={
+ 'response_type': ([Pet],),
+ 'auth': [
+ 'http_signature_test',
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/findByStatus',
+ 'operation_id': 'find_pets_by_status',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'status',
+ ],
+ 'required': [
+ 'status',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ 'status',
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ ('status',): {
+
+ "AVAILABLE": "available",
+ "PENDING": "pending",
+ "SOLD": "sold"
+ },
+ },
+ 'openapi_types': {
+ 'status':
+ ([str],),
+ },
+ 'attribute_map': {
+ 'status': 'status',
+ },
+ 'location_map': {
+ 'status': 'query',
+ },
+ 'collection_format_map': {
+ 'status': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__find_pets_by_status
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method find_pets_by_status" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'status' is set
- if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501
- local_var_params['status'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501
- query_params.append(('status', local_var_params['status'])) # noqa: E501
- collection_formats['status'] = 'csv' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "list[Pet]",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/pet/findByStatus', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def find_pets_by_tags(self, tags, **kwargs): # noqa: E501
- """Finds Pets by tags # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_tags(tags, async_req=True)
- >>> result = thread.get()
-
- :param tags: Tags to filter by (required)
- :type tags: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: list[Pet]
- """
- kwargs['_return_http_data_only'] = True
- return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
-
- def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501
- """Finds Pets by tags # noqa: E501
-
- 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_req=True
-
- >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
- >>> result = thread.get()
-
- :param tags: Tags to filter by (required)
- :type tags: list[str]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'tags'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __find_pets_by_tags(
+ self,
+ tags,
+ **kwargs
+ ):
+ """Finds Pets by tags # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.find_pets_by_tags(tags, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ tags ([str]): Tags to filter by
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ [Pet]
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['tags'] = \
+ tags
+ return self.call_with_http_info(**kwargs)
+
+ self.find_pets_by_tags = Endpoint(
+ settings={
+ 'response_type': ([Pet],),
+ 'auth': [
+ 'http_signature_test',
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/findByTags',
+ 'operation_id': 'find_pets_by_tags',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'tags',
+ ],
+ 'required': [
+ 'tags',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'tags':
+ ([str],),
+ },
+ 'attribute_map': {
+ 'tags': 'tags',
+ },
+ 'location_map': {
+ 'tags': 'query',
+ },
+ 'collection_format_map': {
+ 'tags': 'csv',
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__find_pets_by_tags
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method find_pets_by_tags" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'tags' is set
- if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501
- local_var_params['tags'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501
- query_params.append(('tags', local_var_params['tags'])) # noqa: E501
- collection_formats['tags'] = 'csv' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "list[Pet]",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/pet/findByTags', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501
- """Find pet by ID # noqa: E501
-
- Returns a single pet # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.get_pet_by_id(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet to return (required)
- :type pet_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Pet
- """
- kwargs['_return_http_data_only'] = True
- return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """Find pet by ID # noqa: E501
-
- Returns a single pet # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- 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 pet_id: ID of pet to return (required)
- :type pet_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_pet_by_id(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): ID of pet to return
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Pet
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.get_pet_by_id = Endpoint(
+ settings={
+ 'response_type': (Pet,),
+ 'auth': [
+ 'api_key'
+ ],
+ 'endpoint_path': '/pet/{petId}',
+ 'operation_id': 'get_pet_by_id',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_pet_by_id
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_pet_by_id" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['api_key'] # noqa: E501
-
- response_types_map = {
- 200: "Pet",
- 400: None,
- 404: None,
- }
-
- return self.api_client.call_api(
- '/pet/{petId}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def update_pet(self, pet, **kwargs): # noqa: E501
- """Update an existing pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.update_pet(pet, async_req=True)
- >>> result = thread.get()
-
- :param pet: Pet object that needs to be added to the store (required)
- :type pet: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
-
- def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501
- """Update an existing pet # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.update_pet_with_http_info(pet, async_req=True)
- >>> result = thread.get()
-
- :param pet: Pet object that needs to be added to the store (required)
- :type pet: Pet
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_hosts = [
- 'http://petstore.swagger.io/v2',
- 'http://path-server-test.petstore.local/v2'
- ]
- local_var_host = local_var_hosts[0]
- if kwargs.get('_host_index'):
- _host_index = int(kwargs.get('_host_index'))
- if _host_index < 0 or _host_index >= len(local_var_hosts):
- raise ApiValueError(
- "Invalid host index. Must be 0 <= index < %s"
- % len(local_var_host)
- )
- local_var_host = local_var_hosts[_host_index]
- local_var_params = locals()
-
- all_params = [
- 'pet'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __update_pet(
+ self,
+ pet,
+ **kwargs
+ ):
+ """Update an existing pet # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet (Pet): Pet object that needs to be added to the store
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet'] = \
+ pet
+ return self.call_with_http_info(**kwargs)
+
+ self.update_pet = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'http_signature_test',
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet',
+ 'operation_id': 'update_pet',
+ 'http_method': 'PUT',
+ 'servers': [
+ {
+ 'url': "http://petstore.swagger.io/v2",
+ 'description': "No description provided",
+ },
+ {
+ 'url': "http://path-server-test.petstore.local/v2",
+ 'description': "No description provided",
+ },
+ ]
+ },
+ params_map={
+ 'all': [
+ 'pet',
+ ],
+ 'required': [
+ 'pet',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet':
+ (Pet,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'pet': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json',
+ 'application/xml'
+ ]
+ },
+ api_client=api_client,
+ callable=__update_pet
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params and key != "_host_index":
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_pet" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet' is set
- if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501
- local_var_params['pet'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet` when calling `update_pet`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'pet' in local_var_params:
- body_params = local_var_params['pet']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json', 'application/xml']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- _host=local_var_host,
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.update_pet_with_form(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet that needs to be updated (required)
- :type pet_id: int
- :param name: Updated name of the pet
- :type name: str
- :param status: Updated status of the pet
- :type status: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet that needs to be updated (required)
- :type pet_id: int
- :param name: Updated name of the pet
- :type name: str
- :param status: Updated status of the pet
- :type status: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'name',
- 'status'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __update_pet_with_form(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.update_pet_with_form(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): ID of pet that needs to be updated
+
+ Keyword Args:
+ name (str): Updated name of the pet. [optional]
+ status (str): Updated status of the pet. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.update_pet_with_form = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/{petId}',
+ 'operation_id': 'update_pet_with_form',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'name',
+ 'status',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'name':
+ (str,),
+ 'status':
+ (str,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'name': 'name',
+ 'status': 'status',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'name': 'form',
+ 'status': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/x-www-form-urlencoded'
+ ]
+ },
+ api_client=api_client,
+ callable=__update_pet_with_form
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_pet_with_form" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'name' in local_var_params:
- form_params.append(('name', local_var_params['name'])) # noqa: E501
- if 'status' in local_var_params:
- form_params.append(('status', local_var_params['status'])) # noqa: E501
-
- body_params = None
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/x-www-form-urlencoded']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/pet/{petId}', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def upload_file(self, pet_id, **kwargs): # noqa: E501
- """uploads an image # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.upload_file(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet to update (required)
- :type pet_id: int
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param file: file to upload
- :type file: file
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: ApiResponse
- """
- kwargs['_return_http_data_only'] = True
- return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
-
- def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501
- """uploads an image # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.upload_file_with_http_info(pet_id, async_req=True)
- >>> result = thread.get()
-
- :param pet_id: ID of pet to update (required)
- :type pet_id: int
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param file: file to upload
- :type file: file
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'additional_metadata',
- 'file'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __upload_file(
+ self,
+ pet_id,
+ **kwargs
+ ):
+ """uploads an image # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ pet_id (int): ID of pet to update
+
+ Keyword Args:
+ additional_metadata (str): Additional data to pass to server. [optional]
+ file (file_type): file to upload. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ApiResponse
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ return self.call_with_http_info(**kwargs)
+
+ self.upload_file = Endpoint(
+ settings={
+ 'response_type': (ApiResponse,),
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/pet/{petId}/uploadImage',
+ 'operation_id': 'upload_file',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'additional_metadata',
+ 'file',
+ ],
+ 'required': [
+ 'pet_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'additional_metadata':
+ (str,),
+ 'file':
+ (file_type,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'additional_metadata': 'additionalMetadata',
+ 'file': 'file',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'additional_metadata': 'form',
+ 'file': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'multipart/form-data'
+ ]
+ },
+ api_client=api_client,
+ callable=__upload_file
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method upload_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'additional_metadata' in local_var_params:
- form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'file' in local_var_params:
- local_var_files['file'] = local_var_params['file'] # noqa: E501
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['multipart/form-data']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "ApiResponse",
- }
-
- return self.api_client.call_api(
- '/pet/{petId}/uploadImage', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
- """uploads an image (required) # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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 pet_id: ID of pet to update (required)
- :type pet_id: int
- :param required_file: file to upload (required)
- :type required_file: file
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: ApiResponse
- """
- kwargs['_return_http_data_only'] = True
- return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
-
- def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
- """uploads an image (required) # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- 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 pet_id: ID of pet to update (required)
- :type pet_id: int
- :param required_file: file to upload (required)
- :type required_file: file
- :param additional_metadata: Additional data to pass to server
- :type additional_metadata: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'pet_id',
- 'required_file',
- 'additional_metadata'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __upload_file_with_required_file(
+ self,
+ pet_id,
+ required_file,
+ **kwargs
+ ):
+ """uploads an image (required) # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ 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()
+
+ Args:
+ pet_id (int): ID of pet to update
+ required_file (file_type): file to upload
+
+ Keyword Args:
+ additional_metadata (str): Additional data to pass to server. [optional]
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ ApiResponse
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['pet_id'] = \
+ pet_id
+ kwargs['required_file'] = \
+ required_file
+ return self.call_with_http_info(**kwargs)
+
+ self.upload_file_with_required_file = Endpoint(
+ settings={
+ 'response_type': (ApiResponse,),
+ 'auth': [
+ 'petstore_auth'
+ ],
+ 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile',
+ 'operation_id': 'upload_file_with_required_file',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'pet_id',
+ 'required_file',
+ 'additional_metadata',
+ ],
+ 'required': [
+ 'pet_id',
+ 'required_file',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'pet_id':
+ (int,),
+ 'required_file':
+ (file_type,),
+ 'additional_metadata':
+ (str,),
+ },
+ 'attribute_map': {
+ 'pet_id': 'petId',
+ 'required_file': 'requiredFile',
+ 'additional_metadata': 'additionalMetadata',
+ },
+ 'location_map': {
+ 'pet_id': 'path',
+ 'required_file': 'form',
+ 'additional_metadata': 'form',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [
+ 'multipart/form-data'
+ ]
+ },
+ api_client=api_client,
+ callable=__upload_file_with_required_file
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method upload_file_with_required_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'pet_id' is set
- if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501
- local_var_params['pet_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
- # verify the required parameter 'required_file' is set
- if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501
- local_var_params['required_file'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'pet_id' in local_var_params:
- path_params['petId'] = local_var_params['pet_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
- if 'additional_metadata' in local_var_params:
- form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'required_file' in local_var_params:
- local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['multipart/form-data']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['petstore_auth'] # noqa: E501
-
- response_types_map = {
- 200: "ApiResponse",
- }
-
- return self.api_client.call_api(
- '/fake/{petId}/uploadImageWithRequiredFile', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py
index 2b22e1371860..5aa2d27623a8 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.order import Order
class StoreApi(object):
@@ -36,534 +38,466 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def delete_order(self, order_id, **kwargs): # noqa: E501
- """Delete purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_order(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of the order that needs to be deleted (required)
- :type order_id: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
-
- def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501
- """Delete purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_order_with_http_info(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of the order that needs to be deleted (required)
- :type order_id: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'order_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __delete_order(
+ self,
+ order_id,
+ **kwargs
+ ):
+ """Delete purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_order(order_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ order_id (str): ID of the order that needs to be deleted
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['order_id'] = \
+ order_id
+ return self.call_with_http_info(**kwargs)
+
+ self.delete_order = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/store/order/{order_id}',
+ 'operation_id': 'delete_order',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'order_id',
+ ],
+ 'required': [
+ 'order_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'order_id':
+ (str,),
+ },
+ 'attribute_map': {
+ 'order_id': 'order_id',
+ },
+ 'location_map': {
+ 'order_id': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__delete_order
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_order" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'order_id' is set
- if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
- local_var_params['order_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'order_id' in local_var_params:
- path_params['order_id'] = local_var_params['order_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/store/order/{order_id}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_inventory(self, **kwargs): # noqa: E501
- """Returns pet inventories by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_inventory(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: dict(str, int)
- """
- kwargs['_return_http_data_only'] = True
- return self.get_inventory_with_http_info(**kwargs) # noqa: E501
-
- def get_inventory_with_http_info(self, **kwargs): # noqa: E501
- """Returns pet inventories by status # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_inventory_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_inventory(
+ self,
+ **kwargs
+ ):
+ """Returns pet inventories by status # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_inventory(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ {str: (int,)}
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.get_inventory = Endpoint(
+ settings={
+ 'response_type': ({str: (int,)},),
+ 'auth': [
+ 'api_key'
+ ],
+ 'endpoint_path': '/store/inventory',
+ 'operation_id': 'get_inventory',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_inventory
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_inventory" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['api_key'] # noqa: E501
-
- response_types_map = {
- 200: "dict(str, int)",
- }
-
- return self.api_client.call_api(
- '/store/inventory', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_order_by_id(self, order_id, **kwargs): # noqa: E501
- """Find purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_order_by_id(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of pet that needs to be fetched (required)
- :type order_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Order
- """
- kwargs['_return_http_data_only'] = True
- return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
-
- def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501
- """Find purchase order by ID # noqa: E501
-
- 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_req=True
-
- >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
- >>> result = thread.get()
-
- :param order_id: ID of pet that needs to be fetched (required)
- :type order_id: int
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'order_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_order_by_id(
+ self,
+ order_id,
+ **kwargs
+ ):
+ """Find purchase order by ID # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.get_order_by_id(order_id, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ order_id (int): ID of pet that needs to be fetched
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Order
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['order_id'] = \
+ order_id
+ return self.call_with_http_info(**kwargs)
+
+ self.get_order_by_id = Endpoint(
+ settings={
+ 'response_type': (Order,),
+ 'auth': [],
+ 'endpoint_path': '/store/order/{order_id}',
+ 'operation_id': 'get_order_by_id',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'order_id',
+ ],
+ 'required': [
+ 'order_id',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ 'order_id',
+ ]
+ },
+ root_map={
+ 'validations': {
+ ('order_id',): {
+
+ 'inclusive_maximum': 5,
+ 'inclusive_minimum': 1,
+ },
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'order_id':
+ (int,),
+ },
+ 'attribute_map': {
+ 'order_id': 'order_id',
+ },
+ 'location_map': {
+ 'order_id': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_order_by_id
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_order_by_id" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'order_id' is set
- if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
- local_var_params['order_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
-
- if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501
- raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
- if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501
- raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
- collection_formats = {}
-
- path_params = {}
- if 'order_id' in local_var_params:
- path_params['order_id'] = local_var_params['order_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Order",
- 400: None,
- 404: None,
- }
-
- return self.api_client.call_api(
- '/store/order/{order_id}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def place_order(self, order, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.place_order(order, async_req=True)
- >>> result = thread.get()
-
- :param order: order placed for purchasing the pet (required)
- :type order: Order
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: Order
- """
- kwargs['_return_http_data_only'] = True
- return self.place_order_with_http_info(order, **kwargs) # noqa: E501
-
- def place_order_with_http_info(self, order, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.place_order_with_http_info(order, async_req=True)
- >>> result = thread.get()
-
- :param order: order placed for purchasing the pet (required)
- :type order: Order
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'order'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __place_order(
+ self,
+ order,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.place_order(order, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ order (Order): order placed for purchasing the pet
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ Order
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['order'] = \
+ order
+ return self.call_with_http_info(**kwargs)
+
+ self.place_order = Endpoint(
+ settings={
+ 'response_type': (Order,),
+ 'auth': [],
+ 'endpoint_path': '/store/order',
+ 'operation_id': 'place_order',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'order',
+ ],
+ 'required': [
+ 'order',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'order':
+ (Order,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'order': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__place_order
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method place_order" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'order' is set
- if self.api_client.client_side_validation and ('order' not in local_var_params or # noqa: E501
- local_var_params['order'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `order` when calling `place_order`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'order' in local_var_params:
- body_params = local_var_params['order']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "Order",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/store/order', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py
index a0a25e7bcbcf..ee0468ec9286 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py
@@ -10,18 +10,20 @@
"""
-from __future__ import absolute_import
-
import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from petstore_api.api_client import ApiClient
-from petstore_api.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
+import sys # noqa: F401
+
+from petstore_api.api_client import ApiClient, Endpoint
+from petstore_api.model_utils import ( # noqa: F401
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ file_type,
+ none_type,
+ validate_and_convert_types
)
+from petstore_api.model.user import User
class UserApi(object):
@@ -36,1066 +38,935 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client
- def create_user(self, user, **kwargs): # noqa: E501
- """Create user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.create_user(user, async_req=True)
- >>> result = thread.get()
-
- :param user: Created user object (required)
- :type user: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_user_with_http_info(user, **kwargs) # noqa: E501
-
- def create_user_with_http_info(self, user, **kwargs): # noqa: E501
- """Create user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.create_user_with_http_info(user, async_req=True)
- >>> result = thread.get()
-
- :param user: Created user object (required)
- :type user: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'user'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_user(
+ self,
+ user,
+ **kwargs
+ ):
+ """Create user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.create_user(user, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ user (User): Created user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['user'] = \
+ user
+ return self.call_with_http_info(**kwargs)
+
+ self.create_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user',
+ 'operation_id': 'create_user',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'user',
+ ],
+ 'required': [
+ 'user',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'user':
+ (User,),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'user': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__create_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'user' is set
- if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
- local_var_params['user'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `user` when calling `create_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'user' in local_var_params:
- body_params = local_var_params['user']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def create_users_with_array_input(self, user, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_array_input(user, async_req=True)
- >>> result = thread.get()
-
- :param user: List of user object (required)
- :type user: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
-
- def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
- >>> result = thread.get()
-
- :param user: List of user object (required)
- :type user: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'user'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_users_with_array_input(
+ self,
+ user,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.create_users_with_array_input(user, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ user ([User]): List of user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['user'] = \
+ user
+ return self.call_with_http_info(**kwargs)
+
+ self.create_users_with_array_input = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/createWithArray',
+ 'operation_id': 'create_users_with_array_input',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'user',
+ ],
+ 'required': [
+ 'user',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'user':
+ ([User],),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'user': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__create_users_with_array_input
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_users_with_array_input" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'user' is set
- if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
- local_var_params['user'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_array_input`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'user' in local_var_params:
- body_params = local_var_params['user']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/createWithArray', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def create_users_with_list_input(self, user, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_list_input(user, async_req=True)
- >>> result = thread.get()
-
- :param user: List of user object (required)
- :type user: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
-
- def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
- >>> result = thread.get()
-
- :param user: List of user object (required)
- :type user: list[User]
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'user'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __create_users_with_list_input(
+ self,
+ user,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.create_users_with_list_input(user, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ user ([User]): List of user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['user'] = \
+ user
+ return self.call_with_http_info(**kwargs)
+
+ self.create_users_with_list_input = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/createWithList',
+ 'operation_id': 'create_users_with_list_input',
+ 'http_method': 'POST',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'user',
+ ],
+ 'required': [
+ 'user',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'user':
+ ([User],),
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ 'user': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__create_users_with_list_input
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_users_with_list_input" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'user' is set
- if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
- local_var_params['user'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_list_input`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'user' in local_var_params:
- body_params = local_var_params['user']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/createWithList', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def delete_user(self, username, **kwargs): # noqa: E501
- """Delete user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_user(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be deleted (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
-
- def delete_user_with_http_info(self, username, **kwargs): # noqa: E501
- """Delete user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.delete_user_with_http_info(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be deleted (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __delete_user(
+ self,
+ username,
+ **kwargs
+ ):
+ """Delete user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.delete_user(username, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): The name that needs to be deleted
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ return self.call_with_http_info(**kwargs)
+
+ self.delete_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/{username}',
+ 'operation_id': 'delete_user',
+ 'http_method': 'DELETE',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ ],
+ 'required': [
+ 'username',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ },
+ 'location_map': {
+ 'username': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__delete_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'username' in local_var_params:
- path_params['username'] = local_var_params['username'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/{username}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def get_user_by_name(self, username, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.get_user_by_name(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be fetched. Use user1 for testing. (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: User
- """
- kwargs['_return_http_data_only'] = True
- return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
-
- def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
- >>> result = thread.get()
-
- :param username: The name that needs to be fetched. Use user1 for testing. (required)
- :type username: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __get_user_by_name(
+ self,
+ username,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.get_user_by_name(username, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): The name that needs to be fetched. Use user1 for testing.
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ User
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ return self.call_with_http_info(**kwargs)
+
+ self.get_user_by_name = Endpoint(
+ settings={
+ 'response_type': (User,),
+ 'auth': [],
+ 'endpoint_path': '/user/{username}',
+ 'operation_id': 'get_user_by_name',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ ],
+ 'required': [
+ 'username',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ },
+ 'location_map': {
+ 'username': 'path',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__get_user_by_name
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_user_by_name" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'username' in local_var_params:
- path_params['username'] = local_var_params['username'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "User",
- 400: None,
- 404: None,
- }
-
- return self.api_client.call_api(
- '/user/{username}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def login_user(self, username, password, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.login_user(username, password, async_req=True)
- >>> result = thread.get()
-
- :param username: The user name for login (required)
- :type username: str
- :param password: The password for login in clear text (required)
- :type password: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: str
- """
- kwargs['_return_http_data_only'] = True
- return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
-
- def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.login_user_with_http_info(username, password, async_req=True)
- >>> result = thread.get()
-
- :param username: The user name for login (required)
- :type username: str
- :param password: The password for login in clear text (required)
- :type password: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username',
- 'password'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __login_user(
+ self,
+ username,
+ password,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.login_user(username, password, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): The user name for login
+ password (str): The password for login in clear text
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ str
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ kwargs['password'] = \
+ password
+ return self.call_with_http_info(**kwargs)
+
+ self.login_user = Endpoint(
+ settings={
+ 'response_type': (str,),
+ 'auth': [],
+ 'endpoint_path': '/user/login',
+ 'operation_id': 'login_user',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ 'password',
+ ],
+ 'required': [
+ 'username',
+ 'password',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ 'password':
+ (str,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ 'password': 'password',
+ },
+ 'location_map': {
+ 'username': 'query',
+ 'password': 'query',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [
+ 'application/xml',
+ 'application/json'
+ ],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__login_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method login_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501
- # verify the required parameter 'password' is set
- if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501
- local_var_params['password'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501
- query_params.append(('username', local_var_params['username'])) # noqa: E501
- if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501
- query_params.append(('password', local_var_params['password'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/xml', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {
- 200: "str",
- 400: None,
- }
-
- return self.api_client.call_api(
- '/user/login', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def logout_user(self, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.logout_user(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.logout_user_with_http_info(**kwargs) # noqa: E501
-
- def logout_user_with_http_info(self, **kwargs): # noqa: E501
- """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_req=True
-
- >>> thread = api.logout_user_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __logout_user(
+ self,
+ **kwargs
+ ):
+ """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_req=True
+
+ >>> thread = api.logout_user(async_req=True)
+ >>> result = thread.get()
+
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ return self.call_with_http_info(**kwargs)
+
+ self.logout_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/logout',
+ 'operation_id': 'logout_user',
+ 'http_method': 'GET',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ ],
+ 'required': [],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ },
+ 'attribute_map': {
+ },
+ 'location_map': {
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [],
+ },
+ api_client=api_client,
+ callable=__logout_user
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method logout_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/logout', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
-
- def update_user(self, username, user, **kwargs): # noqa: E501
- """Updated user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.update_user(username, user, async_req=True)
- >>> result = thread.get()
-
- :param username: name that need to be deleted (required)
- :type username: str
- :param user: Updated user object (required)
- :type user: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
- kwargs['_return_http_data_only'] = True
- return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
-
- def update_user_with_http_info(self, username, user, **kwargs): # noqa: E501
- """Updated user # noqa: E501
-
- 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_req=True
-
- >>> thread = api.update_user_with_http_info(username, user, async_req=True)
- >>> result = thread.get()
-
- :param username: name that need to be deleted (required)
- :type username: str
- :param user: Updated user object (required)
- :type user: User
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: None
- """
-
- local_var_params = locals()
-
- all_params = [
- 'username',
- 'user'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth'
- ]
+ def __update_user(
+ self,
+ username,
+ user,
+ **kwargs
+ ):
+ """Updated user # noqa: E501
+
+ 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_req=True
+
+ >>> thread = api.update_user(username, user, async_req=True)
+ >>> result = thread.get()
+
+ Args:
+ username (str): name that need to be deleted
+ user (User): Updated user object
+
+ Keyword Args:
+ _return_http_data_only (bool): response data without head status
+ code and headers. Default is True.
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
+ will be returned without reading/decoding response data.
+ Default is True.
+ _request_timeout (float/tuple): timeout setting for this request. If one
+ number provided, it will be total request timeout. It can also
+ be a pair (tuple) of (connection, read) timeouts.
+ Default is None.
+ _check_input_type (bool): specifies if type checking
+ should be done one the data sent to the server.
+ Default is True.
+ _check_return_type (bool): specifies if type checking
+ should be done one the data received from the server.
+ Default is True.
+ _host_index (int/None): specifies the index of the server
+ that we want to use.
+ Default is read from the configuration.
+ async_req (bool): execute request asynchronously
+
+ Returns:
+ None
+ If the method is called asynchronously, returns the request
+ thread.
+ """
+ kwargs['async_req'] = kwargs.get(
+ 'async_req', False
+ )
+ kwargs['_return_http_data_only'] = kwargs.get(
+ '_return_http_data_only', True
+ )
+ kwargs['_preload_content'] = kwargs.get(
+ '_preload_content', True
+ )
+ kwargs['_request_timeout'] = kwargs.get(
+ '_request_timeout', None
+ )
+ kwargs['_check_input_type'] = kwargs.get(
+ '_check_input_type', True
+ )
+ kwargs['_check_return_type'] = kwargs.get(
+ '_check_return_type', True
+ )
+ kwargs['_host_index'] = kwargs.get('_host_index')
+ kwargs['username'] = \
+ username
+ kwargs['user'] = \
+ user
+ return self.call_with_http_info(**kwargs)
+
+ self.update_user = Endpoint(
+ settings={
+ 'response_type': None,
+ 'auth': [],
+ 'endpoint_path': '/user/{username}',
+ 'operation_id': 'update_user',
+ 'http_method': 'PUT',
+ 'servers': None,
+ },
+ params_map={
+ 'all': [
+ 'username',
+ 'user',
+ ],
+ 'required': [
+ 'username',
+ 'user',
+ ],
+ 'nullable': [
+ ],
+ 'enum': [
+ ],
+ 'validation': [
+ ]
+ },
+ root_map={
+ 'validations': {
+ },
+ 'allowed_values': {
+ },
+ 'openapi_types': {
+ 'username':
+ (str,),
+ 'user':
+ (User,),
+ },
+ 'attribute_map': {
+ 'username': 'username',
+ },
+ 'location_map': {
+ 'username': 'path',
+ 'user': 'body',
+ },
+ 'collection_format_map': {
+ }
+ },
+ headers_map={
+ 'accept': [],
+ 'content_type': [
+ 'application/json'
+ ]
+ },
+ api_client=api_client,
+ callable=__update_user
)
-
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_user" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'username' is set
- if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501
- local_var_params['username'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501
- # verify the required parameter 'user' is set
- if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501
- local_var_params['user'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `user` when calling `update_user`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'username' in local_var_params:
- path_params['username'] = local_var_params['username'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'user' in local_var_params:
- body_params = local_var_params['user']
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = [] # noqa: E501
-
- response_types_map = {}
-
- return self.api_client.call_api(
- '/user/{username}', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_types_map=response_types_map,
- auth_settings=auth_settings,
- 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'),
- collection_formats=collection_formats,
- _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py
index 52c58e68a08f..ac0fb625b16e 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py
@@ -8,26 +8,35 @@
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-import atexit
-import datetime
-from dateutil.parser import parse
import json
+import atexit
import mimetypes
from multiprocessing.pool import ThreadPool
+import io
import os
import re
-import tempfile
+import typing
+from urllib.parse import quote
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import quote
-from petstore_api.configuration import Configuration
-import petstore_api.models
from petstore_api import rest
-from petstore_api.exceptions import ApiValueError, ApiException
+from petstore_api.configuration import Configuration
+from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException
+from petstore_api.model_utils import (
+ ModelNormal,
+ ModelSimple,
+ ModelComposed,
+ check_allowed_values,
+ check_validations,
+ date,
+ datetime,
+ deserialize_file,
+ file_type,
+ model_to_dict,
+ none_type,
+ validate_and_convert_types
+)
class ApiClient(object):
@@ -52,23 +61,12 @@ class ApiClient(object):
to the API. More threads means more concurrent API requests.
"""
- PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
- NATIVE_TYPES_MAPPING = {
- 'int': int,
- 'long': int if six.PY3 else long, # noqa: F821
- 'float': float,
- 'str': str,
- 'bool': bool,
- 'date': datetime.date,
- 'datetime': datetime.datetime,
- 'object': object,
- }
_pool = None
def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None, pool_threads=1):
if configuration is None:
- configuration = Configuration.get_default_copy()
+ configuration = Configuration()
self.configuration = configuration
self.pool_threads = pool_threads
@@ -79,7 +77,6 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
- self.client_side_validation = configuration.client_side_validation
def __enter__(self):
return self
@@ -118,12 +115,24 @@ def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
def __call_api(
- self, resource_path, method, path_params=None,
- query_params=None, header_params=None, body=None, post_params=None,
- files=None, response_types_map=None, auth_settings=None,
- _return_http_data_only=None, collection_formats=None,
- _preload_content=True, _request_timeout=None, _host=None,
- _request_auth=None):
+ self,
+ resource_path: str,
+ method: str,
+ path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ body: typing.Optional[typing.Any] = None,
+ post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
+ response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
+ auth_settings: typing.Optional[typing.List[str]] = None,
+ _return_http_data_only: typing.Optional[bool] = None,
+ collection_formats: typing.Optional[typing.Dict[str, str]] = None,
+ _preload_content: bool = True,
+ _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
+ _host: typing.Optional[str] = None,
+ _check_type: typing.Optional[bool] = None
+ ):
config = self.configuration
@@ -163,15 +172,14 @@ def __call_api(
collection_formats)
post_params.extend(self.files_parameters(files))
- # auth setting
- self.update_params_for_auth(
- header_params, query_params, auth_settings,
- request_auth=_request_auth)
-
# body
if body:
body = self.sanitize_for_serialization(body)
+ # auth setting
+ self.update_params_for_auth(header_params, query_params,
+ auth_settings, resource_path, method, body)
+
# request url
if _host is None:
url = self.configuration.host + resource_path
@@ -187,30 +195,33 @@ def __call_api(
_preload_content=_preload_content,
_request_timeout=_request_timeout)
except ApiException as e:
- e.body = e.body.decode('utf-8') if six.PY3 else e.body
+ e.body = e.body.decode('utf-8')
raise e
+ content_type = response_data.getheader('content-type')
+
self.last_response = response_data
return_data = response_data
if not _preload_content:
+ return (return_data)
return return_data
-
- response_type = response_types_map.get(response_data.status, None)
- if six.PY3 and response_type not in ["file", "bytes"]:
+ if response_type not in ["file", "bytes"]:
match = None
- content_type = response_data.getheader('content-type')
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
encoding = match.group(1) if match else "utf-8"
response_data.data = response_data.data.decode(encoding)
# deserialize response data
-
if response_type:
- return_data = self.deserialize(response_data, response_type)
+ return_data = self.deserialize(
+ response_data,
+ response_type,
+ _check_type
+ )
else:
return_data = None
@@ -220,9 +231,9 @@ def __call_api(
return (return_data, response_data.status,
response_data.getheaders())
- def sanitize_for_serialization(self, obj):
+ @classmethod
+ def sanitize_for_serialization(cls, obj):
"""Builds a JSON POST object.
-
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
@@ -230,106 +241,90 @@ def sanitize_for_serialization(self, obj):
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is OpenAPI model, return the properties dict.
-
:param obj: The data to serialize.
:return: The serialized form of data.
"""
- if obj is None:
- return None
- elif isinstance(obj, self.PRIMITIVE_TYPES):
+ if isinstance(obj, (ModelNormal, ModelComposed)):
+ return {
+ key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()
+ }
+ elif isinstance(obj, (str, int, float, none_type, bool)):
return obj
- elif isinstance(obj, list):
- return [self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj]
- elif isinstance(obj, tuple):
- return tuple(self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj)
- elif isinstance(obj, (datetime.datetime, datetime.date)):
+ elif isinstance(obj, (datetime, date)):
return obj.isoformat()
-
+ elif isinstance(obj, ModelSimple):
+ return cls.sanitize_for_serialization(obj.value)
+ elif isinstance(obj, (list, tuple)):
+ return [cls.sanitize_for_serialization(item) for item in obj]
if isinstance(obj, dict):
- obj_dict = obj
- else:
- # Convert model obj to dict except
- # attributes `openapi_types`, `attribute_map`
- # and attributes which value is not None.
- # Convert attribute name to json key in
- # model definition for request.
- obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
- for attr, _ in six.iteritems(obj.openapi_types)
- if getattr(obj, attr) is not None}
-
- return {key: self.sanitize_for_serialization(val)
- for key, val in six.iteritems(obj_dict)}
-
- def deserialize(self, response, response_type):
+ return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
+ raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))
+
+ def deserialize(self, response, response_type, _check_type):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
- :param response_type: class literal for
- deserialized object, or string of class name.
+ :param response_type: For the response, a tuple containing:
+ valid classes
+ a list containing valid classes (for list schemas)
+ a dict containing a tuple of valid classes as the value
+ Example values:
+ (str,)
+ (Pet,)
+ (float, none_type)
+ ([int, none_type],)
+ ({str: (bool, str, int, float, date, datetime, str, none_type)},)
+ :param _check_type: boolean, whether to check the types of the data
+ received from the server
+ :type _check_type: bool
:return: deserialized object.
"""
# handle file downloading
# save response body into a tmp file and return the instance
- if response_type == "file":
- return self.__deserialize_file(response)
+ if response_type == (file_type,):
+ content_disposition = response.getheader("Content-Disposition")
+ return deserialize_file(response.data, self.configuration,
+ content_disposition=content_disposition)
# fetch data from response object
try:
- data = json.loads(response.data)
+ received_data = json.loads(response.data)
except ValueError:
- data = response.data
-
- return self.__deserialize(data, response_type)
-
- def __deserialize(self, data, klass):
- """Deserializes dict, list, str into an object.
-
- :param data: dict, list or str.
- :param klass: class literal, or string of class name.
-
- :return: object.
- """
- if data is None:
- return None
-
- if type(klass) == str:
- if klass.startswith('list['):
- sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
- return [self.__deserialize(sub_data, sub_kls)
- for sub_data in data]
-
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
- return {k: self.__deserialize(v, sub_kls)
- for k, v in six.iteritems(data)}
-
- # convert str to class
- if klass in self.NATIVE_TYPES_MAPPING:
- klass = self.NATIVE_TYPES_MAPPING[klass]
- else:
- klass = getattr(petstore_api.models, klass)
-
- if klass in self.PRIMITIVE_TYPES:
- return self.__deserialize_primitive(data, klass)
- elif klass == object:
- return self.__deserialize_object(data)
- elif klass == datetime.date:
- return self.__deserialize_date(data)
- elif klass == datetime.datetime:
- return self.__deserialize_datetime(data)
- else:
- return self.__deserialize_model(data, klass)
-
- def call_api(self, resource_path, method,
- path_params=None, query_params=None, header_params=None,
- body=None, post_params=None, files=None,
- response_types_map=None, auth_settings=None,
- async_req=None, _return_http_data_only=None,
- collection_formats=None,_preload_content=True,
- _request_timeout=None, _host=None, _request_auth=None):
+ received_data = response.data
+
+ # store our data under the key of 'received_data' so users have some
+ # context if they are deserializing a string and the data type is wrong
+ deserialized_data = validate_and_convert_types(
+ received_data,
+ response_type,
+ ['received_data'],
+ True,
+ _check_type,
+ configuration=self.configuration
+ )
+ return deserialized_data
+
+ def call_api(
+ self,
+ resource_path: str,
+ method: str,
+ path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ body: typing.Optional[typing.Any] = None,
+ post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
+ response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
+ auth_settings: typing.Optional[typing.List[str]] = None,
+ async_req: typing.Optional[bool] = None,
+ _return_http_data_only: typing.Optional[bool] = None,
+ collection_formats: typing.Optional[typing.Dict[str, str]] = None,
+ _preload_content: bool = True,
+ _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
+ _host: typing.Optional[str] = None,
+ _check_type: typing.Optional[bool] = None
+ ):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async_req request, set the async_req parameter.
@@ -344,25 +339,38 @@ def call_api(self, resource_path, method,
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
- :param response: Response data type.
- :param files dict: key -> filename, value -> filepath,
- for `multipart/form-data`.
+ :param response_type: For the response, a tuple containing:
+ valid classes
+ a list containing valid classes (for list schemas)
+ a dict containing a tuple of valid classes as the value
+ Example values:
+ (str,)
+ (Pet,)
+ (float, none_type)
+ ([int, none_type],)
+ ({str: (bool, str, int, float, date, datetime, str, none_type)},)
+ :param files: key -> field name, value -> a list of open file
+ objects for `multipart/form-data`.
+ :type files: dict
:param async_req bool: execute request asynchronously
+ :type async_req: bool, optional
:param _return_http_data_only: response data without head status code
and headers
+ :type _return_http_data_only: bool, optional
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
+ :type collection_formats: dict, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
+ :type _preload_content: bool, optional
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_token: dict, optional
+ :param _check_type: boolean describing if the data back from the server
+ should have its type checked.
+ :type _check_type: bool, optional
:return:
If async_req parameter is True,
the request will be called asynchronously.
@@ -374,23 +382,23 @@ def call_api(self, resource_path, method,
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
- response_types_map, auth_settings,
+ response_type, auth_settings,
_return_http_data_only, collection_formats,
_preload_content, _request_timeout, _host,
- _request_auth)
+ _check_type)
return self.pool.apply_async(self.__call_api, (resource_path,
method, path_params,
query_params,
header_params, body,
post_params, files,
- response_types_map,
+ response_type,
auth_settings,
_return_http_data_only,
collection_formats,
_preload_content,
_request_timeout,
- _host, _request_auth))
+ _host, _check_type))
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True,
@@ -412,8 +420,10 @@ def request(self, method, url, query_params=None, headers=None,
return self.rest_client.OPTIONS(url,
query_params=query_params,
headers=headers,
+ post_params=post_params,
_preload_content=_preload_content,
- _request_timeout=_request_timeout)
+ _request_timeout=_request_timeout,
+ body=body)
elif method == "POST":
return self.rest_client.POST(url,
query_params=query_params,
@@ -461,7 +471,7 @@ def parameters_to_tuples(self, params, collection_formats):
new_params = []
if collection_formats is None:
collection_formats = {}
- for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
@@ -481,27 +491,37 @@ def parameters_to_tuples(self, params, collection_formats):
new_params.append((k, v))
return new_params
- def files_parameters(self, files=None):
+ def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
"""Builds form parameters.
- :param files: File parameters.
- :return: Form parameters with files.
+ :param files: None or a dict with key=param_name and
+ value is a list of open file objects
+ :return: List of tuples of form parameters with file data
"""
- params = []
+ if files is None:
+ return []
- if files:
- for k, v in six.iteritems(files):
- if not v:
+ params = []
+ for param_name, file_instances in files.items():
+ if file_instances is None:
+ # if the file field is nullable, skip None values
+ continue
+ for file_instance in file_instances:
+ if file_instance is None:
+ # if the file field is nullable, skip None values
continue
- file_names = v if type(v) is list else [v]
- for n in file_names:
- with open(n, 'rb') as f:
- filename = os.path.basename(f.name)
- filedata = f.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([k, tuple([filename, filedata, mimetype])]))
+ if file_instance.closed is True:
+ raise ApiValueError(
+ "Cannot read a closed file. The passed in file_type "
+ "for %s must be open." % param_name
+ )
+ filename = os.path.basename(file_instance.name)
+ filedata = file_instance.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([param_name, tuple([filename, filedata, mimetype])]))
+ file_instance.close()
return params
@@ -538,156 +558,268 @@ def select_header_content_type(self, content_types):
return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings,
- request_auth=None):
+ resource_path, method, body):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
- :param request_auth: if set, the provided settings will
- override the token in the configuration.
+ :param resource_path: A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method.
+ :param body: A object representing the body of the HTTP request.
+ The object type is the return value of _encoder.default().
"""
if not auth_settings:
return
- if request_auth:
- self._apply_auth_params(headers, querys, request_auth)
- return
-
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
- self._apply_auth_params(headers, querys, auth_setting)
-
- def _apply_auth_params(self, headers, querys, auth_setting):
- """Updates the request parameters based on a single auth_setting
-
- :param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
- :param auth_setting: auth settings for the endpoint
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ else:
+ # The HTTP signature scheme requires multiple HTTP headers
+ # that are calculated dynamically.
+ signing_info = self.configuration.signing_info
+ auth_headers = signing_info.get_http_signature_headers(
+ resource_path, method, headers, body, querys)
+ headers.update(auth_headers)
+ elif auth_setting['in'] == 'query':
+ querys.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+
+class Endpoint(object):
+ def __init__(self, settings=None, params_map=None, root_map=None,
+ headers_map=None, api_client=None, callable=None):
+ """Creates an endpoint
+
+ Args:
+ settings (dict): see below key value pairs
+ 'response_type' (tuple/None): response type
+ 'auth' (list): a list of auth type keys
+ 'endpoint_path' (str): the endpoint path
+ 'operation_id' (str): endpoint string identifier
+ 'http_method' (str): POST/PUT/PATCH/GET etc
+ 'servers' (list): list of str servers that this endpoint is at
+ params_map (dict): see below key value pairs
+ 'all' (list): list of str endpoint parameter names
+ 'required' (list): list of required parameter names
+ 'nullable' (list): list of nullable parameter names
+ 'enum' (list): list of parameters with enum values
+ 'validation' (list): list of parameters with validations
+ root_map
+ 'validations' (dict): the dict mapping endpoint parameter tuple
+ paths to their validation dictionaries
+ 'allowed_values' (dict): the dict mapping endpoint parameter
+ tuple paths to their allowed_values (enum) dictionaries
+ 'openapi_types' (dict): param_name to openapi type
+ 'attribute_map' (dict): param_name to camelCase name
+ 'location_map' (dict): param_name to 'body', 'file', 'form',
+ 'header', 'path', 'query'
+ collection_format_map (dict): param_name to `csv` etc.
+ headers_map (dict): see below key value pairs
+ 'accept' (list): list of Accept header strings
+ 'content_type' (list): list of Content-Type header strings
+ api_client (ApiClient) api client instance
+ callable (function): the function which is invoked when the
+ Endpoint is called
"""
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- headers[auth_setting['key']] = auth_setting['value']
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
-
- def __deserialize_file(self, response):
- """Deserializes body to file
-
- Saves response body into a file in a temporary folder,
- using the filename from the `Content-Disposition` header if provided.
+ self.settings = settings
+ self.params_map = params_map
+ self.params_map['all'].extend([
+ 'async_req',
+ '_host_index',
+ '_preload_content',
+ '_request_timeout',
+ '_return_http_data_only',
+ '_check_input_type',
+ '_check_return_type'
+ ])
+ self.params_map['nullable'].extend(['_request_timeout'])
+ self.validations = root_map['validations']
+ self.allowed_values = root_map['allowed_values']
+ self.openapi_types = root_map['openapi_types']
+ extra_types = {
+ 'async_req': (bool,),
+ '_host_index': (none_type, int),
+ '_preload_content': (bool,),
+ '_request_timeout': (none_type, int, (int,), [int]),
+ '_return_http_data_only': (bool,),
+ '_check_input_type': (bool,),
+ '_check_return_type': (bool,)
+ }
+ self.openapi_types.update(extra_types)
+ self.attribute_map = root_map['attribute_map']
+ self.location_map = root_map['location_map']
+ self.collection_format_map = root_map['collection_format_map']
+ self.headers_map = headers_map
+ self.api_client = api_client
+ self.callable = callable
+
+ def __validate_inputs(self, kwargs):
+ for param in self.params_map['enum']:
+ if param in kwargs:
+ check_allowed_values(
+ self.allowed_values,
+ (param,),
+ kwargs[param]
+ )
- :param response: RESTResponse.
- :return: file path.
- """
- fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
- os.close(fd)
- os.remove(path)
+ for param in self.params_map['validation']:
+ if param in kwargs:
+ check_validations(
+ self.validations,
+ (param,),
+ kwargs[param],
+ configuration=self.api_client.configuration
+ )
- content_disposition = response.getheader("Content-Disposition")
- if content_disposition:
- filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
- content_disposition).group(1)
- path = os.path.join(os.path.dirname(path), filename)
+ if kwargs['_check_input_type'] is False:
+ return
- with open(path, "wb") as f:
- f.write(response.data)
+ for key, value in kwargs.items():
+ fixed_val = validate_and_convert_types(
+ value,
+ self.openapi_types[key],
+ [key],
+ False,
+ kwargs['_check_input_type'],
+ configuration=self.api_client.configuration
+ )
+ kwargs[key] = fixed_val
+
+ def __gather_params(self, kwargs):
+ params = {
+ 'body': None,
+ 'collection_format': {},
+ 'file': {},
+ 'form': [],
+ 'header': {},
+ 'path': {},
+ 'query': []
+ }
+
+ for param_name, param_value in kwargs.items():
+ param_location = self.location_map.get(param_name)
+ if param_location is None:
+ continue
+ if param_location:
+ if param_location == 'body':
+ params['body'] = param_value
+ continue
+ base_name = self.attribute_map[param_name]
+ if (param_location == 'form' and
+ self.openapi_types[param_name] == (file_type,)):
+ params['file'][param_name] = [param_value]
+ elif (param_location == 'form' and
+ self.openapi_types[param_name] == ([file_type],)):
+ # param_value is already a list
+ params['file'][param_name] = param_value
+ elif param_location in {'form', 'query'}:
+ param_value_full = (base_name, param_value)
+ params[param_location].append(param_value_full)
+ if param_location not in {'form', 'query'}:
+ params[param_location][base_name] = param_value
+ collection_format = self.collection_format_map.get(param_name)
+ if collection_format:
+ params['collection_format'][base_name] = collection_format
- return path
+ return params
- def __deserialize_primitive(self, data, klass):
- """Deserializes string to primitive type.
+ def __call__(self, *args, **kwargs):
+ """ This method is invoked when endpoints are called
+ Example:
- :param data: str.
- :param klass: class literal.
+ api_instance = AnotherFakeApi()
+ api_instance.call_123_test_special_tags # this is an instance of the class Endpoint
+ api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__()
+ which then invokes the callable functions stored in that endpoint at
+ api_instance.call_123_test_special_tags.callable or self.callable in this class
- :return: int, long, float, str, bool.
"""
- try:
- return klass(data)
- except UnicodeEncodeError:
- return six.text_type(data)
- except TypeError:
- return data
+ return self.callable(self, *args, **kwargs)
- def __deserialize_object(self, value):
- """Return an original value.
-
- :return: object.
- """
- return value
+ def call_with_http_info(self, **kwargs):
- def __deserialize_date(self, string):
- """Deserializes string to date.
-
- :param string: str.
- :return: date.
- """
try:
- return parse(string).date()
- except ImportError:
- return string
- except ValueError:
- raise rest.ApiException(
- status=0,
- reason="Failed to parse `{0}` as date object".format(string)
+ index = self.api_client.configuration.server_operation_index.get(
+ self.settings['operation_id'], self.api_client.configuration.server_index
+ ) if kwargs['_host_index'] is None else kwargs['_host_index']
+ server_variables = self.api_client.configuration.server_operation_variables.get(
+ self.settings['operation_id'], self.api_client.configuration.server_variables
)
-
- def __deserialize_datetime(self, string):
- """Deserializes string to datetime.
-
- The string should be in iso8601 datetime format.
-
- :param string: str.
- :return: datetime.
- """
- try:
- return parse(string)
- except ImportError:
- return string
- except ValueError:
- raise rest.ApiException(
- status=0,
- reason=(
- "Failed to parse `{0}` as datetime object"
- .format(string)
- )
+ _host = self.api_client.configuration.get_host_from_settings(
+ index, variables=server_variables, servers=self.settings['servers']
)
+ except IndexError:
+ if self.settings['servers']:
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s" %
+ len(self.settings['servers'])
+ )
+ _host = None
+
+ for key, value in kwargs.items():
+ if key not in self.params_map['all']:
+ raise ApiTypeError(
+ "Got an unexpected parameter '%s'"
+ " to method `%s`" %
+ (key, self.settings['operation_id'])
+ )
+ # only throw this nullable ApiValueError if _check_input_type
+ # is False, if _check_input_type==True we catch this case
+ # in self.__validate_inputs
+ if (key not in self.params_map['nullable'] and value is None
+ and kwargs['_check_input_type'] is False):
+ raise ApiValueError(
+ "Value may not be None for non-nullable parameter `%s`"
+ " when calling `%s`" %
+ (key, self.settings['operation_id'])
+ )
- def __deserialize_model(self, data, klass):
- """Deserializes list or dict to model.
+ for key in self.params_map['required']:
+ if key not in kwargs.keys():
+ raise ApiValueError(
+ "Missing the required parameter `%s` when calling "
+ "`%s`" % (key, self.settings['operation_id'])
+ )
- :param data: dict, list.
- :param klass: class literal.
- :return: model object.
- """
- has_discriminator = False
- if (hasattr(klass, 'get_real_child_model')
- and klass.discriminator_value_class_map):
- has_discriminator = True
-
- if not klass.openapi_types and has_discriminator is False:
- return data
-
- kwargs = {}
- if (data is not None and
- klass.openapi_types is not None and
- isinstance(data, (list, dict))):
- for attr, attr_type in six.iteritems(klass.openapi_types):
- if klass.attribute_map[attr] in data:
- value = data[klass.attribute_map[attr]]
- kwargs[attr] = self.__deserialize(value, attr_type)
-
- instance = klass(**kwargs)
-
- if has_discriminator:
- klass_name = instance.get_real_child_model(data)
- if klass_name:
- instance = self.__deserialize(data, klass_name)
- return instance
+ self.__validate_inputs(kwargs)
+
+ params = self.__gather_params(kwargs)
+
+ accept_headers_list = self.headers_map['accept']
+ if accept_headers_list:
+ params['header']['Accept'] = self.api_client.select_header_accept(
+ accept_headers_list)
+
+ content_type_headers_list = self.headers_map['content_type']
+ if content_type_headers_list:
+ header_list = self.api_client.select_header_content_type(
+ content_type_headers_list)
+ params['header']['Content-Type'] = header_list
+
+ return self.api_client.call_api(
+ self.settings['endpoint_path'], self.settings['http_method'],
+ params['path'],
+ params['query'],
+ params['header'],
+ body=params['body'],
+ post_params=params['form'],
+ files=params['file'],
+ response_type=self.settings['response_type'],
+ auth_settings=self.settings['auth'],
+ async_req=kwargs['async_req'],
+ _check_type=kwargs['_check_return_type'],
+ _return_http_data_only=kwargs['_return_http_data_only'],
+ _preload_content=kwargs['_preload_content'],
+ _request_timeout=kwargs['_request_timeout'],
+ _host=_host,
+ collection_formats=params['collection_format'])
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py
rename to samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py
index f6d116438da4..ca58bb0fc100 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py
@@ -10,16 +10,13 @@
"""
-from __future__ import absolute_import
-
import copy
import logging
import multiprocessing
import sys
import urllib3
-import six
-from six.moves import http_client as httplib
+from http import client as http_client
from petstore_api.exceptions import ApiValueError
@@ -277,9 +274,8 @@ def __init__(self, host=None,
# Enable client side validation
self.client_side_validation = True
+ # Options to pass down to the underlying urllib3 socket
self.socket_options = None
- """Options to pass down to the underlying urllib3 socket
- """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -362,7 +358,7 @@ def logger_file(self, value):
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
@@ -384,17 +380,17 @@ def debug(self, value):
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
- # turn on httplib debug
- httplib.HTTPConnection.debuglevel = 1
+ # turn on http_client debug
+ http_client.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
- # turn off httplib debug
- httplib.HTTPConnection.debuglevel = 0
+ # turn off http_client debug
+ http_client.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
@@ -560,10 +556,6 @@ def get_host_settings(self):
]
}
}
- },
- {
- 'url': "https://127.0.0.1/no_varaible",
- 'description': "The local server without variables",
}
]
diff --git a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py
index 08181d4775db..fecd2081b818 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py
@@ -10,8 +10,6 @@
"""
-import six
-
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -128,35 +126,11 @@ def __str__(self):
return error_message
-class NotFoundException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(NotFoundException, self).__init__(status, reason, http_resp)
-
-
-class UnauthorizedException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(UnauthorizedException, self).__init__(status, reason, http_resp)
-
-
-class ForbiddenException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(ForbiddenException, self).__init__(status, reason, http_resp)
-
-
-class ServiceException(ApiException):
-
- def __init__(self, status=None, reason=None, http_resp=None):
- super(ServiceException, self).__init__(status, reason, http_resp)
-
-
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, six.integer_types):
+ if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/__init__.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python/petstore_api/model/address.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/address.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/animal.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/api_response.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/apple.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/array_test.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/banana.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/cat.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python/petstore_api/model/category.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/category.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/class_model.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python/petstore_api/model/client.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/client.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/dog.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/drawing.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python/petstore_api/model/file.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/file.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/foo.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/format_test.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/fruit.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_object.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object1.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_object1.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object2.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_object2.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object3.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_object3.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object4.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_object4.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object5.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_object5.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py b/samples/openapi3/client/petstore/python/petstore_api/model/list.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/list.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/mammal.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/map_test.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/model_return.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python/petstore_api/model/name.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/name.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/number_only.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python/petstore_api/model/order.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/order.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/pet.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/pig.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/shape.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/some_object.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/tag.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python/petstore_api/model/user.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/user.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/whale.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py
rename to samples/openapi3/client/petstore/python/petstore_api/model/zebra.py
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py
rename to samples/openapi3/client/petstore/python/petstore_api/model_utils.py
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py
index f11ff62b2ee2..248531dac14f 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py
@@ -1,65 +1,104 @@
# coding: utf-8
# flake8: noqa
-"""
- OpenAPI Petstore
- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
+# import all models into this package
+# if you have many models here with many references from one model to another this may
+# raise a RecursionError
+# to avoid this, import only the models that you directly need like:
+# from from petstore_api.model.pet import Pet
+# or import this package, but before doing it, use:
+# import sys
+# sys.setrecursionlimit(n)
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-
-# import models into model package
-from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
-from petstore_api.models.animal import Animal
-from petstore_api.models.api_response import ApiResponse
-from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
-from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
-from petstore_api.models.array_test import ArrayTest
-from petstore_api.models.capitalization import Capitalization
-from petstore_api.models.cat import Cat
-from petstore_api.models.cat_all_of import CatAllOf
-from petstore_api.models.category import Category
-from petstore_api.models.class_model import ClassModel
-from petstore_api.models.client import Client
-from petstore_api.models.dog import Dog
-from petstore_api.models.dog_all_of import DogAllOf
-from petstore_api.models.enum_arrays import EnumArrays
-from petstore_api.models.enum_class import EnumClass
-from petstore_api.models.enum_test import EnumTest
-from petstore_api.models.file import File
-from petstore_api.models.file_schema_test_class import FileSchemaTestClass
-from petstore_api.models.foo import Foo
-from petstore_api.models.format_test import FormatTest
-from petstore_api.models.has_only_read_only import HasOnlyReadOnly
-from petstore_api.models.health_check_result import HealthCheckResult
-from petstore_api.models.inline_object import InlineObject
-from petstore_api.models.inline_object1 import InlineObject1
-from petstore_api.models.inline_object2 import InlineObject2
-from petstore_api.models.inline_object3 import InlineObject3
-from petstore_api.models.inline_object4 import InlineObject4
-from petstore_api.models.inline_object5 import InlineObject5
-from petstore_api.models.inline_response_default import InlineResponseDefault
-from petstore_api.models.list import List
-from petstore_api.models.map_test import MapTest
-from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
-from petstore_api.models.model200_response import Model200Response
-from petstore_api.models.model_return import ModelReturn
-from petstore_api.models.name import Name
-from petstore_api.models.nullable_class import NullableClass
-from petstore_api.models.number_only import NumberOnly
-from petstore_api.models.order import Order
-from petstore_api.models.outer_composite import OuterComposite
-from petstore_api.models.outer_enum import OuterEnum
-from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
-from petstore_api.models.outer_enum_integer import OuterEnumInteger
-from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
-from petstore_api.models.pet import Pet
-from petstore_api.models.read_only_first import ReadOnlyFirst
-from petstore_api.models.special_model_name import SpecialModelName
-from petstore_api.models.tag import Tag
-from petstore_api.models.user import User
+from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
+from petstore_api.model.address import Address
+from petstore_api.model.animal import Animal
+from petstore_api.model.animal_farm import AnimalFarm
+from petstore_api.model.api_response import ApiResponse
+from petstore_api.model.apple import Apple
+from petstore_api.model.apple_req import AppleReq
+from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.model.array_of_enums import ArrayOfEnums
+from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.model.array_test import ArrayTest
+from petstore_api.model.banana import Banana
+from petstore_api.model.banana_req import BananaReq
+from petstore_api.model.basque_pig import BasquePig
+from petstore_api.model.capitalization import Capitalization
+from petstore_api.model.cat import Cat
+from petstore_api.model.cat_all_of import CatAllOf
+from petstore_api.model.category import Category
+from petstore_api.model.child_cat import ChildCat
+from petstore_api.model.child_cat_all_of import ChildCatAllOf
+from petstore_api.model.class_model import ClassModel
+from petstore_api.model.client import Client
+from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral
+from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations
+from petstore_api.model.danish_pig import DanishPig
+from petstore_api.model.dog import Dog
+from petstore_api.model.dog_all_of import DogAllOf
+from petstore_api.model.drawing import Drawing
+from petstore_api.model.enum_arrays import EnumArrays
+from petstore_api.model.enum_class import EnumClass
+from petstore_api.model.enum_test import EnumTest
+from petstore_api.model.equilateral_triangle import EquilateralTriangle
+from petstore_api.model.file import File
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
+from petstore_api.model.foo import Foo
+from petstore_api.model.format_test import FormatTest
+from petstore_api.model.fruit import Fruit
+from petstore_api.model.fruit_req import FruitReq
+from petstore_api.model.gm_fruit import GmFruit
+from petstore_api.model.grandparent_animal import GrandparentAnimal
+from petstore_api.model.has_only_read_only import HasOnlyReadOnly
+from petstore_api.model.health_check_result import HealthCheckResult
+from petstore_api.model.inline_object import InlineObject
+from petstore_api.model.inline_object1 import InlineObject1
+from petstore_api.model.inline_object2 import InlineObject2
+from petstore_api.model.inline_object3 import InlineObject3
+from petstore_api.model.inline_object4 import InlineObject4
+from petstore_api.model.inline_object5 import InlineObject5
+from petstore_api.model.inline_response_default import InlineResponseDefault
+from petstore_api.model.integer_enum import IntegerEnum
+from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue
+from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue
+from petstore_api.model.isosceles_triangle import IsoscelesTriangle
+from petstore_api.model.list import List
+from petstore_api.model.mammal import Mammal
+from petstore_api.model.map_test import MapTest
+from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.model.model200_response import Model200Response
+from petstore_api.model.model_return import ModelReturn
+from petstore_api.model.name import Name
+from petstore_api.model.nullable_class import NullableClass
+from petstore_api.model.nullable_shape import NullableShape
+from petstore_api.model.number_only import NumberOnly
+from petstore_api.model.number_with_validations import NumberWithValidations
+from petstore_api.model.object_interface import ObjectInterface
+from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
+from petstore_api.model.object_with_validations import ObjectWithValidations
+from petstore_api.model.order import Order
+from petstore_api.model.parent_pet import ParentPet
+from petstore_api.model.pet import Pet
+from petstore_api.model.pig import Pig
+from petstore_api.model.quadrilateral import Quadrilateral
+from petstore_api.model.quadrilateral_interface import QuadrilateralInterface
+from petstore_api.model.read_only_first import ReadOnlyFirst
+from petstore_api.model.scalene_triangle import ScaleneTriangle
+from petstore_api.model.shape import Shape
+from petstore_api.model.shape_interface import ShapeInterface
+from petstore_api.model.shape_or_null import ShapeOrNull
+from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral
+from petstore_api.model.some_object import SomeObject
+from petstore_api.model.special_model_name import SpecialModelName
+from petstore_api.model.string_boolean_map import StringBooleanMap
+from petstore_api.model.string_enum import StringEnum
+from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue
+from petstore_api.model.tag import Tag
+from petstore_api.model.triangle import Triangle
+from petstore_api.model.triangle_interface import TriangleInterface
+from petstore_api.model.user import User
+from petstore_api.model.whale import Whale
+from petstore_api.model.zebra import Zebra
diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py
index 17e85148bb30..9537cea6b1af 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/rest.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py
@@ -10,21 +10,17 @@
"""
-from __future__ import absolute_import
-
import io
import json
import logging
import re
import ssl
+from urllib.parse import urlencode
import certifi
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import urlencode
import urllib3
-from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
+from petstore_api.exceptions import ApiException, ApiValueError
logger = logging.getLogger(__name__)
@@ -144,7 +140,7 @@ def request(self, method, url, query_params=None, headers=None,
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
+ if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
@@ -224,18 +220,6 @@ def request(self, method, url, query_params=None, headers=None,
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
- if r.status == 401:
- raise UnauthorizedException(http_resp=r)
-
- if r.status == 403:
- raise ForbiddenException(http_resp=r)
-
- if r.status == 404:
- raise NotFoundException(http_resp=r)
-
- if 500 <= r.status <= 599:
- raise ServiceException(http_resp=r)
-
raise ApiException(http_resp=r)
return r
diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python/petstore_api/signing.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py
rename to samples/openapi3/client/petstore/python/petstore_api/signing.py
diff --git a/samples/openapi3/client/petstore/python/pom.xml b/samples/openapi3/client/petstore/python/pom.xml
index 98955483eb8f..c2364c744828 100644
--- a/samples/openapi3/client/petstore/python/pom.xml
+++ b/samples/openapi3/client/petstore/python/pom.xml
@@ -1,10 +1,10 @@
4.0.0
org.openapitools
- PythonOAS3PetstoreTests
+ PythonExperimentalOAS3PetstoreTests
pom
1.0-SNAPSHOT
- Python OpenAPI3 Petstore Client
+ Python-Experimental OpenAPI3 Petstore Client
@@ -35,7 +35,7 @@
make
- test-all
+ test
diff --git a/samples/openapi3/client/petstore/python/requirements.txt b/samples/openapi3/client/petstore/python/requirements.txt
index eb358efd5bd3..2c2f00fcb27b 100644
--- a/samples/openapi3/client/petstore/python/requirements.txt
+++ b/samples/openapi3/client/petstore/python/requirements.txt
@@ -1,6 +1,5 @@
+nulltype
certifi >= 14.05.14
-future; python_version<="2.7"
-six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py
index 2a3ca48e06ba..71641535bf53 100644
--- a/samples/openapi3/client/petstore/python/setup.py
+++ b/samples/openapi3/client/petstore/python/setup.py
@@ -21,7 +21,14 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
+REQUIRES = [
+ "urllib3 >= 1.15",
+ "certifi",
+ "python-dateutil",
+ "nulltype",
+ "pem>=19.3.0",
+ "pycryptodome>=3.9.0",
+]
setup(
name=NAME,
@@ -31,6 +38,7 @@
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
+ python_requires=">=3.5",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
diff --git a/samples/openapi3/client/petstore/python/test-requirements.txt b/samples/openapi3/client/petstore/python/test-requirements.txt
index 4ed3991cbec1..36d9b4fa7a8c 100644
--- a/samples/openapi3/client/petstore/python/test-requirements.txt
+++ b/samples/openapi3/client/petstore/python/test-requirements.txt
@@ -1,3 +1,4 @@
-pytest~=4.6.7 # needed for python 2.7+3.4
+pytest~=4.6.7 # needed for python 3.4
pytest-cov>=2.8.1
-pytest-randomly==1.2.3 # needed for python 2.7+3.4
+pytest-randomly==1.2.3 # needed for python 3.4
+pycryptodome>=3.9.0
diff --git a/samples/openapi3/client/petstore/python/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/test_additional_properties_class.py
index fc9df3bbb505..42fdf1948736 100644
--- a/samples/openapi3/client/petstore/python/test/test_additional_properties_class.py
+++ b/samples/openapi3/client/petstore/python/test/test_additional_properties_class.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.additional_properties_class import AdditionalPropertiesClass
class TestAdditionalPropertiesClass(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testAdditionalPropertiesClass(self):
"""Test AdditionalPropertiesClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
+ # model = AdditionalPropertiesClass() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/test/test_additional_properties_with_array_of_enums.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py
rename to samples/openapi3/client/petstore/python/test/test_additional_properties_with_array_of_enums.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_address.py b/samples/openapi3/client/petstore/python/test/test_address.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_address.py
rename to samples/openapi3/client/petstore/python/test/test_address.py
diff --git a/samples/openapi3/client/petstore/python/test/test_animal.py b/samples/openapi3/client/petstore/python/test/test_animal.py
index 179f1fbd0e52..a35e4c3469e4 100644
--- a/samples/openapi3/client/petstore/python/test/test_animal.py
+++ b/samples/openapi3/client/petstore/python/test/test_animal.py
@@ -5,18 +5,20 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.animal import Animal # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.cat import Cat
+from petstore_api.model.dog import Dog
+globals()['Cat'] = Cat
+globals()['Dog'] = Dog
+from petstore_api.model.animal import Animal
class TestAnimal(unittest.TestCase):
@@ -31,7 +33,7 @@ def tearDown(self):
def testAnimal(self):
"""Test Animal"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.animal.Animal() # noqa: E501
+ # model = Animal() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py b/samples/openapi3/client/petstore/python/test/test_animal_farm.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py
rename to samples/openapi3/client/petstore/python/test/test_animal_farm.py
diff --git a/samples/openapi3/client/petstore/python/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python/test/test_another_fake_api.py
index cbaac584faff..c58dfa6202bc 100644
--- a/samples/openapi3/client/petstore/python/test/test_another_fake_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_another_fake_api.py
@@ -5,25 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
-from petstore_api.rest import ApiException
class TestAnotherFakeApi(unittest.TestCase):
"""AnotherFakeApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
+ self.api = AnotherFakeApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_api_response.py b/samples/openapi3/client/petstore/python/test/test_api_response.py
index 5031b458a0db..a9a900c29cfa 100644
--- a/samples/openapi3/client/petstore/python/test/test_api_response.py
+++ b/samples/openapi3/client/petstore/python/test/test_api_response.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.api_response import ApiResponse # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.api_response import ApiResponse
class TestApiResponse(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testApiResponse(self):
"""Test ApiResponse"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
+ # model = ApiResponse() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py b/samples/openapi3/client/petstore/python/test/test_apple.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_apple.py
rename to samples/openapi3/client/petstore/python/test/test_apple.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py b/samples/openapi3/client/petstore/python/test/test_apple_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py
rename to samples/openapi3/client/petstore/python/test/test_apple_req.py
diff --git a/samples/openapi3/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/test_array_of_array_of_number_only.py
index a02233045421..39f8874a4e81 100644
--- a/samples/openapi3/client/petstore/python/test/test_array_of_array_of_number_only.py
+++ b/samples/openapi3/client/petstore/python/test/test_array_of_array_of_number_only.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testArrayOfArrayOfNumberOnly(self):
"""Test ArrayOfArrayOfNumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
+ # model = ArrayOfArrayOfNumberOnly() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python/test/test_array_of_enums.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py
rename to samples/openapi3/client/petstore/python/test/test_array_of_enums.py
diff --git a/samples/openapi3/client/petstore/python/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/test_array_of_number_only.py
index 1a928bf7d2e0..c4abfd068614 100644
--- a/samples/openapi3/client/petstore/python/test/test_array_of_number_only.py
+++ b/samples/openapi3/client/petstore/python/test/test_array_of_number_only.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.array_of_number_only import ArrayOfNumberOnly
class TestArrayOfNumberOnly(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testArrayOfNumberOnly(self):
"""Test ArrayOfNumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
+ # model = ArrayOfNumberOnly() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_array_test.py b/samples/openapi3/client/petstore/python/test/test_array_test.py
index c56b77b77ee3..19042d9c461d 100644
--- a/samples/openapi3/client/petstore/python/test/test_array_test.py
+++ b/samples/openapi3/client/petstore/python/test/test_array_test.py
@@ -5,18 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.array_test import ArrayTest # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.read_only_first import ReadOnlyFirst
+globals()['ReadOnlyFirst'] = ReadOnlyFirst
+from petstore_api.model.array_test import ArrayTest
class TestArrayTest(unittest.TestCase):
@@ -31,7 +31,7 @@ def tearDown(self):
def testArrayTest(self):
"""Test ArrayTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
+ # model = ArrayTest() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py b/samples/openapi3/client/petstore/python/test/test_banana.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_banana.py
rename to samples/openapi3/client/petstore/python/test/test_banana.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py b/samples/openapi3/client/petstore/python/test/test_banana_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py
rename to samples/openapi3/client/petstore/python/test/test_banana_req.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py b/samples/openapi3/client/petstore/python/test/test_basque_pig.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py
rename to samples/openapi3/client/petstore/python/test/test_basque_pig.py
diff --git a/samples/openapi3/client/petstore/python/test/test_capitalization.py b/samples/openapi3/client/petstore/python/test/test_capitalization.py
index 2ae7725b3f09..5f47ddb4db09 100644
--- a/samples/openapi3/client/petstore/python/test/test_capitalization.py
+++ b/samples/openapi3/client/petstore/python/test/test_capitalization.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.capitalization import Capitalization # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.capitalization import Capitalization
class TestCapitalization(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testCapitalization(self):
"""Test Capitalization"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
+ # model = Capitalization() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_cat.py b/samples/openapi3/client/petstore/python/test/test_cat.py
index 5ebd7908d2db..9008ab8f9a92 100644
--- a/samples/openapi3/client/petstore/python/test/test_cat.py
+++ b/samples/openapi3/client/petstore/python/test/test_cat.py
@@ -5,18 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.cat import Cat # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.address import Address
+from petstore_api.model.animal import Animal
+from petstore_api.model.cat_all_of import CatAllOf
+globals()['Address'] = Address
+globals()['Animal'] = Animal
+globals()['CatAllOf'] = CatAllOf
+from petstore_api.model.cat import Cat
class TestCat(unittest.TestCase):
@@ -31,7 +35,7 @@ def tearDown(self):
def testCat(self):
"""Test Cat"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.cat.Cat() # noqa: E501
+ # model = Cat() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python/test/test_cat_all_of.py
index 531443380c6e..3d5a33d9907b 100644
--- a/samples/openapi3/client/petstore/python/test/test_cat_all_of.py
+++ b/samples/openapi3/client/petstore/python/test/test_cat_all_of.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.cat_all_of import CatAllOf # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.cat_all_of import CatAllOf
class TestCatAllOf(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testCatAllOf(self):
"""Test CatAllOf"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501
+ # model = CatAllOf() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_category.py b/samples/openapi3/client/petstore/python/test/test_category.py
index 6a592521281e..29490e0dbdb1 100644
--- a/samples/openapi3/client/petstore/python/test/test_category.py
+++ b/samples/openapi3/client/petstore/python/test/test_category.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.category import Category # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.category import Category
class TestCategory(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testCategory(self):
"""Test Category"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.category.Category() # noqa: E501
+ # model = Category() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py b/samples/openapi3/client/petstore/python/test/test_child_cat.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py
rename to samples/openapi3/client/petstore/python/test/test_child_cat.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/openapi3/client/petstore/python/test/test_child_cat_all_of.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py
rename to samples/openapi3/client/petstore/python/test/test_child_cat_all_of.py
diff --git a/samples/openapi3/client/petstore/python/test/test_class_model.py b/samples/openapi3/client/petstore/python/test/test_class_model.py
index 12b7fb99402e..6dc2a6928321 100644
--- a/samples/openapi3/client/petstore/python/test/test_class_model.py
+++ b/samples/openapi3/client/petstore/python/test/test_class_model.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.class_model import ClassModel # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.class_model import ClassModel
class TestClassModel(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testClassModel(self):
"""Test ClassModel"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.class_model.ClassModel() # noqa: E501
+ # model = ClassModel() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_client.py b/samples/openapi3/client/petstore/python/test/test_client.py
index 9e18c4310d96..caf85a24aa27 100644
--- a/samples/openapi3/client/petstore/python/test/test_client.py
+++ b/samples/openapi3/client/petstore/python/test/test_client.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.client import Client # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.client import Client
class TestClient(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testClient(self):
"""Test Client"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.client.Client() # noqa: E501
+ # model = Client() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_complex_quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py
rename to samples/openapi3/client/petstore/python/test/test_complex_quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/test/test_composed_one_of_number_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py
rename to samples/openapi3/client/petstore/python/test/test_composed_one_of_number_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py b/samples/openapi3/client/petstore/python/test/test_danish_pig.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py
rename to samples/openapi3/client/petstore/python/test/test_danish_pig.py
diff --git a/samples/openapi3/client/petstore/python/test/test_default_api.py b/samples/openapi3/client/petstore/python/test/test_default_api.py
index 88bbfc6c8d36..caf174d6d4ba 100644
--- a/samples/openapi3/client/petstore/python/test/test_default_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_default_api.py
@@ -5,25 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.default_api import DefaultApi # noqa: E501
-from petstore_api.rest import ApiException
class TestDefaultApi(unittest.TestCase):
"""DefaultApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
+ self.api = DefaultApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_dog.py b/samples/openapi3/client/petstore/python/test/test_dog.py
index dc151f998ddd..cfd84be56688 100644
--- a/samples/openapi3/client/petstore/python/test/test_dog.py
+++ b/samples/openapi3/client/petstore/python/test/test_dog.py
@@ -5,18 +5,20 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.dog import Dog # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.animal import Animal
+from petstore_api.model.dog_all_of import DogAllOf
+globals()['Animal'] = Animal
+globals()['DogAllOf'] = DogAllOf
+from petstore_api.model.dog import Dog
class TestDog(unittest.TestCase):
@@ -31,7 +33,7 @@ def tearDown(self):
def testDog(self):
"""Test Dog"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.dog.Dog() # noqa: E501
+ # model = Dog() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python/test/test_dog_all_of.py
index 3d79f2888c96..9f5075b7ed71 100644
--- a/samples/openapi3/client/petstore/python/test/test_dog_all_of.py
+++ b/samples/openapi3/client/petstore/python/test/test_dog_all_of.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.dog_all_of import DogAllOf # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.dog_all_of import DogAllOf
class TestDogAllOf(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testDogAllOf(self):
"""Test DogAllOf"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501
+ # model = DogAllOf() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python/test/test_drawing.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_drawing.py
rename to samples/openapi3/client/petstore/python/test/test_drawing.py
diff --git a/samples/openapi3/client/petstore/python/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python/test/test_enum_arrays.py
index be572508ef22..9458d918a604 100644
--- a/samples/openapi3/client/petstore/python/test/test_enum_arrays.py
+++ b/samples/openapi3/client/petstore/python/test/test_enum_arrays.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.enum_arrays import EnumArrays
class TestEnumArrays(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testEnumArrays(self):
"""Test EnumArrays"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
+ # model = EnumArrays() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_enum_class.py b/samples/openapi3/client/petstore/python/test/test_enum_class.py
index 57eb14558a7d..ed19c7985d4e 100644
--- a/samples/openapi3/client/petstore/python/test/test_enum_class.py
+++ b/samples/openapi3/client/petstore/python/test/test_enum_class.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.enum_class import EnumClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.enum_class import EnumClass
class TestEnumClass(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testEnumClass(self):
"""Test EnumClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.enum_class.EnumClass() # noqa: E501
+ # model = EnumClass() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_enum_test.py b/samples/openapi3/client/petstore/python/test/test_enum_test.py
index ecd43afc709d..7b0599f5a987 100644
--- a/samples/openapi3/client/petstore/python/test/test_enum_test.py
+++ b/samples/openapi3/client/petstore/python/test/test_enum_test.py
@@ -5,18 +5,26 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.enum_test import EnumTest # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.integer_enum import IntegerEnum
+from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue
+from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue
+from petstore_api.model.string_enum import StringEnum
+from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue
+globals()['IntegerEnum'] = IntegerEnum
+globals()['IntegerEnumOneValue'] = IntegerEnumOneValue
+globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue
+globals()['StringEnum'] = StringEnum
+globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue
+from petstore_api.model.enum_test import EnumTest
class TestEnumTest(unittest.TestCase):
@@ -31,7 +39,7 @@ def tearDown(self):
def testEnumTest(self):
"""Test EnumTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
+ # model = EnumTest() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python/test/test_equilateral_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py
rename to samples/openapi3/client/petstore/python/test/test_equilateral_triangle.py
diff --git a/samples/openapi3/client/petstore/python/test/test_fake_api.py b/samples/openapi3/client/petstore/python/test/test_fake_api.py
index fa14dc2247d0..48230221f42e 100644
--- a/samples/openapi3/client/petstore/python/test/test_fake_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_fake_api.py
@@ -5,49 +5,85 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
-from petstore_api.rest import ApiException
class TestFakeApi(unittest.TestCase):
"""FakeApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
+ self.api = FakeApi() # noqa: E501
def tearDown(self):
pass
- def test_fake_outer_boolean_serialize(self):
- """Test case for fake_outer_boolean_serialize
+ def test_additional_properties_with_array_of_enums(self):
+ """Test case for additional_properties_with_array_of_enums
+
+ Additional Properties with Array of Enums # noqa: E501
+ """
+ pass
+
+ def test_array_model(self):
+ """Test case for array_model
"""
pass
- def test_fake_outer_composite_serialize(self):
- """Test case for fake_outer_composite_serialize
+ def test_array_of_enums(self):
+ """Test case for array_of_enums
+ Array of Enums # noqa: E501
"""
pass
- def test_fake_outer_number_serialize(self):
- """Test case for fake_outer_number_serialize
+ def test_boolean(self):
+ """Test case for boolean
"""
pass
- def test_fake_outer_string_serialize(self):
- """Test case for fake_outer_string_serialize
+ def test_composed_one_of_number_with_validations(self):
+ """Test case for composed_one_of_number_with_validations
+
+ """
+ pass
+
+ def test_fake_health_get(self):
+ """Test case for fake_health_get
+
+ Health check endpoint # noqa: E501
+ """
+ pass
+
+ def test_number_with_validations(self):
+ """Test case for number_with_validations
+
+ """
+ pass
+
+ def test_object_model_with_ref_props(self):
+ """Test case for object_model_with_ref_props
+
+ """
+ pass
+
+ def test_string(self):
+ """Test case for string
+
+ """
+ pass
+
+ def test_string_enum(self):
+ """Test case for string_enum
"""
pass
@@ -106,6 +142,12 @@ def test_test_json_form_data(self):
"""
pass
+ def test_test_query_parameter_collection_format(self):
+ """Test case for test_query_parameter_collection_format
+
+ """
+ pass
+
if __name__ == '__main__':
unittest.main()
diff --git a/samples/openapi3/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/test/test_fake_classname_tags_123_api.py
index 87cac0b9ef85..b7724aaed7d1 100644
--- a/samples/openapi3/client/petstore/python/test/test_fake_classname_tags_123_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_fake_classname_tags_123_api.py
@@ -5,25 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
-from petstore_api.rest import ApiException
class TestFakeClassnameTags123Api(unittest.TestCase):
"""FakeClassnameTags123Api unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
+ self.api = FakeClassnameTags123Api() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_file.py b/samples/openapi3/client/petstore/python/test/test_file.py
index cc32edb7b523..438482f39525 100644
--- a/samples/openapi3/client/petstore/python/test/test_file.py
+++ b/samples/openapi3/client/petstore/python/test/test_file.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.file import File # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.file import File
class TestFile(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testFile(self):
"""Test File"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.file.File() # noqa: E501
+ # model = File() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python/test/test_file_schema_test_class.py
index 91e1b6a1c745..6366cd33470c 100644
--- a/samples/openapi3/client/petstore/python/test/test_file_schema_test_class.py
+++ b/samples/openapi3/client/petstore/python/test/test_file_schema_test_class.py
@@ -5,18 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.file import File
+globals()['File'] = File
+from petstore_api.model.file_schema_test_class import FileSchemaTestClass
class TestFileSchemaTestClass(unittest.TestCase):
@@ -31,7 +31,7 @@ def tearDown(self):
def testFileSchemaTestClass(self):
"""Test FileSchemaTestClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
+ # model = FileSchemaTestClass() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_foo.py b/samples/openapi3/client/petstore/python/test/test_foo.py
index 8d986975233a..648a84c66f7c 100644
--- a/samples/openapi3/client/petstore/python/test/test_foo.py
+++ b/samples/openapi3/client/petstore/python/test/test_foo.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.foo import Foo # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.foo import Foo
class TestFoo(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testFoo(self):
"""Test Foo"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.foo.Foo() # noqa: E501
+ # model = Foo() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_format_test.py b/samples/openapi3/client/petstore/python/test/test_format_test.py
index 46707c77b708..a5441cec1c97 100644
--- a/samples/openapi3/client/petstore/python/test/test_format_test.py
+++ b/samples/openapi3/client/petstore/python/test/test_format_test.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.format_test import FormatTest # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.format_test import FormatTest
class TestFormatTest(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testFormatTest(self):
"""Test FormatTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.format_test.FormatTest() # noqa: E501
+ # model = FormatTest() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py b/samples/openapi3/client/petstore/python/test/test_fruit.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_fruit.py
rename to samples/openapi3/client/petstore/python/test/test_fruit.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py b/samples/openapi3/client/petstore/python/test/test_fruit_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py
rename to samples/openapi3/client/petstore/python/test/test_fruit_req.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py b/samples/openapi3/client/petstore/python/test/test_gm_fruit.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py
rename to samples/openapi3/client/petstore/python/test/test_gm_fruit.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/openapi3/client/petstore/python/test/test_grandparent_animal.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py
rename to samples/openapi3/client/petstore/python/test/test_grandparent_animal.py
diff --git a/samples/openapi3/client/petstore/python/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python/test/test_has_only_read_only.py
index 2dc052a328a0..c9bf4c28658a 100644
--- a/samples/openapi3/client/petstore/python/test/test_has_only_read_only.py
+++ b/samples/openapi3/client/petstore/python/test/test_has_only_read_only.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.has_only_read_only import HasOnlyReadOnly
class TestHasOnlyReadOnly(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testHasOnlyReadOnly(self):
"""Test HasOnlyReadOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
+ # model = HasOnlyReadOnly() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_health_check_result.py b/samples/openapi3/client/petstore/python/test/test_health_check_result.py
index c98be1e8cbc4..35f4d3afa989 100644
--- a/samples/openapi3/client/petstore/python/test/test_health_check_result.py
+++ b/samples/openapi3/client/petstore/python/test/test_health_check_result.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.health_check_result import HealthCheckResult
class TestHealthCheckResult(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testHealthCheckResult(self):
"""Test HealthCheckResult"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
+ # model = HealthCheckResult() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object.py b/samples/openapi3/client/petstore/python/test/test_inline_object.py
index 451ced9747e1..3e391022d516 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_object.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_object.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_object import InlineObject # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.inline_object import InlineObject
class TestInlineObject(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testInlineObject(self):
"""Test InlineObject"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_object.InlineObject() # noqa: E501
+ # model = InlineObject() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object1.py b/samples/openapi3/client/petstore/python/test/test_inline_object1.py
index 456bb7149949..982e20e0c6f4 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_object1.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_object1.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_object1 import InlineObject1 # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.inline_object1 import InlineObject1
class TestInlineObject1(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testInlineObject1(self):
"""Test InlineObject1"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_object1.InlineObject1() # noqa: E501
+ # model = InlineObject1() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object2.py b/samples/openapi3/client/petstore/python/test/test_inline_object2.py
index 5850ea434410..133e31acb200 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_object2.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_object2.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_object2 import InlineObject2 # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.inline_object2 import InlineObject2
class TestInlineObject2(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testInlineObject2(self):
"""Test InlineObject2"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_object2.InlineObject2() # noqa: E501
+ # model = InlineObject2() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object3.py b/samples/openapi3/client/petstore/python/test/test_inline_object3.py
index e134a4f1c125..69bf17c56c2d 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_object3.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_object3.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_object3 import InlineObject3 # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.inline_object3 import InlineObject3
class TestInlineObject3(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testInlineObject3(self):
"""Test InlineObject3"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_object3.InlineObject3() # noqa: E501
+ # model = InlineObject3() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object4.py b/samples/openapi3/client/petstore/python/test/test_inline_object4.py
index ced0099fd677..727596be5e5d 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_object4.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_object4.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_object4 import InlineObject4 # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.inline_object4 import InlineObject4
class TestInlineObject4(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testInlineObject4(self):
"""Test InlineObject4"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_object4.InlineObject4() # noqa: E501
+ # model = InlineObject4() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object5.py b/samples/openapi3/client/petstore/python/test/test_inline_object5.py
index 2351766ca132..1ef579b8e307 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_object5.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_object5.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_object5 import InlineObject5 # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.inline_object5 import InlineObject5
class TestInlineObject5(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testInlineObject5(self):
"""Test InlineObject5"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_object5.InlineObject5() # noqa: E501
+ # model = InlineObject5() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python/test/test_inline_response_default.py
index 4d49ddb66bcd..3b3fc2ddcdf7 100644
--- a/samples/openapi3/client/petstore/python/test/test_inline_response_default.py
+++ b/samples/openapi3/client/petstore/python/test/test_inline_response_default.py
@@ -5,18 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.inline_response_default import InlineResponseDefault # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.foo import Foo
+globals()['Foo'] = Foo
+from petstore_api.model.inline_response_default import InlineResponseDefault
class TestInlineResponseDefault(unittest.TestCase):
@@ -31,7 +31,7 @@ def tearDown(self):
def testInlineResponseDefault(self):
"""Test InlineResponseDefault"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.inline_response_default.InlineResponseDefault() # noqa: E501
+ # model = InlineResponseDefault() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py b/samples/openapi3/client/petstore/python/test/test_integer_enum.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py
rename to samples/openapi3/client/petstore/python/test/test_integer_enum.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/test/test_integer_enum_one_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py
rename to samples/openapi3/client/petstore/python/test/test_integer_enum_one_value.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/test_integer_enum_with_default_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py
rename to samples/openapi3/client/petstore/python/test/test_integer_enum_with_default_value.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python/test/test_isosceles_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py
rename to samples/openapi3/client/petstore/python/test/test_isosceles_triangle.py
diff --git a/samples/openapi3/client/petstore/python/test/test_list.py b/samples/openapi3/client/petstore/python/test/test_list.py
index a538a6b1ad36..77611c300dc8 100644
--- a/samples/openapi3/client/petstore/python/test/test_list.py
+++ b/samples/openapi3/client/petstore/python/test/test_list.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.list import List # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.list import List
class TestList(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testList(self):
"""Test List"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.list.List() # noqa: E501
+ # model = List() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py b/samples/openapi3/client/petstore/python/test/test_mammal.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_mammal.py
rename to samples/openapi3/client/petstore/python/test/test_mammal.py
diff --git a/samples/openapi3/client/petstore/python/test/test_map_test.py b/samples/openapi3/client/petstore/python/test/test_map_test.py
index 0ba6481903e6..9cddd802e56e 100644
--- a/samples/openapi3/client/petstore/python/test/test_map_test.py
+++ b/samples/openapi3/client/petstore/python/test/test_map_test.py
@@ -5,18 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.map_test import MapTest # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.string_boolean_map import StringBooleanMap
+globals()['StringBooleanMap'] = StringBooleanMap
+from petstore_api.model.map_test import MapTest
class TestMapTest(unittest.TestCase):
@@ -31,7 +31,7 @@ def tearDown(self):
def testMapTest(self):
"""Test MapTest"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.map_test.MapTest() # noqa: E501
+ # model = MapTest() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py
index 8893bdaf44ee..60b774977965 100644
--- a/samples/openapi3/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py
+++ b/samples/openapi3/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py
@@ -5,18 +5,18 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.animal import Animal
+globals()['Animal'] = Animal
+from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
@@ -31,7 +31,7 @@ def tearDown(self):
def testMixedPropertiesAndAdditionalPropertiesClass(self):
"""Test MixedPropertiesAndAdditionalPropertiesClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
+ # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_model200_response.py b/samples/openapi3/client/petstore/python/test/test_model200_response.py
index fab761f4edba..8ff474d5dde3 100644
--- a/samples/openapi3/client/petstore/python/test/test_model200_response.py
+++ b/samples/openapi3/client/petstore/python/test/test_model200_response.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.model200_response import Model200Response # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.model200_response import Model200Response
class TestModel200Response(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testModel200Response(self):
"""Test Model200Response"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.model200_response.Model200Response() # noqa: E501
+ # model = Model200Response() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_model_return.py b/samples/openapi3/client/petstore/python/test/test_model_return.py
index ae3f15ee6b83..f856d3d76206 100644
--- a/samples/openapi3/client/petstore/python/test/test_model_return.py
+++ b/samples/openapi3/client/petstore/python/test/test_model_return.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.model_return import ModelReturn # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.model_return import ModelReturn
class TestModelReturn(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testModelReturn(self):
"""Test ModelReturn"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.model_return.ModelReturn() # noqa: E501
+ # model = ModelReturn() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_name.py b/samples/openapi3/client/petstore/python/test/test_name.py
index d6c72563991f..b3841ca0304f 100644
--- a/samples/openapi3/client/petstore/python/test/test_name.py
+++ b/samples/openapi3/client/petstore/python/test/test_name.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.name import Name # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.name import Name
class TestName(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testName(self):
"""Test Name"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.name.Name() # noqa: E501
+ # model = Name() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_nullable_class.py b/samples/openapi3/client/petstore/python/test/test_nullable_class.py
index 0e95c9b2c09a..730e9264ef9d 100644
--- a/samples/openapi3/client/petstore/python/test/test_nullable_class.py
+++ b/samples/openapi3/client/petstore/python/test/test_nullable_class.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.nullable_class import NullableClass # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.nullable_class import NullableClass
class TestNullableClass(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testNullableClass(self):
"""Test NullableClass"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
+ # model = NullableClass() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py b/samples/openapi3/client/petstore/python/test/test_nullable_shape.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py
rename to samples/openapi3/client/petstore/python/test/test_nullable_shape.py
diff --git a/samples/openapi3/client/petstore/python/test/test_number_only.py b/samples/openapi3/client/petstore/python/test/test_number_only.py
index 7f6df65c8058..b7205f5fe029 100644
--- a/samples/openapi3/client/petstore/python/test/test_number_only.py
+++ b/samples/openapi3/client/petstore/python/test/test_number_only.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.number_only import NumberOnly # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.number_only import NumberOnly
class TestNumberOnly(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testNumberOnly(self):
"""Test NumberOnly"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.number_only.NumberOnly() # noqa: E501
+ # model = NumberOnly() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python/test/test_number_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py
rename to samples/openapi3/client/petstore/python/test/test_number_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py b/samples/openapi3/client/petstore/python/test/test_object_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py
rename to samples/openapi3/client/petstore/python/test/test_object_interface.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/test/test_object_model_with_ref_props.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py
rename to samples/openapi3/client/petstore/python/test/test_object_model_with_ref_props.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py b/samples/openapi3/client/petstore/python/test/test_object_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py
rename to samples/openapi3/client/petstore/python/test/test_object_with_validations.py
diff --git a/samples/openapi3/client/petstore/python/test/test_order.py b/samples/openapi3/client/petstore/python/test/test_order.py
index 3e7d517d5c79..fd420b846a74 100644
--- a/samples/openapi3/client/petstore/python/test/test_order.py
+++ b/samples/openapi3/client/petstore/python/test/test_order.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.order import Order # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.order import Order
class TestOrder(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testOrder(self):
"""Test Order"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.order.Order() # noqa: E501
+ # model = Order() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py b/samples/openapi3/client/petstore/python/test/test_parent_pet.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py
rename to samples/openapi3/client/petstore/python/test/test_parent_pet.py
diff --git a/samples/openapi3/client/petstore/python/test/test_pet.py b/samples/openapi3/client/petstore/python/test/test_pet.py
index bc5cc30fac0d..0d77e022738b 100644
--- a/samples/openapi3/client/petstore/python/test/test_pet.py
+++ b/samples/openapi3/client/petstore/python/test/test_pet.py
@@ -5,18 +5,20 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.pet import Pet # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.category import Category
+from petstore_api.model.tag import Tag
+globals()['Category'] = Category
+globals()['Tag'] = Tag
+from petstore_api.model.pet import Pet
class TestPet(unittest.TestCase):
@@ -31,7 +33,7 @@ def tearDown(self):
def testPet(self):
"""Test Pet"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.pet.Pet() # noqa: E501
+ # model = Pet() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_pet_api.py b/samples/openapi3/client/petstore/python/test/test_pet_api.py
index c4437f6217a9..d545f497297a 100644
--- a/samples/openapi3/client/petstore/python/test/test_pet_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_pet_api.py
@@ -5,25 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.pet_api import PetApi # noqa: E501
-from petstore_api.rest import ApiException
class TestPetApi(unittest.TestCase):
"""PetApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
+ self.api = PetApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py b/samples/openapi3/client/petstore/python/test/test_pig.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_pig.py
rename to samples/openapi3/client/petstore/python/test/test_pig.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py
rename to samples/openapi3/client/petstore/python/test/test_quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python/test/test_quadrilateral_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py
rename to samples/openapi3/client/petstore/python/test/test_quadrilateral_interface.py
diff --git a/samples/openapi3/client/petstore/python/test/test_read_only_first.py b/samples/openapi3/client/petstore/python/test/test_read_only_first.py
index 2b647b83fc89..a07676e9c2de 100644
--- a/samples/openapi3/client/petstore/python/test/test_read_only_first.py
+++ b/samples/openapi3/client/petstore/python/test/test_read_only_first.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.read_only_first import ReadOnlyFirst
class TestReadOnlyFirst(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testReadOnlyFirst(self):
"""Test ReadOnlyFirst"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
+ # model = ReadOnlyFirst() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py b/samples/openapi3/client/petstore/python/test/test_scalene_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py
rename to samples/openapi3/client/petstore/python/test/test_scalene_triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py b/samples/openapi3/client/petstore/python/test/test_shape.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_shape.py
rename to samples/openapi3/client/petstore/python/test/test_shape.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py b/samples/openapi3/client/petstore/python/test/test_shape_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py
rename to samples/openapi3/client/petstore/python/test/test_shape_interface.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py b/samples/openapi3/client/petstore/python/test/test_shape_or_null.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py
rename to samples/openapi3/client/petstore/python/test/test_shape_or_null.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_simple_quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py
rename to samples/openapi3/client/petstore/python/test/test_simple_quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py b/samples/openapi3/client/petstore/python/test/test_some_object.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_some_object.py
rename to samples/openapi3/client/petstore/python/test/test_some_object.py
diff --git a/samples/openapi3/client/petstore/python/test/test_special_model_name.py b/samples/openapi3/client/petstore/python/test/test_special_model_name.py
index 4edfec164f7d..4c525d99be5b 100644
--- a/samples/openapi3/client/petstore/python/test/test_special_model_name.py
+++ b/samples/openapi3/client/petstore/python/test/test_special_model_name.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.special_model_name import SpecialModelName
class TestSpecialModelName(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testSpecialModelName(self):
"""Test SpecialModelName"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
+ # model = SpecialModelName() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_store_api.py b/samples/openapi3/client/petstore/python/test/test_store_api.py
index 37bf771d13a6..3680a34b42a0 100644
--- a/samples/openapi3/client/petstore/python/test/test_store_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_store_api.py
@@ -5,25 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.store_api import StoreApi # noqa: E501
-from petstore_api.rest import ApiException
class TestStoreApi(unittest.TestCase):
"""StoreApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
+ self.api = StoreApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python/test/test_string_boolean_map.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py
rename to samples/openapi3/client/petstore/python/test/test_string_boolean_map.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py b/samples/openapi3/client/petstore/python/test/test_string_enum.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py
rename to samples/openapi3/client/petstore/python/test/test_string_enum.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/test_string_enum_with_default_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py
rename to samples/openapi3/client/petstore/python/test/test_string_enum_with_default_value.py
diff --git a/samples/openapi3/client/petstore/python/test/test_tag.py b/samples/openapi3/client/petstore/python/test/test_tag.py
index 2c3c5157e718..0ce1c0a87f1d 100644
--- a/samples/openapi3/client/petstore/python/test/test_tag.py
+++ b/samples/openapi3/client/petstore/python/test/test_tag.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.tag import Tag # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.tag import Tag
class TestTag(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testTag(self):
"""Test Tag"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.tag.Tag() # noqa: E501
+ # model = Tag() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py b/samples/openapi3/client/petstore/python/test/test_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_triangle.py
rename to samples/openapi3/client/petstore/python/test/test_triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py b/samples/openapi3/client/petstore/python/test/test_triangle_interface.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py
rename to samples/openapi3/client/petstore/python/test/test_triangle_interface.py
diff --git a/samples/openapi3/client/petstore/python/test/test_user.py b/samples/openapi3/client/petstore/python/test/test_user.py
index ad9386b6908e..df3d2fff6532 100644
--- a/samples/openapi3/client/petstore/python/test/test_user.py
+++ b/samples/openapi3/client/petstore/python/test/test_user.py
@@ -5,18 +5,16 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
+import sys
import unittest
import petstore_api
-from petstore_api.models.user import User # noqa: E501
-from petstore_api.rest import ApiException
+from petstore_api.model.user import User
class TestUser(unittest.TestCase):
@@ -31,7 +29,7 @@ def tearDown(self):
def testUser(self):
"""Test User"""
# FIXME: construct object with mandatory attributes with example values
- # model = petstore_api.models.user.User() # noqa: E501
+ # model = User() # noqa: E501
pass
diff --git a/samples/openapi3/client/petstore/python/test/test_user_api.py b/samples/openapi3/client/petstore/python/test/test_user_api.py
index 6e8aed4f18c7..abf57b0733da 100644
--- a/samples/openapi3/client/petstore/python/test/test_user_api.py
+++ b/samples/openapi3/client/petstore/python/test/test_user_api.py
@@ -5,25 +5,22 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
- OpenAPI spec version: 1.0.0
+ The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
-from __future__ import absolute_import
-
import unittest
import petstore_api
from petstore_api.api.user_api import UserApi # noqa: E501
-from petstore_api.rest import ApiException
class TestUserApi(unittest.TestCase):
"""UserApi unit test stubs"""
def setUp(self):
- self.api = petstore_api.api.user_api.UserApi() # noqa: E501
+ self.api = UserApi() # noqa: E501
def tearDown(self):
pass
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py b/samples/openapi3/client/petstore/python/test/test_whale.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_whale.py
rename to samples/openapi3/client/petstore/python/test/test_whale.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py b/samples/openapi3/client/petstore/python/test/test_zebra.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test/test_zebra.py
rename to samples/openapi3/client/petstore/python/test/test_zebra.py
diff --git a/samples/openapi3/client/petstore/python-experimental/test_python.sh b/samples/openapi3/client/petstore/python/test_python.sh
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/test_python.sh
rename to samples/openapi3/client/petstore/python/test_python.sh
diff --git a/samples/openapi3/client/petstore/python/tests_manual/__init__.py b/samples/openapi3/client/petstore/python/tests_manual/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_api_validation.py b/samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_api_validation.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_number_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_number_with_validations.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_number_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_drawing.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py b/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_fruit.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_mammal.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_shape.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py b/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py
rename to samples/openapi3/client/petstore/python/tests_manual/test_triangle.py
diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/util.py b/samples/openapi3/client/petstore/python/tests_manual/util.py
similarity index 100%
rename from samples/openapi3/client/petstore/python-experimental/tests_manual/util.py
rename to samples/openapi3/client/petstore/python/tests_manual/util.py
diff --git a/samples/openapi3/client/petstore/python/tox.ini b/samples/openapi3/client/petstore/python/tox.ini
index 169d895329bf..8989fc3c4d96 100644
--- a/samples/openapi3/client/petstore/python/tox.ini
+++ b/samples/openapi3/client/petstore/python/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27, py3
+envlist = py3
[testenv]
deps=-r{toxinidir}/requirements.txt
diff --git a/shippable.yml b/shippable.yml
index d4d3659585e3..e3caac860c1e 100644
--- a/shippable.yml
+++ b/shippable.yml
@@ -1,7 +1,7 @@
language: java
jdk:
-- openjdk10
+- openjdk11
build:
cache: true
@@ -12,7 +12,7 @@ build:
ci:
# fix shippable apt-get errors
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 23E7166788B63E1E 6A030B21BA07F4FB 4B8EC3BAABDC4346 EB3E94ADBE1229CF 960B2B2623A0BD5D 6B05F25D762E3157
- - rm /etc/apt/sources.list.d/jonathonf-ubuntu-backports-xenial.list
+ #- rm /etc/apt/sources.list.d/jonathonf-ubuntu-backports-xenial.list
- rm /etc/apt/sources.list.d/basho_riak.list
#
- java -version
diff --git a/website/i18n/en.json b/website/i18n/en.json
index 89b5ad427b6c..8f1c9b64db2c 100644
--- a/website/i18n/en.json
+++ b/website/i18n/en.json
@@ -419,9 +419,9 @@
"title": "Config Options for python-blueplanet",
"sidebar_label": "python-blueplanet"
},
- "generators/python-experimental": {
- "title": "Config Options for python-experimental",
- "sidebar_label": "python-experimental"
+ "generators/python-legacy": {
+ "title": "Config Options for python-legacy",
+ "sidebar_label": "python-legacy"
},
"generators/python-flask": {
"title": "Config Options for python-flask",