mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 20:20:53 +00:00
[python-experimental] generate model if type != object if enums/validations exist (#2757)
* Python-experimental adds model_utils module, refactors python api class * Fixes python-experimental so the sample sare generated in the petstore_api folder * FIxes python samples tests * Updates python and python-experimental tests * Fixes python-experimental tests * Adds newlines back to python templates + samples * Reverts files with newline tweaks back to master branch versions * Fixes indentation errors in python-experimental api_client * Removes unused files * Python files now generated in correct folders * Adds logging when the user tries to set generateAliasAsModel in python-experimental * Fixes typo
This commit is contained in:
parent
002da8d9f9
commit
252c3e58be
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental -DpackageName=petstore_api $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental --additional-properties packageName=petstore_api $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -2493,6 +2493,76 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
return responses.get(code);
|
return responses.get(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set op's returnBaseType, returnType, examples etc.
|
||||||
|
*
|
||||||
|
* @param operation endpoint Operation
|
||||||
|
* @param schemas a map of the schemas in the openapi spec
|
||||||
|
* @param op endpoint CodegenOperation
|
||||||
|
* @param methodResponse the default ApiResponse for the endpoint
|
||||||
|
*/
|
||||||
|
protected void handleMethodResponse(Operation operation,
|
||||||
|
Map<String, Schema> schemas,
|
||||||
|
CodegenOperation op,
|
||||||
|
ApiResponse methodResponse) {
|
||||||
|
Schema responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(methodResponse));
|
||||||
|
|
||||||
|
if (responseSchema != null) {
|
||||||
|
CodegenProperty cm = fromProperty("response", responseSchema);
|
||||||
|
|
||||||
|
if (ModelUtils.isArraySchema(responseSchema)) {
|
||||||
|
ArraySchema as = (ArraySchema) responseSchema;
|
||||||
|
CodegenProperty innerProperty = fromProperty("response", getSchemaItems(as));
|
||||||
|
op.returnBaseType = innerProperty.baseType;
|
||||||
|
} else if (ModelUtils.isMapSchema(responseSchema)) {
|
||||||
|
CodegenProperty innerProperty = fromProperty("response", ModelUtils.getAdditionalProperties(responseSchema));
|
||||||
|
op.returnBaseType = innerProperty.baseType;
|
||||||
|
} else {
|
||||||
|
if (cm.complexType != null) {
|
||||||
|
op.returnBaseType = cm.complexType;
|
||||||
|
} else {
|
||||||
|
op.returnBaseType = cm.baseType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// generate examples
|
||||||
|
String exampleStatusCode = "200";
|
||||||
|
for (String key : operation.getResponses().keySet()) {
|
||||||
|
if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) {
|
||||||
|
exampleStatusCode = key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation));
|
||||||
|
op.defaultResponse = toDefaultValue(responseSchema);
|
||||||
|
op.returnType = cm.dataType;
|
||||||
|
op.hasReference = schemas.containsKey(op.returnBaseType);
|
||||||
|
|
||||||
|
// lookup discriminator
|
||||||
|
Schema schema = schemas.get(op.returnBaseType);
|
||||||
|
if (schema != null) {
|
||||||
|
CodegenModel cmod = fromModel(op.returnBaseType, schema);
|
||||||
|
op.discriminator = cmod.discriminator;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cm.isContainer) {
|
||||||
|
op.returnContainer = cm.containerType;
|
||||||
|
if ("map".equals(cm.containerType)) {
|
||||||
|
op.isMapContainer = true;
|
||||||
|
} else if ("list".equalsIgnoreCase(cm.containerType)) {
|
||||||
|
op.isListContainer = true;
|
||||||
|
} else if ("array".equalsIgnoreCase(cm.containerType)) {
|
||||||
|
op.isListContainer = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
op.returnSimpleType = true;
|
||||||
|
}
|
||||||
|
if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) {
|
||||||
|
op.returnTypeIsPrimitive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addHeaders(methodResponse, op.responseHeaders);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert OAS Operation object to Codegen Operation object
|
* Convert OAS Operation object to Codegen Operation object
|
||||||
*
|
*
|
||||||
@ -2585,62 +2655,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
op.responses.get(op.responses.size() - 1).hasMore = false;
|
op.responses.get(op.responses.size() - 1).hasMore = false;
|
||||||
|
|
||||||
if (methodResponse != null) {
|
if (methodResponse != null) {
|
||||||
Schema responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(methodResponse));
|
handleMethodResponse(operation, schemas, op, methodResponse);
|
||||||
|
|
||||||
if (responseSchema != null) {
|
|
||||||
CodegenProperty cm = fromProperty("response", responseSchema);
|
|
||||||
|
|
||||||
if (ModelUtils.isArraySchema(responseSchema)) {
|
|
||||||
ArraySchema as = (ArraySchema) responseSchema;
|
|
||||||
CodegenProperty innerProperty = fromProperty("response", getSchemaItems(as));
|
|
||||||
op.returnBaseType = innerProperty.baseType;
|
|
||||||
} else if (ModelUtils.isMapSchema(responseSchema)) {
|
|
||||||
CodegenProperty innerProperty = fromProperty("response", ModelUtils.getAdditionalProperties(responseSchema));
|
|
||||||
op.returnBaseType = innerProperty.baseType;
|
|
||||||
} else {
|
|
||||||
if (cm.complexType != null) {
|
|
||||||
op.returnBaseType = cm.complexType;
|
|
||||||
} else {
|
|
||||||
op.returnBaseType = cm.baseType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// generate examples
|
|
||||||
String exampleStatusCode = "200";
|
|
||||||
for (String key : operation.getResponses().keySet()) {
|
|
||||||
if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) {
|
|
||||||
exampleStatusCode = key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation));
|
|
||||||
op.defaultResponse = toDefaultValue(responseSchema);
|
|
||||||
op.returnType = cm.dataType;
|
|
||||||
op.hasReference = schemas.containsKey(op.returnBaseType);
|
|
||||||
|
|
||||||
// lookup discriminator
|
|
||||||
Schema schema = schemas.get(op.returnBaseType);
|
|
||||||
if (schema != null) {
|
|
||||||
CodegenModel cmod = fromModel(op.returnBaseType, schema);
|
|
||||||
op.discriminator = cmod.discriminator;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cm.isContainer) {
|
|
||||||
op.returnContainer = cm.containerType;
|
|
||||||
if ("map".equals(cm.containerType)) {
|
|
||||||
op.isMapContainer = true;
|
|
||||||
} else if ("list".equalsIgnoreCase(cm.containerType)) {
|
|
||||||
op.isListContainer = true;
|
|
||||||
} else if ("array".equalsIgnoreCase(cm.containerType)) {
|
|
||||||
op.isListContainer = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
op.returnSimpleType = true;
|
|
||||||
}
|
|
||||||
if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) {
|
|
||||||
op.returnTypeIsPrimitive = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
addHeaders(methodResponse, op.responseHeaders);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3511,7 +3526,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
* @param response API response
|
* @param response API response
|
||||||
* @param properties list of codegen property
|
* @param properties list of codegen property
|
||||||
*/
|
*/
|
||||||
private void addHeaders(ApiResponse response, List<CodegenProperty> properties) {
|
protected void addHeaders(ApiResponse response, List<CodegenProperty> properties) {
|
||||||
if (response.getHeaders() != null) {
|
if (response.getHeaders() != null) {
|
||||||
for (Map.Entry<String, Header> headerEntry : response.getHeaders().entrySet()) {
|
for (Map.Entry<String, Header> headerEntry : response.getHeaders().entrySet()) {
|
||||||
String description = headerEntry.getValue().getDescription();
|
String description = headerEntry.getValue().getDescription();
|
||||||
@ -4316,7 +4331,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateEnumVarsWithExtensions(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions) {
|
protected void updateEnumVarsWithExtensions(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions) {
|
||||||
if (vendorExtensions != null) {
|
if (vendorExtensions != null) {
|
||||||
updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-varnames", "name");
|
updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-varnames", "name");
|
||||||
updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-descriptions", "enumDescription");
|
updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-descriptions", "enumDescription");
|
||||||
|
@ -490,10 +490,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
|
|
||||||
// TODO revise below as we've already performed unaliasing so that the isAlias check may be removed
|
// TODO revise below as we've already performed unaliasing so that the isAlias check may be removed
|
||||||
Map<String, Object> modelTemplate = (Map<String, Object>) ((List<Object>) models.get("models")).get(0);
|
Map<String, Object> modelTemplate = (Map<String, Object>) ((List<Object>) models.get("models")).get(0);
|
||||||
// Special handling of aliases only applies to Java
|
|
||||||
if (modelTemplate != null && modelTemplate.containsKey("model")) {
|
if (modelTemplate != null && modelTemplate.containsKey("model")) {
|
||||||
CodegenModel m = (CodegenModel) modelTemplate.get("model");
|
CodegenModel m = (CodegenModel) modelTemplate.get("model");
|
||||||
if (m.isAlias) {
|
if (m.isAlias && !ModelUtils.isGenerateAliasAsModel()) {
|
||||||
continue; // Don't create user-defined classes for aliases
|
continue; // Don't create user-defined classes for aliases
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,31 +16,50 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import java.text.SimpleDateFormat;
|
import io.swagger.v3.oas.models.examples.Example;
|
||||||
|
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.responses.ApiResponse;
|
||||||
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.openapitools.codegen.*;
|
||||||
|
import org.openapitools.codegen.examples.ExampleGenerator;
|
||||||
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||||
import org.openapitools.codegen.meta.Stability;
|
import org.openapitools.codegen.meta.Stability;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import java.text.DateFormat;
|
||||||
import org.openapitools.codegen.*;
|
import java.text.SimpleDateFormat;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
import java.io.File;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
|
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||||
|
|
||||||
public class PythonClientExperimentalCodegen extends PythonClientCodegen {
|
public class PythonClientExperimentalCodegen extends PythonClientCodegen {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientExperimentalCodegen.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientExperimentalCodegen.class);
|
||||||
|
|
||||||
public PythonClientExperimentalCodegen() {
|
public PythonClientExperimentalCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py"));
|
apiTemplateFiles.remove("api.mustache");
|
||||||
apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md");
|
|
||||||
apiTemplateFiles.put("python-experimental/api.mustache", ".py");
|
apiTemplateFiles.put("python-experimental/api.mustache", ".py");
|
||||||
|
|
||||||
|
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||||
|
apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md");
|
||||||
|
|
||||||
|
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||||
modelDocTemplateFiles.put("python-experimental/model_doc.mustache", ".md");
|
modelDocTemplateFiles.put("python-experimental/model_doc.mustache", ".md");
|
||||||
|
|
||||||
|
modelTemplateFiles.remove("model.mustache");
|
||||||
modelTemplateFiles.put("python-experimental/model.mustache", ".py");
|
modelTemplateFiles.put("python-experimental/model.mustache", ".py");
|
||||||
|
|
||||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||||
@ -48,6 +67,23 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processOpts() {
|
||||||
|
super.processOpts();
|
||||||
|
|
||||||
|
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"));
|
||||||
|
|
||||||
|
// default this to true so the python ModelSimple models will be generated
|
||||||
|
ModelUtils.setGenerateAliasAsModel(true);
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.GENERATE_ALIAS_AS_MODEL)) {
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures a friendly name for the generator. This will be used by the
|
* Configures a friendly name for the generator. This will be used by the
|
||||||
* generator to select the library with the -g flag.
|
* generator to select the library with the -g flag.
|
||||||
@ -162,4 +198,397 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
|
||||||
|
// add regex information to property
|
||||||
|
postProcessPattern(property.pattern, property.vendorExtensions);
|
||||||
|
}
|
||||||
|
|
||||||
|
// override with any special post-processing for all models
|
||||||
|
@SuppressWarnings({"static-method", "unchecked"})
|
||||||
|
public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
|
||||||
|
// loop through all models and delete ones where type!=object and the model has no validations and enums
|
||||||
|
// we will remove them because they are not needed
|
||||||
|
Map<String, Schema> modelSchemasToRemove = new HashMap<String, Schema>();
|
||||||
|
for (Map.Entry<String, Object> entry : objs.entrySet()) {
|
||||||
|
Map<String, Object> inner = (Map<String, Object>) entry.getValue();
|
||||||
|
List<Map<String, Object>> models = (List<Map<String, Object>>) inner.get("models");
|
||||||
|
for (Map<String, Object> mo : models) {
|
||||||
|
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||||
|
Schema modelSchema = ModelUtils.getSchema(this.openAPI, cm.name);
|
||||||
|
CodegenProperty modelProperty = fromProperty("value", modelSchema);
|
||||||
|
if (cm.isEnum || cm.isAlias) {
|
||||||
|
if (!modelProperty.isEnum && !modelProperty.hasValidation) {
|
||||||
|
// remove these models because they are aliases and do not have any enums or validations
|
||||||
|
modelSchemasToRemove.put(cm.name, modelSchema);
|
||||||
|
}
|
||||||
|
} else if (cm.isArrayModel && !modelProperty.isEnum && !modelProperty.hasValidation) {
|
||||||
|
// remove any ArrayModels which lack validation and enums
|
||||||
|
modelSchemasToRemove.put(cm.name, modelSchema);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove modelSchemasToRemove models from objs
|
||||||
|
for (String modelName : modelSchemasToRemove.keySet()) {
|
||||||
|
objs.remove(modelName);
|
||||||
|
}
|
||||||
|
return objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert OAS Property object to Codegen Property object
|
||||||
|
*
|
||||||
|
* @param name name of the property
|
||||||
|
* @param p OAS property object
|
||||||
|
* @return Codegen Property object
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CodegenProperty fromProperty(String name, Schema p) {
|
||||||
|
// we have a custom version of this function to always set allowableValues.enumVars on all enum variables
|
||||||
|
CodegenProperty result = super.fromProperty(name, p);
|
||||||
|
if (result.isEnum) {
|
||||||
|
updateCodegenPropertyEnum(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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<String, Object> allowableValues = var.allowableValues;
|
||||||
|
|
||||||
|
// handle array
|
||||||
|
if (var.mostInnerItems != null) {
|
||||||
|
allowableValues = var.mostInnerItems.allowableValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allowableValues == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Object> values = (List<Object>) allowableValues.get("values");
|
||||||
|
if (values == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType;
|
||||||
|
Optional<Schema> referencedSchema = ModelUtils.getSchemas(openAPI).entrySet().stream()
|
||||||
|
.filter(entry -> Objects.equals(varDataType, toModelName(entry.getKey())))
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.findFirst();
|
||||||
|
String dataType = (referencedSchema.isPresent()) ? getTypeDeclaration(referencedSchema.get()) : varDataType;
|
||||||
|
|
||||||
|
// put "enumVars" map into `allowableValues", including `name` and `value`
|
||||||
|
List<Map<String, Object>> enumVars = new ArrayList<>();
|
||||||
|
String commonPrefix = findCommonPrefixOfVars(values);
|
||||||
|
int truncateIdx = commonPrefix.length();
|
||||||
|
for (Object value : values) {
|
||||||
|
Map<String, Object> enumVar = new HashMap<>();
|
||||||
|
String enumName;
|
||||||
|
if (truncateIdx == 0) {
|
||||||
|
enumName = value.toString();
|
||||||
|
} else {
|
||||||
|
enumName = value.toString().substring(truncateIdx);
|
||||||
|
if ("".equals(enumName)) {
|
||||||
|
enumName = value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enumVar.put("name", toEnumVarName(enumName, dataType));
|
||||||
|
enumVar.put("value", toEnumValue(value.toString(), dataType));
|
||||||
|
enumVar.put("isString", isDataTypeString(dataType));
|
||||||
|
enumVars.add(enumVar);
|
||||||
|
}
|
||||||
|
// if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames
|
||||||
|
Map<String, Object> extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions();
|
||||||
|
if (referencedSchema.isPresent()) {
|
||||||
|
extensions = referencedSchema.get().getExtensions();
|
||||||
|
}
|
||||||
|
updateEnumVarsWithExtensions(enumVars, extensions);
|
||||||
|
allowableValues.put("enumVars", enumVars);
|
||||||
|
// overwriting defaultValue omitted from here
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodegenParameter fromRequestBody(RequestBody body, Set<String> imports, String bodyParameterName) {
|
||||||
|
CodegenParameter result = super.fromRequestBody(body, imports, bodyParameterName);
|
||||||
|
// if we generated a model with a non-object type because it has validations or enums,
|
||||||
|
// make sure that the datatype of that body parameter refers to our model class
|
||||||
|
Content content = body.getContent();
|
||||||
|
Set<String> keySet = content.keySet();
|
||||||
|
Object[] keyArray = (Object[]) keySet.toArray();
|
||||||
|
MediaType mediaType = content.get(keyArray[0]);
|
||||||
|
Schema schema = mediaType.getSchema();
|
||||||
|
String ref = schema.get$ref();
|
||||||
|
if (ref == null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String modelName = ModelUtils.getSimpleRef(ref);
|
||||||
|
// the result lacks validation info so we need to make a CodegenProperty from the schema to check
|
||||||
|
// if we have validation and enum info exists
|
||||||
|
Schema realSchema = ModelUtils.getSchema(this.openAPI, modelName);
|
||||||
|
CodegenProperty modelProp = fromProperty("body", realSchema);
|
||||||
|
if (modelProp.isPrimitiveType && (modelProp.hasValidation || modelProp.isEnum)) {
|
||||||
|
String simpleDataType = result.dataType;
|
||||||
|
result.isPrimitiveType = false;
|
||||||
|
result.isModel = true;
|
||||||
|
result.dataType = modelName;
|
||||||
|
imports.add(modelName);
|
||||||
|
// set the example value
|
||||||
|
if (modelProp.isEnum) {
|
||||||
|
String value = modelProp._enum.get(0).toString();
|
||||||
|
result.example = modelName + "(" + toEnumValue(value, simpleDataType) + ")";
|
||||||
|
} else {
|
||||||
|
result.example = modelName + "(" + result.example + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert OAS Response object to Codegen Response object
|
||||||
|
*
|
||||||
|
* @param responseCode HTTP response code
|
||||||
|
* @param response OAS Response object
|
||||||
|
* @return Codegen Response object
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CodegenResponse fromResponse(String responseCode, ApiResponse response) {
|
||||||
|
// if a response points at a model whose type != object and it has validations and/or enums, then we will
|
||||||
|
// generate the model, and the response.isModel must be changed to true and response.baseType must be the name
|
||||||
|
// of the model. Point responses at models if the model is python class type ModelSimple
|
||||||
|
// When we serialize/deserialize ModelSimple models, validations and enums will be checked.
|
||||||
|
Schema responseSchema;
|
||||||
|
if (this.openAPI != null && this.openAPI.getComponents() != null) {
|
||||||
|
responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(response));
|
||||||
|
} else { // no model/alias defined
|
||||||
|
responseSchema = ModelUtils.getSchemaFromResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
String newBaseType = null;
|
||||||
|
if (responseSchema != null) {
|
||||||
|
CodegenProperty cp = fromProperty("response", responseSchema);
|
||||||
|
if (cp.complexType != null) {
|
||||||
|
// check the referenced schema to see if it is an type=object model
|
||||||
|
Schema modelSchema = ModelUtils.getSchema(this.openAPI, cp.complexType);
|
||||||
|
if (modelSchema != null && !"object".equals(modelSchema.getType())) {
|
||||||
|
CodegenProperty modelProp = fromProperty("response", modelSchema);
|
||||||
|
if (modelProp.isEnum == true || modelProp.hasValidation == true) {
|
||||||
|
// this model has validations and/or enums so we will generate it
|
||||||
|
newBaseType = cp.complexType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (cp.isEnum == true || cp.hasValidation == true) {
|
||||||
|
// this model has validations and/or enums so we will generate it
|
||||||
|
Schema sc = ModelUtils.getSchemaFromResponse(response);
|
||||||
|
newBaseType = ModelUtils.getSimpleRef(sc.get$ref());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodegenResponse result = super.fromResponse(responseCode, response);
|
||||||
|
if (newBaseType != null) {
|
||||||
|
result.isModel = true;
|
||||||
|
result.baseType = newBaseType;
|
||||||
|
result.dataType = newBaseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set op's returnBaseType, returnType, examples etc.
|
||||||
|
*
|
||||||
|
* @param operation endpoint Operation
|
||||||
|
* @param schemas a map of the schemas in the openapi spec
|
||||||
|
* @param op endpoint CodegenOperation
|
||||||
|
* @param methodResponse the default ApiResponse for the endpoint
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void handleMethodResponse(Operation operation,
|
||||||
|
Map<String, Schema> schemas,
|
||||||
|
CodegenOperation op,
|
||||||
|
ApiResponse methodResponse) {
|
||||||
|
// we have a custom version of this method to handle endpoints that return models where
|
||||||
|
// type != object the model has validations and/or enums
|
||||||
|
// we do this by invoking our custom fromResponse method to create defaultResponse
|
||||||
|
// which we then use to set op.returnType and op.returnBaseType
|
||||||
|
CodegenResponse defaultResponse = fromResponse("defaultResponse", methodResponse);
|
||||||
|
Schema responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(methodResponse));
|
||||||
|
|
||||||
|
if (responseSchema != null) {
|
||||||
|
op.returnBaseType = defaultResponse.baseType;
|
||||||
|
|
||||||
|
// generate examples
|
||||||
|
String exampleStatusCode = "200";
|
||||||
|
for (String key : operation.getResponses().keySet()) {
|
||||||
|
if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) {
|
||||||
|
exampleStatusCode = key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation));
|
||||||
|
op.defaultResponse = toDefaultValue(responseSchema);
|
||||||
|
op.returnType = defaultResponse.dataType;
|
||||||
|
op.hasReference = schemas.containsKey(op.returnBaseType);
|
||||||
|
|
||||||
|
// lookup discriminator
|
||||||
|
Schema schema = schemas.get(op.returnBaseType);
|
||||||
|
if (schema != null) {
|
||||||
|
CodegenModel cmod = fromModel(op.returnBaseType, schema);
|
||||||
|
op.discriminator = cmod.discriminator;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defaultResponse.isListContainer) {
|
||||||
|
op.isListContainer = true;
|
||||||
|
} else if (defaultResponse.isMapContainer) {
|
||||||
|
op.isMapContainer = true;
|
||||||
|
} else {
|
||||||
|
op.returnSimpleType = true;
|
||||||
|
}
|
||||||
|
if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) {
|
||||||
|
op.returnTypeIsPrimitive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addHeaders(methodResponse, op.responseHeaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 "\"" + escapeText(value) + "\"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postProcessParameter(CodegenParameter parameter) {
|
||||||
|
postProcessPattern(parameter.pattern, parameter.vendorExtensions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert OAS Model object to Codegen Model object
|
||||||
|
*
|
||||||
|
* @param name the name of the model
|
||||||
|
* @param schema OAS Model object
|
||||||
|
* @return Codegen Model object
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CodegenModel fromModel(String name, Schema schema) {
|
||||||
|
// we have a custom version of this function so we can produce
|
||||||
|
// models for components whose type != object and which have validations and enums
|
||||||
|
// this ensures that endpoint (operation) responses with validations and enums
|
||||||
|
// will generate models, and when those endpoint responses are received in python
|
||||||
|
// the response is cast as a model, and the model will validate the response using the enums and validations
|
||||||
|
Map<String, String> propertyToModelName = new HashMap<String, String>();
|
||||||
|
Map<String, Schema> propertiesMap = schema.getProperties();
|
||||||
|
if (propertiesMap != null) {
|
||||||
|
for (Map.Entry<String, Schema> entry : propertiesMap.entrySet()) {
|
||||||
|
String schemaPropertyName = entry.getKey();
|
||||||
|
String pythonPropertyName = toVarName(schemaPropertyName);
|
||||||
|
Schema propertySchema = entry.getValue();
|
||||||
|
String ref = propertySchema.get$ref();
|
||||||
|
if (ref == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, propertySchema);
|
||||||
|
String refType = refSchema.getType();
|
||||||
|
if (refType == null || refType.equals("object")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
CodegenProperty modelProperty = fromProperty("_fake_name", refSchema);
|
||||||
|
if (modelProperty.isEnum == false && modelProperty.hasValidation == false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String modelName = ModelUtils.getSimpleRef(ref);
|
||||||
|
propertyToModelName.put(pythonPropertyName, modelName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodegenModel result = super.fromModel(name, schema);
|
||||||
|
|
||||||
|
// make non-object type models have one property so we can use it to store enums and validations
|
||||||
|
if (result.isAlias || result.isEnum) {
|
||||||
|
Schema modelSchema = ModelUtils.getSchema(this.openAPI, result.name);
|
||||||
|
CodegenProperty modelProperty = fromProperty("value", modelSchema);
|
||||||
|
if (modelProperty.isEnum == true || modelProperty.hasValidation == true) {
|
||||||
|
// these models are non-object models with enums and/or validations
|
||||||
|
// add a single property to the model so we can have a way to access validations
|
||||||
|
result.isAlias = true;
|
||||||
|
modelProperty.required = true;
|
||||||
|
List<CodegenProperty> theProperties = Arrays.asList(modelProperty);
|
||||||
|
result.setAllVars(theProperties);
|
||||||
|
result.setVars(theProperties);
|
||||||
|
result.setRequiredVars(theProperties);
|
||||||
|
// post process model properties
|
||||||
|
if (result.vars != null) {
|
||||||
|
for (CodegenProperty prop : result.vars) {
|
||||||
|
postProcessModelProperty(result, prop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return all models which don't need their properties connected to non-object models
|
||||||
|
if (propertyToModelName.isEmpty()) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// fix all property references to non-object models, make those properties non-primitive and
|
||||||
|
// set their dataType and complexType to the model name, so documentation will refer to the correct model
|
||||||
|
ArrayList<List<CodegenProperty>> listOfLists= new ArrayList<List<CodegenProperty>>();
|
||||||
|
listOfLists.add(result.vars);
|
||||||
|
listOfLists.add(result.allVars);
|
||||||
|
listOfLists.add(result.requiredVars);
|
||||||
|
listOfLists.add(result.optionalVars);
|
||||||
|
listOfLists.add(result.readOnlyVars);
|
||||||
|
listOfLists.add(result.readWriteVars);
|
||||||
|
for (List<CodegenProperty> cpList : listOfLists) {
|
||||||
|
for (CodegenProperty cp : cpList) {
|
||||||
|
if (!propertyToModelName.containsKey(cp.name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
cp.isPrimitiveType = false;
|
||||||
|
String modelName = propertyToModelName.get(cp.name);
|
||||||
|
cp.complexType = modelName;
|
||||||
|
cp.dataType = modelName;
|
||||||
|
cp.isEnum = false;
|
||||||
|
cp.hasValidation = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,14 @@ import re # noqa: F401
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from {{packageName}}.api_client import ApiClient
|
from {{packageName}}.api_client import ApiClient
|
||||||
from {{packageName}}.exceptions import ( # noqa: F401
|
from {{packageName}}.exceptions import (
|
||||||
ApiTypeError,
|
ApiTypeError,
|
||||||
ApiValueError
|
ApiValueError
|
||||||
)
|
)
|
||||||
|
from {{packageName}}.model_utils import (
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
@ -30,7 +34,7 @@ class {{classname}}(object):
|
|||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
|
|
||||||
def {{operationId}}(self{{#requiredParams}}{{^defaultValue}}, {{paramName}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}, {{paramName}}={{{defaultValue}}}{{/defaultValue}}{{/requiredParams}}, **kwargs): # noqa: E501
|
def __{{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
|
||||||
"""{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
"""{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||||
|
|
||||||
{{#notes}}
|
{{#notes}}
|
||||||
@ -38,257 +42,376 @@ class {{classname}}(object):
|
|||||||
{{/notes}}
|
{{/notes}}
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
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)
|
{{#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()
|
>>> result = thread.get()
|
||||||
|
|
||||||
{{#requiredParams}}
|
:param async_req bool: execute request asynchronously
|
||||||
{{^hasMore}}
|
|
||||||
Args:
|
|
||||||
{{/hasMore}}
|
|
||||||
{{/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}}
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}:
|
|
||||||
"""
|
|
||||||
kwargs['_return_http_data_only'] = True
|
|
||||||
if kwargs.get('async_req'):
|
|
||||||
return self.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{paramName}}, {{/defaultValue}}{{/requiredParams}}**kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{paramName}}, {{/defaultValue}}{{/requiredParams}}**kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
def {{operationId}}_with_http_info(self{{#requiredParams}}{{^defaultValue}}, {{paramName}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}, {{paramName}}=None{{/defaultValue}}{{/requiredParams}}, **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
|
|
||||||
>>> thread = api.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}async_req=True)
|
|
||||||
>>> result = thread.get()
|
|
||||||
|
|
||||||
{{#requiredParams}}
|
|
||||||
{{^hasMore}}
|
|
||||||
Args:
|
|
||||||
{{/hasMore}}
|
|
||||||
{{/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}}
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
{{#returnType}}{{returnType}}{{/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'):
|
|
||||||
if (int(kwargs.get('_host_index')) < 0 or
|
|
||||||
int(kwargs.get('_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[int(kwargs.get('_host_index'))]
|
|
||||||
{{/servers.0}}
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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}}
|
{{#allParams}}
|
||||||
{{^isNullable}}
|
:param {{dataType}} {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
|
||||||
{{#required}}
|
|
||||||
# verify the required parameter '{{paramName}}' is set
|
|
||||||
if ('{{paramName}}' not in local_var_params or
|
|
||||||
local_var_params['{{paramName}}'] is None):
|
|
||||||
raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501
|
|
||||||
{{/required}}
|
|
||||||
{{/isNullable}}
|
|
||||||
{{#-last}}
|
|
||||||
{{/-last}}
|
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
|
code and headers
|
||||||
|
: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.
|
||||||
|
:return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
|
thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
|
'_return_http_data_only', True
|
||||||
|
)
|
||||||
|
{{#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}}'{{#hasMore}}, {{/hasMore}}
|
||||||
|
{{#-last}}
|
||||||
|
],
|
||||||
|
{{/-last}}
|
||||||
|
{{/authMethods}}
|
||||||
|
{{^authMethods}}
|
||||||
|
'auth': [],
|
||||||
|
{{/authMethods}}
|
||||||
|
'endpoint_path': '{{{path}}}',
|
||||||
|
'operation_id': '{{operationId}}',
|
||||||
|
'http_method': '{{httpMethod}}',
|
||||||
|
{{#servers}}
|
||||||
|
{{#-first}}
|
||||||
|
'servers': [
|
||||||
|
{{/-first}}
|
||||||
|
'{{{url}}}'{{^-last}},{{/-last}}
|
||||||
|
{{#-last}}
|
||||||
|
]
|
||||||
|
{{/-last}}
|
||||||
|
{{/servers}}
|
||||||
|
{{^servers}}
|
||||||
|
'servers': [],
|
||||||
|
{{/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}}
|
{{#allParams}}
|
||||||
{{#isEnum}}
|
{{#isEnum}}
|
||||||
{{#isContainer}}
|
'{{paramName}}',
|
||||||
allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
|
|
||||||
{{#isListContainer}}
|
|
||||||
if ('{{{paramName}}}' in local_var_params and
|
|
||||||
not set(local_var_params['{{{paramName}}}']).issubset(set(allowed_values))): # noqa: E501
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid values for `{{{paramName}}}` [{0}], must be a subset of [{1}]" # noqa: E501
|
|
||||||
.format(", ".join(map(str, set(local_var_params['{{{paramName}}}']) - set(allowed_values))), # noqa: E501
|
|
||||||
", ".join(map(str, allowed_values)))
|
|
||||||
)
|
|
||||||
{{/isListContainer}}
|
|
||||||
{{#isMapContainer}}
|
|
||||||
if ('{{{paramName}}}' in local_var_params and
|
|
||||||
not set(local_var_params['{{{paramName}}}'].keys()).issubset(set(allowed_values))):
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid keys in `{{{paramName}}}` [{0}], must be a subset of [{1}]" # noqa: E501
|
|
||||||
.format(", ".join(map(str, set(local_var_params['{{{paramName}}}'].keys()) - set(allowed_values))), # noqa: E501
|
|
||||||
", ".join(map(str, allowed_values)))
|
|
||||||
)
|
|
||||||
{{/isMapContainer}}
|
|
||||||
{{/isContainer}}
|
|
||||||
{{^isContainer}}
|
|
||||||
allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
|
|
||||||
if ('{{{paramName}}}' in local_var_params and
|
|
||||||
local_var_params['{{{paramName}}}'] not in allowed_values):
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid value for `{{{paramName}}}` ({0}), must be one of {1}" # noqa: E501
|
|
||||||
.format(local_var_params['{{{paramName}}}'], allowed_values)
|
|
||||||
)
|
|
||||||
{{/isContainer}}
|
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
],
|
||||||
|
'validation': [
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#maxLength}}
|
'{{paramName}}',
|
||||||
if ('{{paramName}}' in local_var_params and
|
|
||||||
len(local_var_params['{{paramName}}']) > {{maxLength}}):
|
|
||||||
raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
|
|
||||||
{{/maxLength}}
|
|
||||||
{{#minLength}}
|
|
||||||
if ('{{paramName}}' in local_var_params and
|
|
||||||
len(local_var_params['{{paramName}}']) < {{minLength}}):
|
|
||||||
raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
|
|
||||||
{{/minLength}}
|
|
||||||
{{#maximum}}
|
|
||||||
if '{{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 '{{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 '{{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 ('{{paramName}}' in local_var_params and
|
|
||||||
len(local_var_params['{{paramName}}']) > {{maxItems}}):
|
|
||||||
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 ('{{paramName}}' in local_var_params and
|
|
||||||
len(local_var_params['{{paramName}}']) < {{minItems}}):
|
|
||||||
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}}
|
{{/hasValidation}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
]
|
||||||
collection_formats = {}
|
},
|
||||||
|
root_map={
|
||||||
path_params = {}
|
'validations': {
|
||||||
{{#pathParams}}
|
{{#allParams}}
|
||||||
if '{{paramName}}' in local_var_params:
|
{{#hasValidation}}
|
||||||
path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501
|
('{{paramName}}',): {
|
||||||
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
|
{{#maxLength}}
|
||||||
{{/pathParams}}
|
'max_length': {{maxLength}},{{/maxLength}}{{#minLength}}
|
||||||
|
'min_length': {{minLength}},{{/minLength}}{{#maxItems}}
|
||||||
query_params = []
|
'max_items': {{maxItems}},{{/maxItems}}{{#minItems}}
|
||||||
{{#queryParams}}
|
'min_items': {{minItems}},{{/minItems}}{{#maximum}}
|
||||||
if '{{paramName}}' in local_var_params:
|
{{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}}
|
||||||
query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isListContainer}} # noqa: E501
|
{{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}}
|
||||||
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
|
'regex': {
|
||||||
{{/queryParams}}
|
'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}}
|
||||||
|
{{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}}
|
||||||
header_params = {}
|
},{{/pattern}}
|
||||||
{{#headerParams}}
|
},
|
||||||
if '{{paramName}}' in local_var_params:
|
{{/hasValidation}}
|
||||||
header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501
|
{{/allParams}}
|
||||||
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
|
},
|
||||||
{{/headerParams}}
|
'allowed_values': {
|
||||||
|
{{#allParams}}
|
||||||
form_params = []
|
{{#isEnum}}
|
||||||
local_var_files = {}
|
('{{paramName}}',): {
|
||||||
{{#formParams}}
|
{{#isNullable}}
|
||||||
if '{{paramName}}' in local_var_params:
|
'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}}
|
||||||
{{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isListContainer}} # noqa: E501
|
"{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
|
},
|
||||||
{{/formParams}}
|
{{/isEnum}}
|
||||||
|
{{/allParams}}
|
||||||
body_params = None
|
},
|
||||||
{{#bodyParam}}
|
'openapi_types': {
|
||||||
if '{{paramName}}' in local_var_params:
|
{{#allParams}}
|
||||||
body_params = local_var_params['{{paramName}}']
|
'{{paramName}}': '{{dataType}}',
|
||||||
{{/bodyParam}}
|
{{/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}}
|
{{#hasProduces}}
|
||||||
# HTTP header `Accept`
|
'accept': [
|
||||||
header_params['Accept'] = self.api_client.select_header_accept(
|
{{#produces}}
|
||||||
[{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501
|
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
|
||||||
|
{{/produces}}
|
||||||
|
],
|
||||||
|
{{/hasProduces}}
|
||||||
|
{{^hasProduces}}
|
||||||
|
'accept': [],
|
||||||
{{/hasProduces}}
|
{{/hasProduces}}
|
||||||
{{#hasConsumes}}
|
{{#hasConsumes}}
|
||||||
# HTTP header `Content-Type`
|
'content_type': [
|
||||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
{{#consumes}}
|
||||||
[{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501
|
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
|
||||||
|
{{/consumes}}
|
||||||
|
]
|
||||||
{{/hasConsumes}}
|
{{/hasConsumes}}
|
||||||
# Authentication setting
|
{{^hasConsumes}}
|
||||||
auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] # noqa: E501
|
'content_type': [],
|
||||||
|
{{/hasConsumes}}
|
||||||
return self.api_client.call_api(
|
},
|
||||||
'{{{path}}}', '{{httpMethod}}',
|
api_client=api_client,
|
||||||
path_params,
|
callable=__{{operationId}}
|
||||||
query_params,
|
)
|
||||||
header_params,
|
|
||||||
body=body_params,
|
|
||||||
post_params=form_params,
|
|
||||||
files=local_var_files,
|
|
||||||
response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501
|
|
||||||
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)
|
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
|
|
||||||
|
|
||||||
|
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' (str): 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'
|
||||||
|
])
|
||||||
|
self.validations = root_map['validations']
|
||||||
|
self.allowed_values = root_map['allowed_values']
|
||||||
|
self.openapi_types = root_map['openapi_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],
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
|
||||||
|
for param in self.params_map['validation']:
|
||||||
|
if param in kwargs:
|
||||||
|
check_validations(
|
||||||
|
self.validations,
|
||||||
|
(param,),
|
||||||
|
kwargs[param]
|
||||||
|
)
|
||||||
|
|
||||||
|
def __gather_params(self, kwargs):
|
||||||
|
params = {
|
||||||
|
'body': None,
|
||||||
|
'collection_format': {},
|
||||||
|
'file': {},
|
||||||
|
'form': [],
|
||||||
|
'header': {},
|
||||||
|
'path': {},
|
||||||
|
'query': []
|
||||||
|
}
|
||||||
|
|
||||||
|
for param_name, param_value in six.iteritems(kwargs):
|
||||||
|
param_location = self.location_map.get(param_name)
|
||||||
|
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'):
|
||||||
|
param_location = 'file'
|
||||||
|
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:
|
||||||
|
pet_api = PetApi()
|
||||||
|
pet_api.add_pet # this is an instance of the class Endpoint
|
||||||
|
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
||||||
|
which then invokes the callable functions stored in that endpoint at
|
||||||
|
pet_api.add_pet.callable or self.callable in this class
|
||||||
|
"""
|
||||||
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
def call_with_http_info(self, **kwargs):
|
||||||
|
|
||||||
|
if kwargs.get('_host_index') and self.settings['servers']:
|
||||||
|
_host_index = kwargs.get('_host_index')
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][_host_index]
|
||||||
|
except IndexError:
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid host index. Must be 0 <= index < %s" %
|
||||||
|
len(self.settings['servers'])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][0]
|
||||||
|
except IndexError:
|
||||||
|
_host = None
|
||||||
|
|
||||||
|
for key, value in six.iteritems(kwargs):
|
||||||
|
if key not in self.params_map['all']:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected parameter '%s'"
|
||||||
|
" to method `%s`" %
|
||||||
|
(key, self.settings['operation_id'])
|
||||||
|
)
|
||||||
|
if key not in self.params_map['nullable'] and value is None:
|
||||||
|
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.get('async_req'),
|
||||||
|
_return_http_data_only=kwargs.get('_return_http_data_only'),
|
||||||
|
_preload_content=kwargs.get('_preload_content', True),
|
||||||
|
_request_timeout=kwargs.get('_request_timeout'),
|
||||||
|
_host=_host,
|
||||||
|
collection_formats=params['collection_format'])
|
||||||
|
@ -18,9 +18,13 @@ from six.moves.urllib.parse import quote
|
|||||||
import tornado.gen
|
import tornado.gen
|
||||||
{{/tornado}}
|
{{/tornado}}
|
||||||
|
|
||||||
from {{packageName}}.configuration import Configuration
|
|
||||||
import {{modelPackage}}
|
import {{modelPackage}}
|
||||||
from {{packageName}} import rest
|
from {{packageName}} import rest
|
||||||
|
from {{packageName}}.configuration import Configuration
|
||||||
|
from {{packageName}}.model_utils import (
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple
|
||||||
|
)
|
||||||
from {{packageName}}.exceptions import ApiValueError
|
from {{packageName}}.exceptions import ApiValueError
|
||||||
|
|
||||||
|
|
||||||
@ -224,7 +228,7 @@ class ApiClient(object):
|
|||||||
|
|
||||||
if isinstance(obj, dict):
|
if isinstance(obj, dict):
|
||||||
obj_dict = obj
|
obj_dict = obj
|
||||||
else:
|
elif isinstance(obj, ModelNormal):
|
||||||
# Convert model obj to dict except
|
# Convert model obj to dict except
|
||||||
# attributes `openapi_types`, `attribute_map`
|
# attributes `openapi_types`, `attribute_map`
|
||||||
# and attributes which value is not None.
|
# and attributes which value is not None.
|
||||||
@ -233,6 +237,8 @@ class ApiClient(object):
|
|||||||
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
||||||
for attr, _ in six.iteritems(obj.openapi_types)
|
for attr, _ in six.iteritems(obj.openapi_types)
|
||||||
if getattr(obj, attr) is not None}
|
if getattr(obj, attr) is not None}
|
||||||
|
elif isinstance(obj, ModelSimple):
|
||||||
|
return self.sanitize_for_serialization(obj.value)
|
||||||
|
|
||||||
return {key: self.sanitize_for_serialization(val)
|
return {key: self.sanitize_for_serialization(val)
|
||||||
for key, val in six.iteritems(obj_dict)}
|
for key, val in six.iteritems(obj_dict)}
|
||||||
@ -571,6 +577,8 @@ class ApiClient(object):
|
|||||||
return six.text_type(data)
|
return six.text_type(data)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return data
|
return data
|
||||||
|
except ValueError as exc:
|
||||||
|
raise ApiValueError(str(exc))
|
||||||
|
|
||||||
def __deserialize_object(self, value):
|
def __deserialize_object(self, value):
|
||||||
"""Return an original value.
|
"""Return an original value.
|
||||||
@ -622,14 +630,15 @@ class ApiClient(object):
|
|||||||
"""Deserializes list or dict to model.
|
"""Deserializes list or dict to model.
|
||||||
|
|
||||||
:param data: dict, list.
|
:param data: dict, list.
|
||||||
:param klass: class literal.
|
:param klass: class literal, ModelSimple or ModelNormal
|
||||||
:return: model object.
|
:return: model object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not klass.openapi_types and not hasattr(klass,
|
if issubclass(klass, ModelSimple):
|
||||||
'get_real_child_model'):
|
value = self.__deserialize(data, klass.openapi_types['value'])
|
||||||
return data
|
return klass(value)
|
||||||
|
|
||||||
|
# code to handle ModelNormal
|
||||||
used_data = data
|
used_data = data
|
||||||
if not isinstance(data, (list, dict)):
|
if not isinstance(data, (list, dict)):
|
||||||
used_data = [data]
|
used_data = [data]
|
||||||
@ -641,13 +650,11 @@ class ApiClient(object):
|
|||||||
klass.attribute_map[attr] in used_data):
|
klass.attribute_map[attr] in used_data):
|
||||||
value = used_data[klass.attribute_map[attr]]
|
value = used_data[klass.attribute_map[attr]]
|
||||||
keyword_args[attr] = self.__deserialize(value, attr_type)
|
keyword_args[attr] = self.__deserialize(value, attr_type)
|
||||||
|
|
||||||
end_index = None
|
end_index = None
|
||||||
argspec = inspect.getargspec(getattr(klass, '__init__'))
|
argspec = inspect.getargspec(getattr(klass, '__init__'))
|
||||||
if argspec.defaults:
|
if argspec.defaults:
|
||||||
end_index = -len(argspec.defaults)
|
end_index = -len(argspec.defaults)
|
||||||
required_positional_args = argspec.args[1:end_index]
|
required_positional_args = argspec.args[1:end_index]
|
||||||
|
|
||||||
for index, req_positional_arg in enumerate(required_positional_args):
|
for index, req_positional_arg in enumerate(required_positional_args):
|
||||||
if keyword_args and req_positional_arg in keyword_args:
|
if keyword_args and req_positional_arg in keyword_args:
|
||||||
positional_args.append(keyword_args[req_positional_arg])
|
positional_args.append(keyword_args[req_positional_arg])
|
||||||
@ -655,9 +662,7 @@ class ApiClient(object):
|
|||||||
elif (not keyword_args and index < len(used_data) and
|
elif (not keyword_args and index < len(used_data) and
|
||||||
isinstance(used_data, list)):
|
isinstance(used_data, list)):
|
||||||
positional_args.append(used_data[index])
|
positional_args.append(used_data[index])
|
||||||
|
|
||||||
instance = klass(*positional_args, **keyword_args)
|
instance = klass(*positional_args, **keyword_args)
|
||||||
|
|
||||||
if hasattr(instance, 'get_real_child_model'):
|
if hasattr(instance, 'get_real_child_model'):
|
||||||
klass_name = instance.get_real_child_model(data)
|
klass_name = instance.get_real_child_model(data)
|
||||||
if klass_name:
|
if klass_name:
|
||||||
|
@ -2,240 +2,34 @@
|
|||||||
|
|
||||||
{{>partial_header}}
|
{{>partial_header}}
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from {{packageName}}.exceptions import ApiValueError # noqa: F401
|
||||||
|
from {{packageName}}.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
{{#models}}
|
{{#models}}
|
||||||
{{#model}}
|
{{#model}}
|
||||||
class {{classname}}(object):
|
{{^interfaces}}
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
{{#isAlias}}
|
||||||
Ref: https://openapi-generator.tech
|
{{> python-experimental/model_templates/model_simple }}
|
||||||
|
{{/isAlias}}
|
||||||
Do not edit the class manually.
|
{{^isAlias}}
|
||||||
"""{{#allowableValues}}
|
{{> python-experimental/model_templates/model_normal }}
|
||||||
|
{{/isAlias}}
|
||||||
"""
|
{{/interfaces}}
|
||||||
allowed enum values
|
{{#interfaces}}
|
||||||
"""
|
{{#-last}}
|
||||||
{{#enumVars}}
|
{{> python-experimental/model_templates/model_normal }}
|
||||||
{{name}} = {{{value}}}{{^-last}}
|
|
||||||
{{/-last}}
|
{{/-last}}
|
||||||
{{/enumVars}}{{/allowableValues}}
|
{{/interfaces}}
|
||||||
|
|
||||||
"""
|
|
||||||
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 = {
|
|
||||||
{{#requiredVars}}
|
|
||||||
'{{name}}': '{{{dataType}}}',
|
|
||||||
{{/requiredVars}}
|
|
||||||
{{#optionalVars}}
|
|
||||||
'{{name}}': '{{{dataType}}}',
|
|
||||||
{{/optionalVars}}
|
|
||||||
}
|
|
||||||
|
|
||||||
attribute_map = {
|
|
||||||
{{#requiredVars}}
|
|
||||||
'{{name}}': '{{baseName}}', # noqa: E501
|
|
||||||
{{/requiredVars}}
|
|
||||||
{{#optionalVars}}
|
|
||||||
'{{name}}': '{{baseName}}', # noqa: E501
|
|
||||||
{{/optionalVars}}
|
|
||||||
}
|
|
||||||
{{#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{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}{{#requiredVars}}{{#defaultValue}}, {{name}}={{{defaultValue}}}{{/defaultValue}}{{/requiredVars}}{{#optionalVars}}, {{name}}=None{{/optionalVars}}): # noqa: E501
|
|
||||||
"""{{classname}} - a model defined in OpenAPI
|
|
||||||
|
|
||||||
{{#requiredVars}}{{^hasMore}} Args:{{/hasMore}}{{/requiredVars}}{{#requiredVars}}{{^defaultValue}}
|
|
||||||
{{name}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredVars}}
|
|
||||||
|
|
||||||
Keyword Args:{{#requiredVars}}{{#defaultValue}}
|
|
||||||
{{name}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}} # noqa: E501{{/requiredVars}}{{#optionalVars}}
|
|
||||||
{{name}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501{{/optionalVars}}
|
|
||||||
"""
|
|
||||||
{{#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}} # noqa: E501
|
|
||||||
{{/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: {{dataType}}
|
|
||||||
"""
|
|
||||||
{{^isNullable}}
|
|
||||||
{{#required}}
|
|
||||||
if {{name}} is None:
|
|
||||||
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
|
|
||||||
{{#isListContainer}}
|
|
||||||
if not set({{{name}}}).issubset(set(allowed_values)):
|
|
||||||
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)))
|
|
||||||
)
|
|
||||||
{{/isListContainer}}
|
|
||||||
{{#isMapContainer}}
|
|
||||||
if not set({{{name}}}.keys()).issubset(set(allowed_values)):
|
|
||||||
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)))
|
|
||||||
)
|
|
||||||
{{/isMapContainer}}
|
|
||||||
{{/isContainer}}
|
|
||||||
{{^isContainer}}
|
|
||||||
allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
|
|
||||||
if {{{name}}} not in allowed_values:
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501
|
|
||||||
.format({{{name}}}, allowed_values)
|
|
||||||
)
|
|
||||||
{{/isContainer}}
|
|
||||||
{{/isEnum}}
|
|
||||||
{{^isEnum}}
|
|
||||||
{{#hasValidation}}
|
|
||||||
{{#maxLength}}
|
|
||||||
if {{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 {{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 {{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 {{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 {{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 {{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 {{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):
|
|
||||||
"""Returns the model properties as a dict"""
|
|
||||||
result = {}
|
|
||||||
|
|
||||||
for attr, _ in six.iteritems(self.openapi_types):
|
|
||||||
value = getattr(self, attr)
|
|
||||||
if isinstance(value, list):
|
|
||||||
result[attr] = list(map(
|
|
||||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
||||||
value
|
|
||||||
))
|
|
||||||
elif hasattr(value, "to_dict"):
|
|
||||||
result[attr] = value.to_dict()
|
|
||||||
elif isinstance(value, dict):
|
|
||||||
result[attr] = dict(map(
|
|
||||||
lambda item: (item[0], item[1].to_dict())
|
|
||||||
if hasattr(item[1], "to_dict") else item,
|
|
||||||
value.items()
|
|
||||||
))
|
|
||||||
else:
|
|
||||||
result[attr] = 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.__dict__ == other.__dict__
|
|
||||||
|
|
||||||
def __ne__(self, other):
|
|
||||||
"""Returns true if both objects are not equal"""
|
|
||||||
return not self == other
|
|
||||||
{{/model}}
|
{{/model}}
|
||||||
{{/models}}
|
{{/models}}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
allowed_values = {
|
||||||
|
{{#vars}}
|
||||||
|
{{#isEnum}}
|
||||||
|
('{{name}}',): {
|
||||||
|
{{#isNullable}}
|
||||||
|
'None': None,
|
||||||
|
{{/isNullable}}
|
||||||
|
{{#allowableValues}}
|
||||||
|
{{#enumVars}}
|
||||||
|
'{{name}}': {{{value}}}{{^-last}},{{/-last}}
|
||||||
|
{{/enumVars}}
|
||||||
|
{{/allowableValues}}
|
||||||
|
},
|
||||||
|
{{/isEnum}}
|
||||||
|
{{/vars}}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
openapi_types = {
|
||||||
|
{{#vars}}
|
||||||
|
'{{name}}': '{{{dataType}}}'{{#hasMore}},{{/hasMore}}
|
||||||
|
{{/vars}}
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
|
{{#vars}}
|
||||||
|
{{#hasValidation}}
|
||||||
|
('{{name}}',): {
|
||||||
|
{{#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}}
|
||||||
|
{{/vars}}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
@ -0,0 +1,7 @@
|
|||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
@ -0,0 +1,76 @@
|
|||||||
|
def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501
|
||||||
|
"""{{classname}} - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
{{#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}}): # noqa: E501
|
||||||
|
"""Sets the {{name}} of this {{classname}}.
|
||||||
|
|
||||||
|
{{#description}}
|
||||||
|
{{{description}}} # noqa: E501
|
||||||
|
{{/description}}
|
||||||
|
|
||||||
|
:param {{name}}: The {{name}} of this {{classname}}. # noqa: E501
|
||||||
|
:type: {{dataType}}
|
||||||
|
"""
|
||||||
|
{{^isNullable}}
|
||||||
|
{{#required}}
|
||||||
|
if {{name}} is None:
|
||||||
|
raise ApiValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501
|
||||||
|
{{/required}}
|
||||||
|
{{/isNullable}}
|
||||||
|
{{#isEnum}}
|
||||||
|
check_allowed_values(
|
||||||
|
self.allowed_values,
|
||||||
|
('{{name}}',),
|
||||||
|
{{name}},
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
{{/isEnum}}
|
||||||
|
{{#hasValidation}}
|
||||||
|
check_validations(
|
||||||
|
self.validations,
|
||||||
|
('{{name}}',),
|
||||||
|
{{name}}
|
||||||
|
)
|
||||||
|
{{/hasValidation}}
|
||||||
|
|
||||||
|
self._{{name}} = (
|
||||||
|
{{name}}
|
||||||
|
)
|
||||||
|
{{/vars}}
|
@ -0,0 +1,83 @@
|
|||||||
|
class {{classname}}(ModelNormal):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
{{> python-experimental/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 }}
|
||||||
|
"""
|
||||||
|
|
||||||
|
{{> python-experimental/model_templates/classvar_allowed }}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
{{#vars}}
|
||||||
|
'{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}} # noqa: E501
|
||||||
|
{{/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}}
|
||||||
|
|
||||||
|
{{> python-experimental/model_templates/classvar_openapi_validations }}
|
||||||
|
|
||||||
|
{{> python-experimental/model_templates/methods_init_properties }}
|
||||||
|
{{#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):
|
||||||
|
"""Returns the model properties as a dict"""
|
||||||
|
result = {}
|
||||||
|
|
||||||
|
for attr, _ in six.iteritems(self.openapi_types):
|
||||||
|
value = getattr(self, attr)
|
||||||
|
if isinstance(value, list):
|
||||||
|
result[attr] = list(map(
|
||||||
|
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||||
|
value
|
||||||
|
))
|
||||||
|
elif hasattr(value, "to_dict"):
|
||||||
|
result[attr] = value.to_dict()
|
||||||
|
elif isinstance(value, dict):
|
||||||
|
result[attr] = dict(map(
|
||||||
|
lambda item: (item[0], item[1].to_dict())
|
||||||
|
if hasattr(item[1], "to_dict") else item,
|
||||||
|
value.items()
|
||||||
|
))
|
||||||
|
else:
|
||||||
|
result[attr] = 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.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,34 @@
|
|||||||
|
class {{classname}}(ModelSimple):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
{{> python-experimental/model_templates/docstring_allowed }}
|
||||||
|
{{> python-experimental/model_templates/docstring_openapi_validations }}
|
||||||
|
"""
|
||||||
|
|
||||||
|
{{> python-experimental/model_templates/classvar_allowed }}
|
||||||
|
|
||||||
|
{{> python-experimental/model_templates/classvar_openapi_validations }}
|
||||||
|
|
||||||
|
{{> python-experimental/model_templates/methods_init_properties }}
|
||||||
|
def to_str(self):
|
||||||
|
"""Returns the string representation of the model"""
|
||||||
|
return str(self._value)
|
||||||
|
|
||||||
|
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.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
175
modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache
vendored
Normal file
175
modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache
vendored
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
{{>partial_header}}
|
||||||
|
import re
|
||||||
|
|
||||||
|
from {{packageName}}.exceptions import ApiValueError
|
||||||
|
|
||||||
|
|
||||||
|
def check_allowed_values(allowed_values, input_variable_path, input_values,
|
||||||
|
validations):
|
||||||
|
"""Raises an exception if the input_values are not allowed
|
||||||
|
|
||||||
|
Args:
|
||||||
|
allowed_values (dict): the allowed_values dict
|
||||||
|
input_variable_path (tuple): the path to the input variable
|
||||||
|
input_values (list/str/int/float/date/datetime): the values that we
|
||||||
|
are checking to see if they are in allowed_values
|
||||||
|
validations (dict): the validations dict
|
||||||
|
"""
|
||||||
|
min_collection_length = (
|
||||||
|
validations.get(input_variable_path, {}).get('min_length') or
|
||||||
|
validations.get(input_variable_path, {}).get('min_items', 0))
|
||||||
|
these_allowed_values = list(allowed_values[input_variable_path].values())
|
||||||
|
if (isinstance(input_values, list)
|
||||||
|
and len(input_values) > min_collection_length
|
||||||
|
and not set(input_values).issubset(
|
||||||
|
set(these_allowed_values))):
|
||||||
|
invalid_values = ", ".join(
|
||||||
|
map(str, set(input_values) - set(these_allowed_values))),
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid values for `%s` [%s], must be a subset of [%s]" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
invalid_values,
|
||||||
|
", ".join(map(str, these_allowed_values))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif (isinstance(input_values, dict)
|
||||||
|
and len(input_values) > min_collection_length
|
||||||
|
and not set(
|
||||||
|
input_values.keys()).issubset(set(these_allowed_values))):
|
||||||
|
invalid_values = ", ".join(
|
||||||
|
map(str, set(input_values.keys()) - set(these_allowed_values)))
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid keys in `%s` [%s], must be a subset of [%s]" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
invalid_values,
|
||||||
|
", ".join(map(str, these_allowed_values))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif (not isinstance(input_values, (list, dict))
|
||||||
|
and input_values not in these_allowed_values):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s` (%s), must be one of %s" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
input_values,
|
||||||
|
these_allowed_values
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def check_validations(validations, input_variable_path, input_values):
|
||||||
|
"""Raises an exception if the input_values are invalid
|
||||||
|
|
||||||
|
Args:
|
||||||
|
validations (dict): the validation dictionary
|
||||||
|
input_variable_path (tuple): the path to the input variable
|
||||||
|
input_values (list/str/int/float/date/datetime): the values that we
|
||||||
|
are checking
|
||||||
|
"""
|
||||||
|
current_validations = validations[input_variable_path]
|
||||||
|
if ('max_length' in current_validations and
|
||||||
|
len(input_values) > current_validations['max_length']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, length must be less than or equal to "
|
||||||
|
"`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['max_length']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('min_length' in current_validations and
|
||||||
|
len(input_values) < current_validations['min_length']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, length must be greater than or equal to "
|
||||||
|
"`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['min_length']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('max_items' in current_validations and
|
||||||
|
len(input_values) > current_validations['max_items']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, number of items must be less than or "
|
||||||
|
"equal to `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['max_items']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('min_items' in current_validations and
|
||||||
|
len(input_values) < current_validations['min_items']):
|
||||||
|
raise ValueError(
|
||||||
|
"Invalid value for `%s`, number of items must be greater than or "
|
||||||
|
"equal to `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['min_items']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('exclusive_maximum' in current_validations and
|
||||||
|
input_values >= current_validations['exclusive_maximum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value less than `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['exclusive_maximum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('inclusive_maximum' in current_validations and
|
||||||
|
input_values > current_validations['inclusive_maximum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value less than or equal to "
|
||||||
|
"`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['inclusive_maximum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('exclusive_minimum' in current_validations and
|
||||||
|
input_values <= current_validations['exclusive_minimum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value greater than `%s`" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['exclusive_maximum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('inclusive_minimum' in current_validations and
|
||||||
|
input_values < current_validations['inclusive_minimum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value greater than or equal "
|
||||||
|
"to `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['inclusive_minimum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
flags = current_validations.get('regex', {}).get('flags', 0)
|
||||||
|
if ('regex' in current_validations and
|
||||||
|
not re.search(current_validations['regex']['pattern'],
|
||||||
|
input_values, flags=flags)):
|
||||||
|
raise ApiValueError(
|
||||||
|
r"Invalid value for `%s`, must be a follow pattern or equal to "
|
||||||
|
r"`%s` with flags=`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['regex']['pattern'],
|
||||||
|
flags
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ModelSimple(object):
|
||||||
|
# the parent class of models whose type != object in their swagger/openapi
|
||||||
|
# spec
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ModelNormal(object):
|
||||||
|
# the parent class of models whose type == object in their swagger/openapi
|
||||||
|
# spec
|
||||||
|
pass
|
@ -906,6 +906,23 @@ paths:
|
|||||||
description: Output composite
|
description: Output composite
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/OuterComposite'
|
$ref: '#/definitions/OuterComposite'
|
||||||
|
/fake/outer/enum:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
|
description: Test serialization of outer enum
|
||||||
|
operationId: fakeOuterEnumSerialize
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: Input enum as post body
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/OuterEnum'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Output enum
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/OuterEnum'
|
||||||
/fake/jsonFormData:
|
/fake/jsonFormData:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -1378,7 +1395,7 @@ definitions:
|
|||||||
minimum: 67.8
|
minimum: 67.8
|
||||||
string:
|
string:
|
||||||
type: string
|
type: string
|
||||||
pattern: /[a-z]/i
|
pattern: /^[a-z]+$/i
|
||||||
byte:
|
byte:
|
||||||
type: string
|
type: string
|
||||||
format: byte
|
format: byte
|
||||||
@ -1721,6 +1738,8 @@ definitions:
|
|||||||
$ref: '#/definitions/OuterBoolean'
|
$ref: '#/definitions/OuterBoolean'
|
||||||
OuterNumber:
|
OuterNumber:
|
||||||
type: number
|
type: number
|
||||||
|
minimum: 10
|
||||||
|
maximum: 20
|
||||||
OuterString:
|
OuterString:
|
||||||
type: string
|
type: string
|
||||||
OuterBoolean:
|
OuterBoolean:
|
||||||
|
@ -1 +1 @@
|
|||||||
4.0.3-SNAPSHOT
|
4.1.3-SNAPSHOT
|
@ -14,7 +14,7 @@ Python 2.7 and 3.4+
|
|||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
### pip install
|
### pip install
|
||||||
|
|
||||||
If the python package is hosted on Github, you can install directly from Github
|
If the python package is hosted on a repository, you can install directly using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||||
@ -77,6 +77,7 @@ Class | Method | HTTP request | Description
|
|||||||
*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
|
*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_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_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
|
||||||
|
*FakeApi* | [**fake_outer_enum_serialize**](docs/FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum |
|
||||||
*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
|
*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* | [**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_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||||
@ -152,9 +153,11 @@ Class | Method | HTTP request | Description
|
|||||||
- [Order](docs/Order.md)
|
- [Order](docs/Order.md)
|
||||||
- [OuterComposite](docs/OuterComposite.md)
|
- [OuterComposite](docs/OuterComposite.md)
|
||||||
- [OuterEnum](docs/OuterEnum.md)
|
- [OuterEnum](docs/OuterEnum.md)
|
||||||
|
- [OuterNumber](docs/OuterNumber.md)
|
||||||
- [Pet](docs/Pet.md)
|
- [Pet](docs/Pet.md)
|
||||||
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||||
- [SpecialModelName](docs/SpecialModelName.md)
|
- [SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [StringBooleanMap](docs/StringBooleanMap.md)
|
||||||
- [Tag](docs/Tag.md)
|
- [Tag](docs/Tag.md)
|
||||||
- [TypeHolderDefault](docs/TypeHolderDefault.md)
|
- [TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||||
- [TypeHolderExample](docs/TypeHolderExample.md)
|
- [TypeHolderExample](docs/TypeHolderExample.md)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**class_name** | **str** | |
|
**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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**class_name** | **str** | |
|
||||||
**declawed** | **bool** | | [optional]
|
**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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **str** | | defaults to 'default-name'
|
||||||
**id** | **int** | | [optional]
|
**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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**class_name** | **str** | |
|
||||||
**breed** | **str** | | [optional]
|
**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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**value** | **str** | | defaults 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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**enum_string** | **str** | | [optional]
|
|
||||||
**enum_string_required** | **str** | |
|
**enum_string_required** | **str** | |
|
||||||
|
**enum_string** | **str** | | [optional]
|
||||||
**enum_integer** | **int** | | [optional]
|
**enum_integer** | **int** | | [optional]
|
||||||
**enum_number** | **float** | | [optional]
|
**enum_number** | **float** | | [optional]
|
||||||
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
||||||
|
@ -7,6 +7,7 @@ Method | HTTP request | Description
|
|||||||
[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
|
[**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_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_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
|
||||||
|
[**fake_outer_enum_serialize**](FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum |
|
||||||
[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
|
[**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 |
|
[**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_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||||
@ -179,8 +180,61 @@ 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)
|
[[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_enum_serialize**
|
||||||
|
> OuterEnum fake_outer_enum_serialize()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer enum
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
body = OuterEnum("placed") # OuterEnum | Input enum as post body (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
api_response = api_instance.fake_outer_enum_serialize(body=body)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**OuterEnum**](str.md)| Input enum as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**OuterEnum**](OuterEnum.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
# **fake_outer_number_serialize**
|
# **fake_outer_number_serialize**
|
||||||
> float fake_outer_number_serialize()
|
> OuterNumber fake_outer_number_serialize()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -197,7 +251,7 @@ from pprint import pprint
|
|||||||
|
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = petstore_api.FakeApi()
|
api_instance = petstore_api.FakeApi()
|
||||||
body = 3.4 # float | Input number as post body (optional)
|
body = OuterNumber(3.4) # OuterNumber | Input number as post body (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
api_response = api_instance.fake_outer_number_serialize(body=body)
|
api_response = api_instance.fake_outer_number_serialize(body=body)
|
||||||
@ -210,11 +264,11 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | **float**| Input number as post body | [optional]
|
**body** | [**OuterNumber**](float.md)| Input number as post body | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
**float**
|
[**OuterNumber**](OuterNumber.md)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
|
@ -3,19 +3,19 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**number** | **float** | |
|
||||||
|
**byte** | **str** | |
|
||||||
|
**date** | **date** | |
|
||||||
|
**password** | **str** | |
|
||||||
**integer** | **int** | | [optional]
|
**integer** | **int** | | [optional]
|
||||||
**int32** | **int** | | [optional]
|
**int32** | **int** | | [optional]
|
||||||
**int64** | **int** | | [optional]
|
**int64** | **int** | | [optional]
|
||||||
**number** | **float** | |
|
|
||||||
**float** | **float** | | [optional]
|
**float** | **float** | | [optional]
|
||||||
**double** | **float** | | [optional]
|
**double** | **float** | | [optional]
|
||||||
**string** | **str** | | [optional]
|
**string** | **str** | | [optional]
|
||||||
**byte** | **str** | |
|
|
||||||
**binary** | **file** | | [optional]
|
**binary** | **file** | | [optional]
|
||||||
**date** | **date** | |
|
|
||||||
**date_time** | **datetime** | | [optional]
|
**date_time** | **datetime** | | [optional]
|
||||||
**uuid** | **str** | | [optional]
|
**uuid** | **str** | | [optional]
|
||||||
**password** | **str** | |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|||||||
**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
|
**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
|
||||||
**map_of_enum_string** | **dict(str, str)** | | [optional]
|
**map_of_enum_string** | **dict(str, str)** | | [optional]
|
||||||
**direct_map** | **dict(str, bool)** | | [optional]
|
**direct_map** | **dict(str, bool)** | | [optional]
|
||||||
**indirect_map** | **dict(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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ Name | Type | Description | Notes
|
|||||||
**quantity** | **int** | | [optional]
|
**quantity** | **int** | | [optional]
|
||||||
**ship_date** | **datetime** | | [optional]
|
**ship_date** | **datetime** | | [optional]
|
||||||
**status** | **str** | Order Status | [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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**my_number** | **float** | | [optional]
|
**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional]
|
||||||
**my_string** | **str** | | [optional]
|
**my_string** | **str** | | [optional]
|
||||||
**my_boolean** | **bool** | | [optional]
|
**my_boolean** | **bool** | | [optional]
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**value** | **str** | |
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
# OuterNumber
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**value** | **float** | |
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **int** | | [optional]
|
|
||||||
**category** | [**Category**](Category.md) | | [optional]
|
|
||||||
**name** | **str** | |
|
**name** | **str** | |
|
||||||
**photo_urls** | **list[str]** | |
|
**photo_urls** | **list[str]** | |
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**category** | [**Category**](Category.md) | | [optional]
|
||||||
**tags** | [**list[Tag]**](Tag.md) | | [optional]
|
**tags** | [**list[Tag]**](Tag.md) | | [optional]
|
||||||
**status** | **str** | pet status in the store | [optional]
|
**status** | **str** | pet status in the store | [optional]
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
# StringBooleanMap
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**string_item** | **str** | | [default to 'what']
|
**array_item** | **list[int]** | |
|
||||||
**number_item** | **float** | | [default to 1.234]
|
**string_item** | **str** | | defaults to 'what'
|
||||||
**integer_item** | **int** | | [default to -2]
|
**number_item** | **float** | | defaults to 1.234
|
||||||
**bool_item** | **bool** | | [default to True]
|
**integer_item** | **int** | | defaults to -2
|
||||||
|
**bool_item** | **bool** | | defaults to True
|
||||||
**date_item** | **date** | | [optional]
|
**date_item** | **date** | | [optional]
|
||||||
**datetime_item** | **datetime** | | [optional]
|
**datetime_item** | **datetime** | | [optional]
|
||||||
**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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**string_item** | **str** | | [default to 'what']
|
|
||||||
**number_item** | **float** | | [default to 1.234]
|
|
||||||
**integer_item** | **int** | | [default to -2]
|
|
||||||
**bool_item** | **bool** | |
|
**bool_item** | **bool** | |
|
||||||
**array_item** | **list[int]** | |
|
**array_item** | **list[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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# 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"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
release_note=$3
|
release_note=$3
|
||||||
|
git_host=$4
|
||||||
|
|
||||||
|
if [ "$git_host" = "" ]; then
|
||||||
|
git_host="github.com"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$git_user_id" = "" ]; then
|
if [ "$git_user_id" = "" ]; then
|
||||||
git_user_id="GIT_USER_ID"
|
git_user_id="GIT_USER_ID"
|
||||||
@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined
|
|||||||
|
|
||||||
if [ "$GIT_TOKEN" = "" ]; then
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
else
|
else
|
||||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -47,6 +53,6 @@ fi
|
|||||||
git pull origin master
|
git pull origin master
|
||||||
|
|
||||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||||
git push origin master 2>&1 | grep -v 'To https'
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
||||||
|
@ -1,658 +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 datetime
|
|
||||||
import inspect
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
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()
|
|
||||||
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 __del__(self):
|
|
||||||
if self._pool:
|
|
||||||
self._pool.close()
|
|
||||||
self._pool.join()
|
|
||||||
self._pool = None
|
|
||||||
|
|
||||||
@property
|
|
||||||
def pool(self):
|
|
||||||
"""Create thread pool on first request
|
|
||||||
avoids instantiating unused threadpool for blocking clients.
|
|
||||||
"""
|
|
||||||
if self._pool is None:
|
|
||||||
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_type=None, auth_settings=None,
|
|
||||||
_return_http_data_only=None, collection_formats=None,
|
|
||||||
_preload_content=True, _request_timeout=None, _host=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)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
self.last_response = response_data
|
|
||||||
|
|
||||||
return_data = response_data
|
|
||||||
if _preload_content:
|
|
||||||
# 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_datatime(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_type=None, auth_settings=None, async_req=None,
|
|
||||||
_return_http_data_only=None, collection_formats=None,
|
|
||||||
_preload_content=True, _request_timeout=None, _host=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.
|
|
||||||
: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)
|
|
||||||
else:
|
|
||||||
thread = 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))
|
|
||||||
return thread
|
|
||||||
|
|
||||||
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 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):
|
|
||||||
"""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.
|
|
||||||
"""
|
|
||||||
if not auth_settings:
|
|
||||||
return
|
|
||||||
|
|
||||||
for auth in auth_settings:
|
|
||||||
auth_setting = self.configuration.auth_settings().get(auth)
|
|
||||||
if auth_setting:
|
|
||||||
if not auth_setting['value']:
|
|
||||||
continue
|
|
||||||
elif 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:
|
|
||||||
from dateutil.parser import parse
|
|
||||||
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_datatime(self, string):
|
|
||||||
"""Deserializes string to datetime.
|
|
||||||
|
|
||||||
The string should be in iso8601 datetime format.
|
|
||||||
|
|
||||||
:param string: str.
|
|
||||||
:return: datetime.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
from dateutil.parser import parse
|
|
||||||
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.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if not klass.openapi_types and not hasattr(klass,
|
|
||||||
'get_real_child_model'):
|
|
||||||
return data
|
|
||||||
|
|
||||||
used_data = data
|
|
||||||
if not isinstance(data, (list, dict)):
|
|
||||||
used_data = [data]
|
|
||||||
keyword_args = {}
|
|
||||||
positional_args = []
|
|
||||||
if klass.openapi_types is not None:
|
|
||||||
for attr, attr_type in six.iteritems(klass.openapi_types):
|
|
||||||
if (data is not None and
|
|
||||||
klass.attribute_map[attr] in used_data):
|
|
||||||
value = used_data[klass.attribute_map[attr]]
|
|
||||||
keyword_args[attr] = self.__deserialize(value, attr_type)
|
|
||||||
|
|
||||||
end_index = None
|
|
||||||
argspec = inspect.getargspec(getattr(klass, '__init__'))
|
|
||||||
if argspec.defaults:
|
|
||||||
end_index = -len(argspec.defaults)
|
|
||||||
required_positional_args = argspec.args[1:end_index]
|
|
||||||
|
|
||||||
for index, req_positional_arg in enumerate(required_positional_args):
|
|
||||||
if keyword_args and req_positional_arg in keyword_args:
|
|
||||||
positional_args.append(keyword_args[req_positional_arg])
|
|
||||||
del keyword_args[req_positional_arg]
|
|
||||||
elif (not keyword_args and index < len(used_data) and
|
|
||||||
isinstance(used_data, list)):
|
|
||||||
positional_args.append(used_data[index])
|
|
||||||
|
|
||||||
instance = klass(*positional_args, **keyword_args)
|
|
||||||
|
|
||||||
if hasattr(instance, 'get_real_child_model'):
|
|
||||||
klass_name = instance.get_real_child_model(data)
|
|
||||||
if klass_name:
|
|
||||||
instance = self.__deserialize(data, klass_name)
|
|
||||||
return instance
|
|
@ -71,9 +71,11 @@ from petstore_api.models.number_only import NumberOnly
|
|||||||
from petstore_api.models.order import Order
|
from petstore_api.models.order import Order
|
||||||
from petstore_api.models.outer_composite import OuterComposite
|
from petstore_api.models.outer_composite import OuterComposite
|
||||||
from petstore_api.models.outer_enum import OuterEnum
|
from petstore_api.models.outer_enum import OuterEnum
|
||||||
|
from petstore_api.models.outer_number import OuterNumber
|
||||||
from petstore_api.models.pet import Pet
|
from petstore_api.models.pet import Pet
|
||||||
from petstore_api.models.read_only_first import ReadOnlyFirst
|
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||||
from petstore_api.models.special_model_name import SpecialModelName
|
from petstore_api.models.special_model_name import SpecialModelName
|
||||||
|
from petstore_api.models.string_boolean_map import StringBooleanMap
|
||||||
from petstore_api.models.tag import Tag
|
from petstore_api.models.tag import Tag
|
||||||
from petstore_api.models.type_holder_default import TypeHolderDefault
|
from petstore_api.models.type_holder_default import TypeHolderDefault
|
||||||
from petstore_api.models.type_holder_example import TypeHolderExample
|
from petstore_api.models.type_holder_example import TypeHolderExample
|
||||||
|
@ -18,10 +18,14 @@ import re # noqa: F401
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from petstore_api.api_client import ApiClient
|
from petstore_api.api_client import ApiClient
|
||||||
from petstore_api.exceptions import ( # noqa: F401
|
from petstore_api.exceptions import (
|
||||||
ApiTypeError,
|
ApiTypeError,
|
||||||
ApiValueError
|
ApiValueError
|
||||||
)
|
)
|
||||||
|
from petstore_api.model_utils import (
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AnotherFakeApi(object):
|
class AnotherFakeApi(object):
|
||||||
@ -36,7 +40,7 @@ class AnotherFakeApi(object):
|
|||||||
api_client = ApiClient()
|
api_client = ApiClient()
|
||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
def call_123_test_special_tags(self, body, **kwargs): # noqa: E501
|
def __call_123_test_special_tags(self, body, **kwargs): # noqa: E501
|
||||||
"""To test special tags # noqa: E501
|
"""To test special tags # noqa: E501
|
||||||
|
|
||||||
To test special tags and operation ID starting with number # noqa: E501
|
To test special tags and operation ID starting with number # noqa: E501
|
||||||
@ -45,113 +49,260 @@ class AnotherFakeApi(object):
|
|||||||
>>> thread = api.call_123_test_special_tags(body, async_req=True)
|
>>> thread = api.call_123_test_special_tags(body, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
Args:
|
:param async_req bool: execute request asynchronously
|
||||||
body (Client): client model
|
:param Client body: client model (required)
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
Keyword Args:
|
code and headers
|
||||||
async_req (bool): execute request asynchronously
|
:param _preload_content: if False, the urllib3.HTTPResponse object
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
will be returned without reading/decoding response data.
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
Default is True.
|
||||||
param _request_timeout (float/tuple): timeout setting for this
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
request. If one number provided, it will be total request
|
number provided, it will be total request timeout. It can also
|
||||||
timeout. It can also be a pair (tuple) of (connection, read)
|
be a pair (tuple) of (connection, read) timeouts.
|
||||||
timeouts.
|
:return: Client
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
Returns:
|
thread.
|
||||||
Client:
|
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
if kwargs.get('async_req'):
|
'_return_http_data_only', True
|
||||||
return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
Args:
|
|
||||||
body (Client): client model
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Client:
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = ['body'] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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
|
kwargs['body'] = body
|
||||||
del local_var_params['kwargs']
|
return self.call_with_http_info(**kwargs)
|
||||||
# verify the required parameter 'body' is set
|
|
||||||
if ('body' not in local_var_params or
|
|
||||||
local_var_params['body'] is None):
|
|
||||||
raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501
|
|
||||||
|
|
||||||
collection_formats = {}
|
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': [],
|
||||||
|
},
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
path_params = {}
|
|
||||||
|
|
||||||
query_params = []
|
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
|
||||||
|
|
||||||
header_params = {}
|
Args:
|
||||||
|
settings (dict): see below key value pairs
|
||||||
|
'response_type' (str): 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'
|
||||||
|
])
|
||||||
|
self.validations = root_map['validations']
|
||||||
|
self.allowed_values = root_map['allowed_values']
|
||||||
|
self.openapi_types = root_map['openapi_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
|
||||||
|
|
||||||
form_params = []
|
def __validate_inputs(self, kwargs):
|
||||||
local_var_files = {}
|
for param in self.params_map['enum']:
|
||||||
|
if param in kwargs:
|
||||||
|
check_allowed_values(
|
||||||
|
self.allowed_values,
|
||||||
|
(param,),
|
||||||
|
kwargs[param],
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
|
||||||
body_params = None
|
for param in self.params_map['validation']:
|
||||||
if 'body' in local_var_params:
|
if param in kwargs:
|
||||||
body_params = local_var_params['body']
|
check_validations(
|
||||||
# HTTP header `Accept`
|
self.validations,
|
||||||
header_params['Accept'] = self.api_client.select_header_accept(
|
(param,),
|
||||||
['application/json']) # noqa: E501
|
kwargs[param]
|
||||||
|
)
|
||||||
|
|
||||||
# HTTP header `Content-Type`
|
def __gather_params(self, kwargs):
|
||||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
params = {
|
||||||
['application/json']) # noqa: E501
|
'body': None,
|
||||||
|
'collection_format': {},
|
||||||
|
'file': {},
|
||||||
|
'form': [],
|
||||||
|
'header': {},
|
||||||
|
'path': {},
|
||||||
|
'query': []
|
||||||
|
}
|
||||||
|
|
||||||
# Authentication setting
|
for param_name, param_value in six.iteritems(kwargs):
|
||||||
auth_settings = [] # noqa: E501
|
param_location = self.location_map.get(param_name)
|
||||||
|
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'):
|
||||||
|
param_location = 'file'
|
||||||
|
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:
|
||||||
|
pet_api = PetApi()
|
||||||
|
pet_api.add_pet # this is an instance of the class Endpoint
|
||||||
|
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
||||||
|
which then invokes the callable functions stored in that endpoint at
|
||||||
|
pet_api.add_pet.callable or self.callable in this class
|
||||||
|
"""
|
||||||
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
def call_with_http_info(self, **kwargs):
|
||||||
|
|
||||||
|
if kwargs.get('_host_index') and self.settings['servers']:
|
||||||
|
_host_index = kwargs.get('_host_index')
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][_host_index]
|
||||||
|
except IndexError:
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid host index. Must be 0 <= index < %s" %
|
||||||
|
len(self.settings['servers'])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][0]
|
||||||
|
except IndexError:
|
||||||
|
_host = None
|
||||||
|
|
||||||
|
for key, value in six.iteritems(kwargs):
|
||||||
|
if key not in self.params_map['all']:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected parameter '%s'"
|
||||||
|
" to method `%s`" %
|
||||||
|
(key, self.settings['operation_id'])
|
||||||
|
)
|
||||||
|
if key not in self.params_map['nullable'] and value is None:
|
||||||
|
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(
|
return self.api_client.call_api(
|
||||||
'/another-fake/dummy', 'PATCH',
|
self.settings['endpoint_path'], self.settings['http_method'],
|
||||||
path_params,
|
params['path'],
|
||||||
query_params,
|
params['query'],
|
||||||
header_params,
|
params['header'],
|
||||||
body=body_params,
|
body=params['body'],
|
||||||
post_params=form_params,
|
post_params=params['form'],
|
||||||
files=local_var_files,
|
files=params['file'],
|
||||||
response_type='Client', # noqa: E501
|
response_type=self.settings['response_type'],
|
||||||
auth_settings=auth_settings,
|
auth_settings=self.settings['auth'],
|
||||||
async_req=local_var_params.get('async_req'),
|
async_req=kwargs.get('async_req'),
|
||||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
_return_http_data_only=kwargs.get('_return_http_data_only'),
|
||||||
_preload_content=local_var_params.get('_preload_content', True),
|
_preload_content=kwargs.get('_preload_content', True),
|
||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
_request_timeout=kwargs.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
_host=_host,
|
||||||
|
collection_formats=params['collection_format'])
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -18,10 +18,14 @@ import re # noqa: F401
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from petstore_api.api_client import ApiClient
|
from petstore_api.api_client import ApiClient
|
||||||
from petstore_api.exceptions import ( # noqa: F401
|
from petstore_api.exceptions import (
|
||||||
ApiTypeError,
|
ApiTypeError,
|
||||||
ApiValueError
|
ApiValueError
|
||||||
)
|
)
|
||||||
|
from petstore_api.model_utils import (
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FakeClassnameTags123Api(object):
|
class FakeClassnameTags123Api(object):
|
||||||
@ -36,7 +40,7 @@ class FakeClassnameTags123Api(object):
|
|||||||
api_client = ApiClient()
|
api_client = ApiClient()
|
||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
def test_classname(self, body, **kwargs): # noqa: E501
|
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
|
||||||
|
|
||||||
To test class name in snake case # noqa: E501
|
To test class name in snake case # noqa: E501
|
||||||
@ -45,113 +49,262 @@ class FakeClassnameTags123Api(object):
|
|||||||
>>> thread = api.test_classname(body, async_req=True)
|
>>> thread = api.test_classname(body, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
Args:
|
:param async_req bool: execute request asynchronously
|
||||||
body (Client): client model
|
:param Client body: client model (required)
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
Keyword Args:
|
code and headers
|
||||||
async_req (bool): execute request asynchronously
|
:param _preload_content: if False, the urllib3.HTTPResponse object
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
will be returned without reading/decoding response data.
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
Default is True.
|
||||||
param _request_timeout (float/tuple): timeout setting for this
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
request. If one number provided, it will be total request
|
number provided, it will be total request timeout. It can also
|
||||||
timeout. It can also be a pair (tuple) of (connection, read)
|
be a pair (tuple) of (connection, read) timeouts.
|
||||||
timeouts.
|
:return: Client
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
Returns:
|
thread.
|
||||||
Client:
|
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
if kwargs.get('async_req'):
|
'_return_http_data_only', True
|
||||||
return self.test_classname_with_http_info(body, **kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
Args:
|
|
||||||
body (Client): client model
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Client:
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = ['body'] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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
|
kwargs['body'] = body
|
||||||
del local_var_params['kwargs']
|
return self.call_with_http_info(**kwargs)
|
||||||
# verify the required parameter 'body' is set
|
|
||||||
if ('body' not in local_var_params or
|
|
||||||
local_var_params['body'] is None):
|
|
||||||
raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501
|
|
||||||
|
|
||||||
collection_formats = {}
|
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': [],
|
||||||
|
},
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
path_params = {}
|
|
||||||
|
|
||||||
query_params = []
|
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
|
||||||
|
|
||||||
header_params = {}
|
Args:
|
||||||
|
settings (dict): see below key value pairs
|
||||||
|
'response_type' (str): 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'
|
||||||
|
])
|
||||||
|
self.validations = root_map['validations']
|
||||||
|
self.allowed_values = root_map['allowed_values']
|
||||||
|
self.openapi_types = root_map['openapi_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
|
||||||
|
|
||||||
form_params = []
|
def __validate_inputs(self, kwargs):
|
||||||
local_var_files = {}
|
for param in self.params_map['enum']:
|
||||||
|
if param in kwargs:
|
||||||
|
check_allowed_values(
|
||||||
|
self.allowed_values,
|
||||||
|
(param,),
|
||||||
|
kwargs[param],
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
|
||||||
body_params = None
|
for param in self.params_map['validation']:
|
||||||
if 'body' in local_var_params:
|
if param in kwargs:
|
||||||
body_params = local_var_params['body']
|
check_validations(
|
||||||
# HTTP header `Accept`
|
self.validations,
|
||||||
header_params['Accept'] = self.api_client.select_header_accept(
|
(param,),
|
||||||
['application/json']) # noqa: E501
|
kwargs[param]
|
||||||
|
)
|
||||||
|
|
||||||
# HTTP header `Content-Type`
|
def __gather_params(self, kwargs):
|
||||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
params = {
|
||||||
['application/json']) # noqa: E501
|
'body': None,
|
||||||
|
'collection_format': {},
|
||||||
|
'file': {},
|
||||||
|
'form': [],
|
||||||
|
'header': {},
|
||||||
|
'path': {},
|
||||||
|
'query': []
|
||||||
|
}
|
||||||
|
|
||||||
# Authentication setting
|
for param_name, param_value in six.iteritems(kwargs):
|
||||||
auth_settings = ['api_key_query'] # noqa: E501
|
param_location = self.location_map.get(param_name)
|
||||||
|
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'):
|
||||||
|
param_location = 'file'
|
||||||
|
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:
|
||||||
|
pet_api = PetApi()
|
||||||
|
pet_api.add_pet # this is an instance of the class Endpoint
|
||||||
|
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
||||||
|
which then invokes the callable functions stored in that endpoint at
|
||||||
|
pet_api.add_pet.callable or self.callable in this class
|
||||||
|
"""
|
||||||
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
def call_with_http_info(self, **kwargs):
|
||||||
|
|
||||||
|
if kwargs.get('_host_index') and self.settings['servers']:
|
||||||
|
_host_index = kwargs.get('_host_index')
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][_host_index]
|
||||||
|
except IndexError:
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid host index. Must be 0 <= index < %s" %
|
||||||
|
len(self.settings['servers'])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][0]
|
||||||
|
except IndexError:
|
||||||
|
_host = None
|
||||||
|
|
||||||
|
for key, value in six.iteritems(kwargs):
|
||||||
|
if key not in self.params_map['all']:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected parameter '%s'"
|
||||||
|
" to method `%s`" %
|
||||||
|
(key, self.settings['operation_id'])
|
||||||
|
)
|
||||||
|
if key not in self.params_map['nullable'] and value is None:
|
||||||
|
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(
|
return self.api_client.call_api(
|
||||||
'/fake_classname_test', 'PATCH',
|
self.settings['endpoint_path'], self.settings['http_method'],
|
||||||
path_params,
|
params['path'],
|
||||||
query_params,
|
params['query'],
|
||||||
header_params,
|
params['header'],
|
||||||
body=body_params,
|
body=params['body'],
|
||||||
post_params=form_params,
|
post_params=params['form'],
|
||||||
files=local_var_files,
|
files=params['file'],
|
||||||
response_type='Client', # noqa: E501
|
response_type=self.settings['response_type'],
|
||||||
auth_settings=auth_settings,
|
auth_settings=self.settings['auth'],
|
||||||
async_req=local_var_params.get('async_req'),
|
async_req=kwargs.get('async_req'),
|
||||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
_return_http_data_only=kwargs.get('_return_http_data_only'),
|
||||||
_preload_content=local_var_params.get('_preload_content', True),
|
_preload_content=kwargs.get('_preload_content', True),
|
||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
_request_timeout=kwargs.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
_host=_host,
|
||||||
|
collection_formats=params['collection_format'])
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -18,10 +18,14 @@ import re # noqa: F401
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from petstore_api.api_client import ApiClient
|
from petstore_api.api_client import ApiClient
|
||||||
from petstore_api.exceptions import ( # noqa: F401
|
from petstore_api.exceptions import (
|
||||||
ApiTypeError,
|
ApiTypeError,
|
||||||
ApiValueError
|
ApiValueError
|
||||||
)
|
)
|
||||||
|
from petstore_api.model_utils import (
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class StoreApi(object):
|
class StoreApi(object):
|
||||||
@ -36,7 +40,7 @@ class StoreApi(object):
|
|||||||
api_client = ApiClient()
|
api_client = ApiClient()
|
||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
def delete_order(self, order_id, **kwargs): # noqa: E501
|
def __delete_order(self, order_id, **kwargs): # noqa: E501
|
||||||
"""Delete purchase order by ID # 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
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
|
||||||
@ -45,110 +49,75 @@ class StoreApi(object):
|
|||||||
>>> thread = api.delete_order(order_id, async_req=True)
|
>>> thread = api.delete_order(order_id, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
Args:
|
:param async_req bool: execute request asynchronously
|
||||||
order_id (str): ID of the order that needs to be deleted
|
:param str order_id: ID of the order that needs to be deleted (required)
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
Keyword Args:
|
code and headers
|
||||||
async_req (bool): execute request asynchronously
|
:param _preload_content: if False, the urllib3.HTTPResponse object
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
will be returned without reading/decoding response data.
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
Default is True.
|
||||||
param _request_timeout (float/tuple): timeout setting for this
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
request. If one number provided, it will be total request
|
number provided, it will be total request timeout. It can also
|
||||||
timeout. It can also be a pair (tuple) of (connection, read)
|
be a pair (tuple) of (connection, read) timeouts.
|
||||||
timeouts.
|
:return: None
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
Returns:
|
thread.
|
||||||
None:
|
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
if kwargs.get('async_req'):
|
'_return_http_data_only', True
|
||||||
return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
Args:
|
|
||||||
order_id (str): ID of the order that needs to be deleted
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
None:
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = ['order_id'] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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
|
kwargs['order_id'] = order_id
|
||||||
del local_var_params['kwargs']
|
return self.call_with_http_info(**kwargs)
|
||||||
# verify the required parameter 'order_id' is set
|
|
||||||
if ('order_id' not in local_var_params or
|
|
||||||
local_var_params['order_id'] is None):
|
|
||||||
raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
|
|
||||||
|
|
||||||
collection_formats = {}
|
self.delete_order = Endpoint(
|
||||||
|
settings={
|
||||||
|
'response_type': None,
|
||||||
|
'auth': [],
|
||||||
|
'endpoint_path': '/store/order/{order_id}',
|
||||||
|
'operation_id': 'delete_order',
|
||||||
|
'http_method': 'DELETE',
|
||||||
|
'servers': [],
|
||||||
|
},
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
path_params = {}
|
def __get_inventory(self, **kwargs): # noqa: E501
|
||||||
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
|
|
||||||
|
|
||||||
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_type=None, # noqa: E501
|
|
||||||
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)
|
|
||||||
|
|
||||||
def get_inventory(self, **kwargs): # noqa: E501
|
|
||||||
"""Returns pet inventories by status # noqa: E501
|
"""Returns pet inventories by status # noqa: E501
|
||||||
|
|
||||||
Returns a map of status codes to quantities # noqa: E501
|
Returns a map of status codes to quantities # noqa: E501
|
||||||
@ -157,106 +126,71 @@ class StoreApi(object):
|
|||||||
>>> thread = api.get_inventory(async_req=True)
|
>>> thread = api.get_inventory(async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req bool: execute request asynchronously
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
Keyword Args:
|
code and headers
|
||||||
async_req (bool): execute request asynchronously
|
:param _preload_content: if False, the urllib3.HTTPResponse object
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
will be returned without reading/decoding response data.
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
Default is True.
|
||||||
param _request_timeout (float/tuple): timeout setting for this
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
request. If one number provided, it will be total request
|
number provided, it will be total request timeout. It can also
|
||||||
timeout. It can also be a pair (tuple) of (connection, read)
|
be a pair (tuple) of (connection, read) timeouts.
|
||||||
timeouts.
|
:return: dict(str, int)
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
Returns:
|
thread.
|
||||||
dict(str, int):
|
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
if kwargs.get('async_req'):
|
'_return_http_data_only', True
|
||||||
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
dict(str, int):
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = [] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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
|
return self.call_with_http_info(**kwargs)
|
||||||
del local_var_params['kwargs']
|
|
||||||
|
|
||||||
collection_formats = {}
|
self.get_inventory = Endpoint(
|
||||||
|
settings={
|
||||||
|
'response_type': 'dict(str, int)',
|
||||||
|
'auth': [
|
||||||
|
'api_key'
|
||||||
|
],
|
||||||
|
'endpoint_path': '/store/inventory',
|
||||||
|
'operation_id': 'get_inventory',
|
||||||
|
'http_method': 'GET',
|
||||||
|
'servers': [],
|
||||||
|
},
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
path_params = {}
|
def __get_order_by_id(self, order_id, **kwargs): # 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/json']) # noqa: E501
|
|
||||||
|
|
||||||
# Authentication setting
|
|
||||||
auth_settings = ['api_key'] # noqa: E501
|
|
||||||
|
|
||||||
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_type='dict(str, int)', # noqa: E501
|
|
||||||
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)
|
|
||||||
|
|
||||||
def get_order_by_id(self, order_id, **kwargs): # noqa: E501
|
|
||||||
"""Find purchase order by ID # 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
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
|
||||||
@ -265,118 +199,84 @@ class StoreApi(object):
|
|||||||
>>> thread = api.get_order_by_id(order_id, async_req=True)
|
>>> thread = api.get_order_by_id(order_id, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
Args:
|
:param async_req bool: execute request asynchronously
|
||||||
order_id (int): ID of pet that needs to be fetched
|
:param int order_id: ID of pet that needs to be fetched (required)
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
Keyword Args:
|
code and headers
|
||||||
async_req (bool): execute request asynchronously
|
:param _preload_content: if False, the urllib3.HTTPResponse object
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
will be returned without reading/decoding response data.
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
Default is True.
|
||||||
param _request_timeout (float/tuple): timeout setting for this
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
request. If one number provided, it will be total request
|
number provided, it will be total request timeout. It can also
|
||||||
timeout. It can also be a pair (tuple) of (connection, read)
|
be a pair (tuple) of (connection, read) timeouts.
|
||||||
timeouts.
|
:return: Order
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
Returns:
|
thread.
|
||||||
Order:
|
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
if kwargs.get('async_req'):
|
'_return_http_data_only', True
|
||||||
return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
Args:
|
|
||||||
order_id (int): ID of pet that needs to be fetched
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Order:
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = ['order_id'] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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
|
kwargs['order_id'] = order_id
|
||||||
del local_var_params['kwargs']
|
return self.call_with_http_info(**kwargs)
|
||||||
# verify the required parameter 'order_id' is set
|
|
||||||
if ('order_id' not in local_var_params or
|
|
||||||
local_var_params['order_id'] is None):
|
|
||||||
raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
|
|
||||||
if '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 '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 = {}
|
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': [],
|
||||||
|
},
|
||||||
|
params_map={
|
||||||
|
'all': [
|
||||||
|
'order_id',
|
||||||
|
],
|
||||||
|
'required': [
|
||||||
|
'order_id',
|
||||||
|
],
|
||||||
|
'nullable': [
|
||||||
|
],
|
||||||
|
'enum': [
|
||||||
|
],
|
||||||
|
'validation': [
|
||||||
|
'order_id',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
root_map={
|
||||||
|
'validations': {
|
||||||
|
('order_id',): {
|
||||||
|
|
||||||
path_params = {}
|
'inclusive_maximum': 5,
|
||||||
if 'order_id' in local_var_params:
|
'inclusive_minimum': 1,
|
||||||
path_params['order_id'] = local_var_params['order_id'] # noqa: E501
|
},
|
||||||
|
},
|
||||||
|
'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
|
||||||
|
)
|
||||||
|
|
||||||
query_params = []
|
def __place_order(self, body, **kwargs): # 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
|
|
||||||
|
|
||||||
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_type='Order', # noqa: E501
|
|
||||||
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)
|
|
||||||
|
|
||||||
def place_order(self, body, **kwargs): # noqa: E501
|
|
||||||
"""Place an order for a pet # noqa: E501
|
"""Place an order for a pet # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@ -384,108 +284,259 @@ class StoreApi(object):
|
|||||||
>>> thread = api.place_order(body, async_req=True)
|
>>> thread = api.place_order(body, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
Args:
|
:param async_req bool: execute request asynchronously
|
||||||
body (Order): order placed for purchasing the pet
|
:param Order body: order placed for purchasing the pet (required)
|
||||||
|
:param _return_http_data_only: response data without head status
|
||||||
Keyword Args:
|
code and headers
|
||||||
async_req (bool): execute request asynchronously
|
:param _preload_content: if False, the urllib3.HTTPResponse object
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
will be returned without reading/decoding response data.
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
Default is True.
|
||||||
param _request_timeout (float/tuple): timeout setting for this
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
request. If one number provided, it will be total request
|
number provided, it will be total request timeout. It can also
|
||||||
timeout. It can also be a pair (tuple) of (connection, read)
|
be a pair (tuple) of (connection, read) timeouts.
|
||||||
timeouts.
|
:return: Order
|
||||||
|
If the method is called asynchronously, returns the request
|
||||||
Returns:
|
thread.
|
||||||
Order:
|
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = kwargs.get(
|
||||||
if kwargs.get('async_req'):
|
'_return_http_data_only', True
|
||||||
return self.place_order_with_http_info(body, **kwargs) # noqa: E501
|
|
||||||
else:
|
|
||||||
(data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501
|
|
||||||
return data
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
Args:
|
|
||||||
body (Order): order placed for purchasing the pet
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
async_req (bool): execute request asynchronously
|
|
||||||
param _preload_content (bool): if False, the urllib3.HTTPResponse
|
|
||||||
object will be returned without reading/decoding response data.
|
|
||||||
Default is True.
|
|
||||||
param _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.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Order:
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = ['body'] # noqa: E501
|
|
||||||
all_params.append('async_req')
|
|
||||||
all_params.append('_return_http_data_only')
|
|
||||||
all_params.append('_preload_content')
|
|
||||||
all_params.append('_request_timeout')
|
|
||||||
|
|
||||||
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
|
kwargs['body'] = body
|
||||||
del local_var_params['kwargs']
|
return self.call_with_http_info(**kwargs)
|
||||||
# verify the required parameter 'body' is set
|
|
||||||
if ('body' not in local_var_params or
|
|
||||||
local_var_params['body'] is None):
|
|
||||||
raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501
|
|
||||||
|
|
||||||
collection_formats = {}
|
self.place_order = Endpoint(
|
||||||
|
settings={
|
||||||
|
'response_type': 'Order',
|
||||||
|
'auth': [],
|
||||||
|
'endpoint_path': '/store/order',
|
||||||
|
'operation_id': 'place_order',
|
||||||
|
'http_method': 'POST',
|
||||||
|
'servers': [],
|
||||||
|
},
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
path_params = {}
|
|
||||||
|
|
||||||
query_params = []
|
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
|
||||||
|
|
||||||
header_params = {}
|
Args:
|
||||||
|
settings (dict): see below key value pairs
|
||||||
|
'response_type' (str): 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'
|
||||||
|
])
|
||||||
|
self.validations = root_map['validations']
|
||||||
|
self.allowed_values = root_map['allowed_values']
|
||||||
|
self.openapi_types = root_map['openapi_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
|
||||||
|
|
||||||
form_params = []
|
def __validate_inputs(self, kwargs):
|
||||||
local_var_files = {}
|
for param in self.params_map['enum']:
|
||||||
|
if param in kwargs:
|
||||||
|
check_allowed_values(
|
||||||
|
self.allowed_values,
|
||||||
|
(param,),
|
||||||
|
kwargs[param],
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
|
||||||
body_params = None
|
for param in self.params_map['validation']:
|
||||||
if 'body' in local_var_params:
|
if param in kwargs:
|
||||||
body_params = local_var_params['body']
|
check_validations(
|
||||||
# HTTP header `Accept`
|
self.validations,
|
||||||
header_params['Accept'] = self.api_client.select_header_accept(
|
(param,),
|
||||||
['application/xml', 'application/json']) # noqa: E501
|
kwargs[param]
|
||||||
|
)
|
||||||
|
|
||||||
# Authentication setting
|
def __gather_params(self, kwargs):
|
||||||
auth_settings = [] # noqa: E501
|
params = {
|
||||||
|
'body': None,
|
||||||
|
'collection_format': {},
|
||||||
|
'file': {},
|
||||||
|
'form': [],
|
||||||
|
'header': {},
|
||||||
|
'path': {},
|
||||||
|
'query': []
|
||||||
|
}
|
||||||
|
|
||||||
|
for param_name, param_value in six.iteritems(kwargs):
|
||||||
|
param_location = self.location_map.get(param_name)
|
||||||
|
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'):
|
||||||
|
param_location = 'file'
|
||||||
|
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:
|
||||||
|
pet_api = PetApi()
|
||||||
|
pet_api.add_pet # this is an instance of the class Endpoint
|
||||||
|
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
||||||
|
which then invokes the callable functions stored in that endpoint at
|
||||||
|
pet_api.add_pet.callable or self.callable in this class
|
||||||
|
"""
|
||||||
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
def call_with_http_info(self, **kwargs):
|
||||||
|
|
||||||
|
if kwargs.get('_host_index') and self.settings['servers']:
|
||||||
|
_host_index = kwargs.get('_host_index')
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][_host_index]
|
||||||
|
except IndexError:
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid host index. Must be 0 <= index < %s" %
|
||||||
|
len(self.settings['servers'])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
_host = self.settings['servers'][0]
|
||||||
|
except IndexError:
|
||||||
|
_host = None
|
||||||
|
|
||||||
|
for key, value in six.iteritems(kwargs):
|
||||||
|
if key not in self.params_map['all']:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected parameter '%s'"
|
||||||
|
" to method `%s`" %
|
||||||
|
(key, self.settings['operation_id'])
|
||||||
|
)
|
||||||
|
if key not in self.params_map['nullable'] and value is None:
|
||||||
|
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(
|
return self.api_client.call_api(
|
||||||
'/store/order', 'POST',
|
self.settings['endpoint_path'], self.settings['http_method'],
|
||||||
path_params,
|
params['path'],
|
||||||
query_params,
|
params['query'],
|
||||||
header_params,
|
params['header'],
|
||||||
body=body_params,
|
body=params['body'],
|
||||||
post_params=form_params,
|
post_params=params['form'],
|
||||||
files=local_var_files,
|
files=params['file'],
|
||||||
response_type='Order', # noqa: E501
|
response_type=self.settings['response_type'],
|
||||||
auth_settings=auth_settings,
|
auth_settings=self.settings['auth'],
|
||||||
async_req=local_var_params.get('async_req'),
|
async_req=kwargs.get('async_req'),
|
||||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
_return_http_data_only=kwargs.get('_return_http_data_only'),
|
||||||
_preload_content=local_var_params.get('_preload_content', True),
|
_preload_content=kwargs.get('_preload_content', True),
|
||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
_request_timeout=kwargs.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
_host=_host,
|
||||||
|
collection_formats=params['collection_format'])
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,7 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import inspect
|
||||||
import json
|
import json
|
||||||
import mimetypes
|
import mimetypes
|
||||||
from multiprocessing.pool import ThreadPool
|
from multiprocessing.pool import ThreadPool
|
||||||
@ -22,9 +23,13 @@ import tempfile
|
|||||||
import six
|
import six
|
||||||
from six.moves.urllib.parse import quote
|
from six.moves.urllib.parse import quote
|
||||||
|
|
||||||
from petstore_api.configuration import Configuration
|
|
||||||
import petstore_api.models
|
import petstore_api.models
|
||||||
from petstore_api import rest
|
from petstore_api import rest
|
||||||
|
from petstore_api.configuration import Configuration
|
||||||
|
from petstore_api.model_utils import (
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple
|
||||||
|
)
|
||||||
from petstore_api.exceptions import ApiValueError
|
from petstore_api.exceptions import ApiValueError
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +221,7 @@ class ApiClient(object):
|
|||||||
|
|
||||||
if isinstance(obj, dict):
|
if isinstance(obj, dict):
|
||||||
obj_dict = obj
|
obj_dict = obj
|
||||||
else:
|
elif isinstance(obj, ModelNormal):
|
||||||
# Convert model obj to dict except
|
# Convert model obj to dict except
|
||||||
# attributes `openapi_types`, `attribute_map`
|
# attributes `openapi_types`, `attribute_map`
|
||||||
# and attributes which value is not None.
|
# and attributes which value is not None.
|
||||||
@ -225,6 +230,8 @@ class ApiClient(object):
|
|||||||
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
||||||
for attr, _ in six.iteritems(obj.openapi_types)
|
for attr, _ in six.iteritems(obj.openapi_types)
|
||||||
if getattr(obj, attr) is not None}
|
if getattr(obj, attr) is not None}
|
||||||
|
elif isinstance(obj, ModelSimple):
|
||||||
|
return self.sanitize_for_serialization(obj.value)
|
||||||
|
|
||||||
return {key: self.sanitize_for_serialization(val)
|
return {key: self.sanitize_for_serialization(val)
|
||||||
for key, val in six.iteritems(obj_dict)}
|
for key, val in six.iteritems(obj_dict)}
|
||||||
@ -563,6 +570,8 @@ class ApiClient(object):
|
|||||||
return six.text_type(data)
|
return six.text_type(data)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return data
|
return data
|
||||||
|
except ValueError as exc:
|
||||||
|
raise ApiValueError(str(exc))
|
||||||
|
|
||||||
def __deserialize_object(self, value):
|
def __deserialize_object(self, value):
|
||||||
"""Return an original value.
|
"""Return an original value.
|
||||||
@ -614,25 +623,39 @@ class ApiClient(object):
|
|||||||
"""Deserializes list or dict to model.
|
"""Deserializes list or dict to model.
|
||||||
|
|
||||||
:param data: dict, list.
|
:param data: dict, list.
|
||||||
:param klass: class literal.
|
:param klass: class literal, ModelSimple or ModelNormal
|
||||||
:return: model object.
|
:return: model object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not klass.openapi_types and not hasattr(klass,
|
if issubclass(klass, ModelSimple):
|
||||||
'get_real_child_model'):
|
value = self.__deserialize(data, klass.openapi_types['value'])
|
||||||
return data
|
return klass(value)
|
||||||
|
|
||||||
kwargs = {}
|
# code to handle ModelNormal
|
||||||
|
used_data = data
|
||||||
|
if not isinstance(data, (list, dict)):
|
||||||
|
used_data = [data]
|
||||||
|
keyword_args = {}
|
||||||
|
positional_args = []
|
||||||
if klass.openapi_types is not None:
|
if klass.openapi_types is not None:
|
||||||
for attr, attr_type in six.iteritems(klass.openapi_types):
|
for attr, attr_type in six.iteritems(klass.openapi_types):
|
||||||
if (data is not None and
|
if (data is not None and
|
||||||
klass.attribute_map[attr] in data and
|
klass.attribute_map[attr] in used_data):
|
||||||
isinstance(data, (list, dict))):
|
value = used_data[klass.attribute_map[attr]]
|
||||||
value = data[klass.attribute_map[attr]]
|
keyword_args[attr] = self.__deserialize(value, attr_type)
|
||||||
kwargs[attr] = self.__deserialize(value, attr_type)
|
end_index = None
|
||||||
|
argspec = inspect.getargspec(getattr(klass, '__init__'))
|
||||||
instance = klass(**kwargs)
|
if argspec.defaults:
|
||||||
|
end_index = -len(argspec.defaults)
|
||||||
|
required_positional_args = argspec.args[1:end_index]
|
||||||
|
for index, req_positional_arg in enumerate(required_positional_args):
|
||||||
|
if keyword_args and req_positional_arg in keyword_args:
|
||||||
|
positional_args.append(keyword_args[req_positional_arg])
|
||||||
|
del keyword_args[req_positional_arg]
|
||||||
|
elif (not keyword_args and index < len(used_data) and
|
||||||
|
isinstance(used_data, list)):
|
||||||
|
positional_args.append(used_data[index])
|
||||||
|
instance = klass(*positional_args, **keyword_args)
|
||||||
if hasattr(instance, 'get_real_child_model'):
|
if hasattr(instance, 'get_real_child_model'):
|
||||||
klass_name = instance.get_real_child_model(data)
|
klass_name = instance.get_real_child_model(data)
|
||||||
if klass_name:
|
if klass_name:
|
||||||
|
@ -67,6 +67,9 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|||||||
self.api_key_prefix = api_key_prefix
|
self.api_key_prefix = api_key_prefix
|
||||||
"""dict to store API prefix (e.g. Bearer)
|
"""dict to store API prefix (e.g. Bearer)
|
||||||
"""
|
"""
|
||||||
|
self.refresh_api_key_hook = None
|
||||||
|
"""function hook to refresh API key if expired
|
||||||
|
"""
|
||||||
self.username = username
|
self.username = username
|
||||||
"""Username for HTTP basic authentication
|
"""Username for HTTP basic authentication
|
||||||
"""
|
"""
|
||||||
@ -227,11 +230,15 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|||||||
:param identifier: The identifier of apiKey.
|
:param identifier: The identifier of apiKey.
|
||||||
:return: The token for api key authentication.
|
:return: The token for api key authentication.
|
||||||
"""
|
"""
|
||||||
if (self.api_key.get(identifier) and
|
if self.refresh_api_key_hook is not None:
|
||||||
self.api_key_prefix.get(identifier)):
|
self.refresh_api_key_hook(self)
|
||||||
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501
|
key = self.api_key.get(identifier)
|
||||||
elif self.api_key.get(identifier):
|
if key:
|
||||||
return self.api_key[identifier]
|
prefix = self.api_key_prefix.get(identifier)
|
||||||
|
if prefix:
|
||||||
|
return "%s %s" % (prefix, key)
|
||||||
|
else:
|
||||||
|
return key
|
||||||
|
|
||||||
def get_basic_auth_token(self):
|
def get_basic_auth_token(self):
|
||||||
"""Gets HTTP basic authentication header (string).
|
"""Gets HTTP basic authentication header (string).
|
||||||
|
@ -0,0 +1,183 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError
|
||||||
|
|
||||||
|
|
||||||
|
def check_allowed_values(allowed_values, input_variable_path, input_values,
|
||||||
|
validations):
|
||||||
|
"""Raises an exception if the input_values are not allowed
|
||||||
|
|
||||||
|
Args:
|
||||||
|
allowed_values (dict): the allowed_values dict
|
||||||
|
input_variable_path (tuple): the path to the input variable
|
||||||
|
input_values (list/str/int/float/date/datetime): the values that we
|
||||||
|
are checking to see if they are in allowed_values
|
||||||
|
validations (dict): the validations dict
|
||||||
|
"""
|
||||||
|
min_collection_length = (
|
||||||
|
validations.get(input_variable_path, {}).get('min_length') or
|
||||||
|
validations.get(input_variable_path, {}).get('min_items', 0))
|
||||||
|
these_allowed_values = list(allowed_values[input_variable_path].values())
|
||||||
|
if (isinstance(input_values, list)
|
||||||
|
and len(input_values) > min_collection_length
|
||||||
|
and not set(input_values).issubset(
|
||||||
|
set(these_allowed_values))):
|
||||||
|
invalid_values = ", ".join(
|
||||||
|
map(str, set(input_values) - set(these_allowed_values))),
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid values for `%s` [%s], must be a subset of [%s]" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
invalid_values,
|
||||||
|
", ".join(map(str, these_allowed_values))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif (isinstance(input_values, dict)
|
||||||
|
and len(input_values) > min_collection_length
|
||||||
|
and not set(
|
||||||
|
input_values.keys()).issubset(set(these_allowed_values))):
|
||||||
|
invalid_values = ", ".join(
|
||||||
|
map(str, set(input_values.keys()) - set(these_allowed_values)))
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid keys in `%s` [%s], must be a subset of [%s]" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
invalid_values,
|
||||||
|
", ".join(map(str, these_allowed_values))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif (not isinstance(input_values, (list, dict))
|
||||||
|
and input_values not in these_allowed_values):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s` (%s), must be one of %s" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
input_values,
|
||||||
|
these_allowed_values
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def check_validations(validations, input_variable_path, input_values):
|
||||||
|
"""Raises an exception if the input_values are invalid
|
||||||
|
|
||||||
|
Args:
|
||||||
|
validations (dict): the validation dictionary
|
||||||
|
input_variable_path (tuple): the path to the input variable
|
||||||
|
input_values (list/str/int/float/date/datetime): the values that we
|
||||||
|
are checking
|
||||||
|
"""
|
||||||
|
current_validations = validations[input_variable_path]
|
||||||
|
if ('max_length' in current_validations and
|
||||||
|
len(input_values) > current_validations['max_length']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, length must be less than or equal to "
|
||||||
|
"`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['max_length']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('min_length' in current_validations and
|
||||||
|
len(input_values) < current_validations['min_length']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, length must be greater than or equal to "
|
||||||
|
"`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['min_length']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('max_items' in current_validations and
|
||||||
|
len(input_values) > current_validations['max_items']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, number of items must be less than or "
|
||||||
|
"equal to `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['max_items']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('min_items' in current_validations and
|
||||||
|
len(input_values) < current_validations['min_items']):
|
||||||
|
raise ValueError(
|
||||||
|
"Invalid value for `%s`, number of items must be greater than or "
|
||||||
|
"equal to `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['min_items']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('exclusive_maximum' in current_validations and
|
||||||
|
input_values >= current_validations['exclusive_maximum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value less than `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['exclusive_maximum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('inclusive_maximum' in current_validations and
|
||||||
|
input_values > current_validations['inclusive_maximum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value less than or equal to "
|
||||||
|
"`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['inclusive_maximum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('exclusive_minimum' in current_validations and
|
||||||
|
input_values <= current_validations['exclusive_minimum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value greater than `%s`" %
|
||||||
|
(
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['exclusive_maximum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ('inclusive_minimum' in current_validations and
|
||||||
|
input_values < current_validations['inclusive_minimum']):
|
||||||
|
raise ApiValueError(
|
||||||
|
"Invalid value for `%s`, must be a value greater than or equal "
|
||||||
|
"to `%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['inclusive_minimum']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
flags = current_validations.get('regex', {}).get('flags', 0)
|
||||||
|
if ('regex' in current_validations and
|
||||||
|
not re.search(current_validations['regex']['pattern'],
|
||||||
|
input_values, flags=flags)):
|
||||||
|
raise ApiValueError(
|
||||||
|
r"Invalid value for `%s`, must be a follow pattern or equal to "
|
||||||
|
r"`%s` with flags=`%s`" % (
|
||||||
|
input_variable_path[0],
|
||||||
|
current_validations['regex']['pattern'],
|
||||||
|
flags
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ModelSimple(object):
|
||||||
|
# the parent class of models whose type != object in their swagger/openapi
|
||||||
|
# spec
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ModelNormal(object):
|
||||||
|
# the parent class of models whose type == object in their swagger/openapi
|
||||||
|
# spec
|
||||||
|
pass
|
@ -52,9 +52,11 @@ from petstore_api.models.number_only import NumberOnly
|
|||||||
from petstore_api.models.order import Order
|
from petstore_api.models.order import Order
|
||||||
from petstore_api.models.outer_composite import OuterComposite
|
from petstore_api.models.outer_composite import OuterComposite
|
||||||
from petstore_api.models.outer_enum import OuterEnum
|
from petstore_api.models.outer_enum import OuterEnum
|
||||||
|
from petstore_api.models.outer_number import OuterNumber
|
||||||
from petstore_api.models.pet import Pet
|
from petstore_api.models.pet import Pet
|
||||||
from petstore_api.models.read_only_first import ReadOnlyFirst
|
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||||
from petstore_api.models.special_model_name import SpecialModelName
|
from petstore_api.models.special_model_name import SpecialModelName
|
||||||
|
from petstore_api.models.string_boolean_map import StringBooleanMap
|
||||||
from petstore_api.models.tag import Tag
|
from petstore_api.models.tag import Tag
|
||||||
from petstore_api.models.type_holder_default import TypeHolderDefault
|
from petstore_api.models.type_holder_default import TypeHolderDefault
|
||||||
from petstore_api.models.type_holder_example import TypeHolderExample
|
from petstore_api.models.type_holder_example import TypeHolderExample
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesAnyType(object):
|
class AdditionalPropertiesAnyType(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesAnyType - a model defined in OpenAPI
|
"""AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesAnyType(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesAnyType.
|
"""Sets the name of this AdditionalPropertiesAnyType.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesAnyType(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesArray(object):
|
class AdditionalPropertiesArray(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesArray - a model defined in OpenAPI
|
"""AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesArray(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesArray.
|
"""Sets the name of this AdditionalPropertiesArray.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesArray(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesBoolean(object):
|
class AdditionalPropertiesBoolean(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesBoolean - a model defined in OpenAPI
|
"""AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesBoolean(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesBoolean.
|
"""Sets the name of this AdditionalPropertiesBoolean.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesBoolean(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,38 +10,45 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesClass(object):
|
class AdditionalPropertiesClass(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'map_string': 'dict(str, str)',
|
allowed_values = {
|
||||||
'map_number': 'dict(str, float)',
|
|
||||||
'map_integer': 'dict(str, int)',
|
|
||||||
'map_boolean': 'dict(str, bool)',
|
|
||||||
'map_array_integer': 'dict(str, list[int])',
|
|
||||||
'map_array_anytype': 'dict(str, list[object])',
|
|
||||||
'map_map_string': 'dict(str, dict(str, str))',
|
|
||||||
'map_map_anytype': 'dict(str, dict(str, object))',
|
|
||||||
'anytype_1': 'object',
|
|
||||||
'anytype_2': 'object',
|
|
||||||
'anytype_3': 'object',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -55,27 +62,28 @@ class AdditionalPropertiesClass(object):
|
|||||||
'map_map_anytype': 'map_map_anytype', # noqa: E501
|
'map_map_anytype': 'map_map_anytype', # noqa: E501
|
||||||
'anytype_1': 'anytype_1', # noqa: E501
|
'anytype_1': 'anytype_1', # noqa: E501
|
||||||
'anytype_2': 'anytype_2', # noqa: E501
|
'anytype_2': 'anytype_2', # noqa: E501
|
||||||
'anytype_3': 'anytype_3', # noqa: E501
|
'anytype_3': 'anytype_3' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'map_string': 'dict(str, str)',
|
||||||
|
'map_number': 'dict(str, float)',
|
||||||
|
'map_integer': 'dict(str, int)',
|
||||||
|
'map_boolean': 'dict(str, bool)',
|
||||||
|
'map_array_integer': 'dict(str, list[int])',
|
||||||
|
'map_array_anytype': 'dict(str, list[object])',
|
||||||
|
'map_map_string': 'dict(str, dict(str, str))',
|
||||||
|
'map_map_anytype': 'dict(str, dict(str, object))',
|
||||||
|
'anytype_1': 'object',
|
||||||
|
'anytype_2': 'object',
|
||||||
|
'anytype_3': 'object'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501
|
def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501
|
||||||
"""AdditionalPropertiesClass - a model defined in OpenAPI
|
"""AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
map_string (dict(str, str)): [optional] # noqa: E501
|
|
||||||
map_number (dict(str, float)): [optional] # noqa: E501
|
|
||||||
map_integer (dict(str, int)): [optional] # noqa: E501
|
|
||||||
map_boolean (dict(str, bool)): [optional] # noqa: E501
|
|
||||||
map_array_integer (dict(str, list[int])): [optional] # noqa: E501
|
|
||||||
map_array_anytype (dict(str, list[object])): [optional] # noqa: E501
|
|
||||||
map_map_string (dict(str, dict(str, str))): [optional] # noqa: E501
|
|
||||||
map_map_anytype (dict(str, dict(str, object))): [optional] # noqa: E501
|
|
||||||
anytype_1 (object): [optional] # noqa: E501
|
|
||||||
anytype_2 (object): [optional] # noqa: E501
|
|
||||||
anytype_3 (object): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._map_string = None
|
self._map_string = None
|
||||||
self._map_number = None
|
self._map_number = None
|
||||||
@ -91,27 +99,49 @@ class AdditionalPropertiesClass(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if map_string is not None:
|
if map_string is not None:
|
||||||
self.map_string = map_string # noqa: E501
|
self.map_string = (
|
||||||
|
map_string
|
||||||
|
)
|
||||||
if map_number is not None:
|
if map_number is not None:
|
||||||
self.map_number = map_number # noqa: E501
|
self.map_number = (
|
||||||
|
map_number
|
||||||
|
)
|
||||||
if map_integer is not None:
|
if map_integer is not None:
|
||||||
self.map_integer = map_integer # noqa: E501
|
self.map_integer = (
|
||||||
|
map_integer
|
||||||
|
)
|
||||||
if map_boolean is not None:
|
if map_boolean is not None:
|
||||||
self.map_boolean = map_boolean # noqa: E501
|
self.map_boolean = (
|
||||||
|
map_boolean
|
||||||
|
)
|
||||||
if map_array_integer is not None:
|
if map_array_integer is not None:
|
||||||
self.map_array_integer = map_array_integer # noqa: E501
|
self.map_array_integer = (
|
||||||
|
map_array_integer
|
||||||
|
)
|
||||||
if map_array_anytype is not None:
|
if map_array_anytype is not None:
|
||||||
self.map_array_anytype = map_array_anytype # noqa: E501
|
self.map_array_anytype = (
|
||||||
|
map_array_anytype
|
||||||
|
)
|
||||||
if map_map_string is not None:
|
if map_map_string is not None:
|
||||||
self.map_map_string = map_map_string # noqa: E501
|
self.map_map_string = (
|
||||||
|
map_map_string
|
||||||
|
)
|
||||||
if map_map_anytype is not None:
|
if map_map_anytype is not None:
|
||||||
self.map_map_anytype = map_map_anytype # noqa: E501
|
self.map_map_anytype = (
|
||||||
|
map_map_anytype
|
||||||
|
)
|
||||||
if anytype_1 is not None:
|
if anytype_1 is not None:
|
||||||
self.anytype_1 = anytype_1 # noqa: E501
|
self.anytype_1 = (
|
||||||
|
anytype_1
|
||||||
|
)
|
||||||
if anytype_2 is not None:
|
if anytype_2 is not None:
|
||||||
self.anytype_2 = anytype_2 # noqa: E501
|
self.anytype_2 = (
|
||||||
|
anytype_2
|
||||||
|
)
|
||||||
if anytype_3 is not None:
|
if anytype_3 is not None:
|
||||||
self.anytype_3 = anytype_3 # noqa: E501
|
self.anytype_3 = (
|
||||||
|
anytype_3
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_string(self):
|
def map_string(self):
|
||||||
@ -124,9 +154,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_string
|
return self._map_string
|
||||||
|
|
||||||
@map_string.setter
|
@map_string.setter
|
||||||
def map_string(
|
def map_string(self, map_string): # noqa: E501
|
||||||
self,
|
|
||||||
map_string):
|
|
||||||
"""Sets the map_string of this AdditionalPropertiesClass.
|
"""Sets the map_string of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +163,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_string = (
|
self._map_string = (
|
||||||
map_string)
|
map_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_number(self):
|
def map_number(self):
|
||||||
@ -148,9 +177,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_number
|
return self._map_number
|
||||||
|
|
||||||
@map_number.setter
|
@map_number.setter
|
||||||
def map_number(
|
def map_number(self, map_number): # noqa: E501
|
||||||
self,
|
|
||||||
map_number):
|
|
||||||
"""Sets the map_number of this AdditionalPropertiesClass.
|
"""Sets the map_number of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -159,7 +186,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_number = (
|
self._map_number = (
|
||||||
map_number)
|
map_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_integer(self):
|
def map_integer(self):
|
||||||
@ -172,9 +200,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_integer
|
return self._map_integer
|
||||||
|
|
||||||
@map_integer.setter
|
@map_integer.setter
|
||||||
def map_integer(
|
def map_integer(self, map_integer): # noqa: E501
|
||||||
self,
|
|
||||||
map_integer):
|
|
||||||
"""Sets the map_integer of this AdditionalPropertiesClass.
|
"""Sets the map_integer of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -183,7 +209,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_integer = (
|
self._map_integer = (
|
||||||
map_integer)
|
map_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_boolean(self):
|
def map_boolean(self):
|
||||||
@ -196,9 +223,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_boolean
|
return self._map_boolean
|
||||||
|
|
||||||
@map_boolean.setter
|
@map_boolean.setter
|
||||||
def map_boolean(
|
def map_boolean(self, map_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
map_boolean):
|
|
||||||
"""Sets the map_boolean of this AdditionalPropertiesClass.
|
"""Sets the map_boolean of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +232,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_boolean = (
|
self._map_boolean = (
|
||||||
map_boolean)
|
map_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_array_integer(self):
|
def map_array_integer(self):
|
||||||
@ -220,9 +246,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_array_integer
|
return self._map_array_integer
|
||||||
|
|
||||||
@map_array_integer.setter
|
@map_array_integer.setter
|
||||||
def map_array_integer(
|
def map_array_integer(self, map_array_integer): # noqa: E501
|
||||||
self,
|
|
||||||
map_array_integer):
|
|
||||||
"""Sets the map_array_integer of this AdditionalPropertiesClass.
|
"""Sets the map_array_integer of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -231,7 +255,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_array_integer = (
|
self._map_array_integer = (
|
||||||
map_array_integer)
|
map_array_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_array_anytype(self):
|
def map_array_anytype(self):
|
||||||
@ -244,9 +269,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_array_anytype
|
return self._map_array_anytype
|
||||||
|
|
||||||
@map_array_anytype.setter
|
@map_array_anytype.setter
|
||||||
def map_array_anytype(
|
def map_array_anytype(self, map_array_anytype): # noqa: E501
|
||||||
self,
|
|
||||||
map_array_anytype):
|
|
||||||
"""Sets the map_array_anytype of this AdditionalPropertiesClass.
|
"""Sets the map_array_anytype of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -255,7 +278,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_array_anytype = (
|
self._map_array_anytype = (
|
||||||
map_array_anytype)
|
map_array_anytype
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_map_string(self):
|
def map_map_string(self):
|
||||||
@ -268,9 +292,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_map_string
|
return self._map_map_string
|
||||||
|
|
||||||
@map_map_string.setter
|
@map_map_string.setter
|
||||||
def map_map_string(
|
def map_map_string(self, map_map_string): # noqa: E501
|
||||||
self,
|
|
||||||
map_map_string):
|
|
||||||
"""Sets the map_map_string of this AdditionalPropertiesClass.
|
"""Sets the map_map_string of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -279,7 +301,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_map_string = (
|
self._map_map_string = (
|
||||||
map_map_string)
|
map_map_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_map_anytype(self):
|
def map_map_anytype(self):
|
||||||
@ -292,9 +315,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._map_map_anytype
|
return self._map_map_anytype
|
||||||
|
|
||||||
@map_map_anytype.setter
|
@map_map_anytype.setter
|
||||||
def map_map_anytype(
|
def map_map_anytype(self, map_map_anytype): # noqa: E501
|
||||||
self,
|
|
||||||
map_map_anytype):
|
|
||||||
"""Sets the map_map_anytype of this AdditionalPropertiesClass.
|
"""Sets the map_map_anytype of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -303,7 +324,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_map_anytype = (
|
self._map_map_anytype = (
|
||||||
map_map_anytype)
|
map_map_anytype
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def anytype_1(self):
|
def anytype_1(self):
|
||||||
@ -316,9 +338,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._anytype_1
|
return self._anytype_1
|
||||||
|
|
||||||
@anytype_1.setter
|
@anytype_1.setter
|
||||||
def anytype_1(
|
def anytype_1(self, anytype_1): # noqa: E501
|
||||||
self,
|
|
||||||
anytype_1):
|
|
||||||
"""Sets the anytype_1 of this AdditionalPropertiesClass.
|
"""Sets the anytype_1 of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -327,7 +347,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._anytype_1 = (
|
self._anytype_1 = (
|
||||||
anytype_1)
|
anytype_1
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def anytype_2(self):
|
def anytype_2(self):
|
||||||
@ -340,9 +361,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._anytype_2
|
return self._anytype_2
|
||||||
|
|
||||||
@anytype_2.setter
|
@anytype_2.setter
|
||||||
def anytype_2(
|
def anytype_2(self, anytype_2): # noqa: E501
|
||||||
self,
|
|
||||||
anytype_2):
|
|
||||||
"""Sets the anytype_2 of this AdditionalPropertiesClass.
|
"""Sets the anytype_2 of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -351,7 +370,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._anytype_2 = (
|
self._anytype_2 = (
|
||||||
anytype_2)
|
anytype_2
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def anytype_3(self):
|
def anytype_3(self):
|
||||||
@ -364,9 +384,7 @@ class AdditionalPropertiesClass(object):
|
|||||||
return self._anytype_3
|
return self._anytype_3
|
||||||
|
|
||||||
@anytype_3.setter
|
@anytype_3.setter
|
||||||
def anytype_3(
|
def anytype_3(self, anytype_3): # noqa: E501
|
||||||
self,
|
|
||||||
anytype_3):
|
|
||||||
"""Sets the anytype_3 of this AdditionalPropertiesClass.
|
"""Sets the anytype_3 of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -375,7 +393,8 @@ class AdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._anytype_3 = (
|
self._anytype_3 = (
|
||||||
anytype_3)
|
anytype_3
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesInteger(object):
|
class AdditionalPropertiesInteger(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesInteger - a model defined in OpenAPI
|
"""AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesInteger(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesInteger.
|
"""Sets the name of this AdditionalPropertiesInteger.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesInteger(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesNumber(object):
|
class AdditionalPropertiesNumber(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesNumber - a model defined in OpenAPI
|
"""AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesNumber(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesNumber.
|
"""Sets the name of this AdditionalPropertiesNumber.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesNumber(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesObject(object):
|
class AdditionalPropertiesObject(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesObject - a model defined in OpenAPI
|
"""AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesObject(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesObject.
|
"""Sets the name of this AdditionalPropertiesObject.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesObject(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AdditionalPropertiesString(object):
|
class AdditionalPropertiesString(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None): # noqa: E501
|
def __init__(self, name=None): # noqa: E501
|
||||||
"""AdditionalPropertiesString - a model defined in OpenAPI
|
"""AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,9 +84,7 @@ class AdditionalPropertiesString(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this AdditionalPropertiesString.
|
"""Sets the name of this AdditionalPropertiesString.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class AdditionalPropertiesString(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,34 +10,50 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Animal(object):
|
class Animal(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'class_name': 'str',
|
allowed_values = {
|
||||||
'color': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'class_name': 'className', # noqa: E501
|
'class_name': 'className', # noqa: E501
|
||||||
'color': 'color', # noqa: E501
|
'color': 'color' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
discriminator_value_class_map = {
|
discriminator_value_class_map = {
|
||||||
@ -45,15 +61,16 @@ class Animal(object):
|
|||||||
'Cat': 'Cat'
|
'Cat': 'Cat'
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, class_name, color=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Animal - a model defined in OpenAPI
|
'class_name': 'str',
|
||||||
|
'color': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
class_name (str):
|
}
|
||||||
|
|
||||||
Keyword Args: # noqa: E501
|
def __init__(self, class_name=None, color='red'): # noqa: E501
|
||||||
color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501
|
"""Animal - a model defined in OpenAPI""" # noqa: E501
|
||||||
"""
|
|
||||||
|
|
||||||
self._class_name = None
|
self._class_name = None
|
||||||
self._color = None
|
self._color = None
|
||||||
@ -61,7 +78,9 @@ class Animal(object):
|
|||||||
|
|
||||||
self.class_name = class_name
|
self.class_name = class_name
|
||||||
if color is not None:
|
if color is not None:
|
||||||
self.color = color # noqa: E501
|
self.color = (
|
||||||
|
color
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def class_name(self):
|
def class_name(self):
|
||||||
@ -74,9 +93,7 @@ class Animal(object):
|
|||||||
return self._class_name
|
return self._class_name
|
||||||
|
|
||||||
@class_name.setter
|
@class_name.setter
|
||||||
def class_name(
|
def class_name(self, class_name): # noqa: E501
|
||||||
self,
|
|
||||||
class_name):
|
|
||||||
"""Sets the class_name of this Animal.
|
"""Sets the class_name of this Animal.
|
||||||
|
|
||||||
|
|
||||||
@ -84,10 +101,11 @@ class Animal(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if class_name is None:
|
if class_name is None:
|
||||||
raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._class_name = (
|
self._class_name = (
|
||||||
class_name)
|
class_name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def color(self):
|
def color(self):
|
||||||
@ -100,9 +118,7 @@ class Animal(object):
|
|||||||
return self._color
|
return self._color
|
||||||
|
|
||||||
@color.setter
|
@color.setter
|
||||||
def color(
|
def color(self, color): # noqa: E501
|
||||||
self,
|
|
||||||
color):
|
|
||||||
"""Sets the color of this Animal.
|
"""Sets the color of this Animal.
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +127,8 @@ class Animal(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._color = (
|
self._color = (
|
||||||
color)
|
color
|
||||||
|
)
|
||||||
|
|
||||||
def get_real_child_model(self, data):
|
def get_real_child_model(self, data):
|
||||||
"""Returns the real base class specified by the discriminator"""
|
"""Returns the real base class specified by the discriminator"""
|
||||||
|
@ -10,48 +10,64 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ApiResponse(object):
|
class ApiResponse(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'code': 'int',
|
allowed_values = {
|
||||||
'type': 'str',
|
|
||||||
'message': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'code': 'code', # noqa: E501
|
'code': 'code', # noqa: E501
|
||||||
'type': 'type', # noqa: E501
|
'type': 'type', # noqa: E501
|
||||||
'message': 'message', # noqa: E501
|
'message': 'message' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'code': 'int',
|
||||||
|
'type': 'str',
|
||||||
|
'message': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, code=None, type=None, message=None): # noqa: E501
|
def __init__(self, code=None, type=None, message=None): # noqa: E501
|
||||||
"""ApiResponse - a model defined in OpenAPI
|
"""ApiResponse - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
code (int): [optional] # noqa: E501
|
|
||||||
type (str): [optional] # noqa: E501
|
|
||||||
message (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._code = None
|
self._code = None
|
||||||
self._type = None
|
self._type = None
|
||||||
@ -59,11 +75,17 @@ class ApiResponse(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if code is not None:
|
if code is not None:
|
||||||
self.code = code # noqa: E501
|
self.code = (
|
||||||
|
code
|
||||||
|
)
|
||||||
if type is not None:
|
if type is not None:
|
||||||
self.type = type # noqa: E501
|
self.type = (
|
||||||
|
type
|
||||||
|
)
|
||||||
if message is not None:
|
if message is not None:
|
||||||
self.message = message # noqa: E501
|
self.message = (
|
||||||
|
message
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code(self):
|
def code(self):
|
||||||
@ -76,9 +98,7 @@ class ApiResponse(object):
|
|||||||
return self._code
|
return self._code
|
||||||
|
|
||||||
@code.setter
|
@code.setter
|
||||||
def code(
|
def code(self, code): # noqa: E501
|
||||||
self,
|
|
||||||
code):
|
|
||||||
"""Sets the code of this ApiResponse.
|
"""Sets the code of this ApiResponse.
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +107,8 @@ class ApiResponse(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._code = (
|
self._code = (
|
||||||
code)
|
code
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type(self):
|
def type(self):
|
||||||
@ -100,9 +121,7 @@ class ApiResponse(object):
|
|||||||
return self._type
|
return self._type
|
||||||
|
|
||||||
@type.setter
|
@type.setter
|
||||||
def type(
|
def type(self, type): # noqa: E501
|
||||||
self,
|
|
||||||
type):
|
|
||||||
"""Sets the type of this ApiResponse.
|
"""Sets the type of this ApiResponse.
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +130,8 @@ class ApiResponse(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._type = (
|
self._type = (
|
||||||
type)
|
type
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def message(self):
|
def message(self):
|
||||||
@ -124,9 +144,7 @@ class ApiResponse(object):
|
|||||||
return self._message
|
return self._message
|
||||||
|
|
||||||
@message.setter
|
@message.setter
|
||||||
def message(
|
def message(self, message): # noqa: E501
|
||||||
self,
|
|
||||||
message):
|
|
||||||
"""Sets the message of this ApiResponse.
|
"""Sets the message of this ApiResponse.
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +153,8 @@ class ApiResponse(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._message = (
|
self._message = (
|
||||||
message)
|
message
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ArrayOfArrayOfNumberOnly(object):
|
class ArrayOfArrayOfNumberOnly(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'array_array_number': 'list[list[float]]',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'array_array_number': 'ArrayArrayNumber', # noqa: E501
|
'array_array_number': 'ArrayArrayNumber' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'array_array_number': 'list[list[float]]'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, array_array_number=None): # noqa: E501
|
def __init__(self, array_array_number=None): # noqa: E501
|
||||||
"""ArrayOfArrayOfNumberOnly - a model defined in OpenAPI
|
"""ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
array_array_number (list[list[float]]): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._array_array_number = None
|
self._array_array_number = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if array_array_number is not None:
|
if array_array_number is not None:
|
||||||
self.array_array_number = array_array_number # noqa: E501
|
self.array_array_number = (
|
||||||
|
array_array_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_array_number(self):
|
def array_array_number(self):
|
||||||
@ -64,9 +84,7 @@ class ArrayOfArrayOfNumberOnly(object):
|
|||||||
return self._array_array_number
|
return self._array_array_number
|
||||||
|
|
||||||
@array_array_number.setter
|
@array_array_number.setter
|
||||||
def array_array_number(
|
def array_array_number(self, array_array_number): # noqa: E501
|
||||||
self,
|
|
||||||
array_array_number):
|
|
||||||
"""Sets the array_array_number of this ArrayOfArrayOfNumberOnly.
|
"""Sets the array_array_number of this ArrayOfArrayOfNumberOnly.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class ArrayOfArrayOfNumberOnly(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._array_array_number = (
|
self._array_array_number = (
|
||||||
array_array_number)
|
array_array_number
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ArrayOfNumberOnly(object):
|
class ArrayOfNumberOnly(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'array_number': 'list[float]',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'array_number': 'ArrayNumber', # noqa: E501
|
'array_number': 'ArrayNumber' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'array_number': 'list[float]'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, array_number=None): # noqa: E501
|
def __init__(self, array_number=None): # noqa: E501
|
||||||
"""ArrayOfNumberOnly - a model defined in OpenAPI
|
"""ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
array_number (list[float]): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._array_number = None
|
self._array_number = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if array_number is not None:
|
if array_number is not None:
|
||||||
self.array_number = array_number # noqa: E501
|
self.array_number = (
|
||||||
|
array_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_number(self):
|
def array_number(self):
|
||||||
@ -64,9 +84,7 @@ class ArrayOfNumberOnly(object):
|
|||||||
return self._array_number
|
return self._array_number
|
||||||
|
|
||||||
@array_number.setter
|
@array_number.setter
|
||||||
def array_number(
|
def array_number(self, array_number): # noqa: E501
|
||||||
self,
|
|
||||||
array_number):
|
|
||||||
"""Sets the array_number of this ArrayOfNumberOnly.
|
"""Sets the array_number of this ArrayOfNumberOnly.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class ArrayOfNumberOnly(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._array_number = (
|
self._array_number = (
|
||||||
array_number)
|
array_number
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,64 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ArrayTest(object):
|
class ArrayTest(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'array_of_string': 'list[str]',
|
allowed_values = {
|
||||||
'array_array_of_integer': 'list[list[int]]',
|
|
||||||
'array_array_of_model': 'list[list[ReadOnlyFirst]]',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'array_of_string': 'array_of_string', # noqa: E501
|
'array_of_string': 'array_of_string', # noqa: E501
|
||||||
'array_array_of_integer': 'array_array_of_integer', # noqa: E501
|
'array_array_of_integer': 'array_array_of_integer', # noqa: E501
|
||||||
'array_array_of_model': 'array_array_of_model', # noqa: E501
|
'array_array_of_model': 'array_array_of_model' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'array_of_string': 'list[str]',
|
||||||
|
'array_array_of_integer': 'list[list[int]]',
|
||||||
|
'array_array_of_model': 'list[list[ReadOnlyFirst]]'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501
|
def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501
|
||||||
"""ArrayTest - a model defined in OpenAPI
|
"""ArrayTest - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
array_of_string (list[str]): [optional] # noqa: E501
|
|
||||||
array_array_of_integer (list[list[int]]): [optional] # noqa: E501
|
|
||||||
array_array_of_model (list[list[ReadOnlyFirst]]): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._array_of_string = None
|
self._array_of_string = None
|
||||||
self._array_array_of_integer = None
|
self._array_array_of_integer = None
|
||||||
@ -59,11 +75,17 @@ class ArrayTest(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if array_of_string is not None:
|
if array_of_string is not None:
|
||||||
self.array_of_string = array_of_string # noqa: E501
|
self.array_of_string = (
|
||||||
|
array_of_string
|
||||||
|
)
|
||||||
if array_array_of_integer is not None:
|
if array_array_of_integer is not None:
|
||||||
self.array_array_of_integer = array_array_of_integer # noqa: E501
|
self.array_array_of_integer = (
|
||||||
|
array_array_of_integer
|
||||||
|
)
|
||||||
if array_array_of_model is not None:
|
if array_array_of_model is not None:
|
||||||
self.array_array_of_model = array_array_of_model # noqa: E501
|
self.array_array_of_model = (
|
||||||
|
array_array_of_model
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_of_string(self):
|
def array_of_string(self):
|
||||||
@ -76,9 +98,7 @@ class ArrayTest(object):
|
|||||||
return self._array_of_string
|
return self._array_of_string
|
||||||
|
|
||||||
@array_of_string.setter
|
@array_of_string.setter
|
||||||
def array_of_string(
|
def array_of_string(self, array_of_string): # noqa: E501
|
||||||
self,
|
|
||||||
array_of_string):
|
|
||||||
"""Sets the array_of_string of this ArrayTest.
|
"""Sets the array_of_string of this ArrayTest.
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +107,8 @@ class ArrayTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._array_of_string = (
|
self._array_of_string = (
|
||||||
array_of_string)
|
array_of_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_array_of_integer(self):
|
def array_array_of_integer(self):
|
||||||
@ -100,9 +121,7 @@ class ArrayTest(object):
|
|||||||
return self._array_array_of_integer
|
return self._array_array_of_integer
|
||||||
|
|
||||||
@array_array_of_integer.setter
|
@array_array_of_integer.setter
|
||||||
def array_array_of_integer(
|
def array_array_of_integer(self, array_array_of_integer): # noqa: E501
|
||||||
self,
|
|
||||||
array_array_of_integer):
|
|
||||||
"""Sets the array_array_of_integer of this ArrayTest.
|
"""Sets the array_array_of_integer of this ArrayTest.
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +130,8 @@ class ArrayTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._array_array_of_integer = (
|
self._array_array_of_integer = (
|
||||||
array_array_of_integer)
|
array_array_of_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_array_of_model(self):
|
def array_array_of_model(self):
|
||||||
@ -124,9 +144,7 @@ class ArrayTest(object):
|
|||||||
return self._array_array_of_model
|
return self._array_array_of_model
|
||||||
|
|
||||||
@array_array_of_model.setter
|
@array_array_of_model.setter
|
||||||
def array_array_of_model(
|
def array_array_of_model(self, array_array_of_model): # noqa: E501
|
||||||
self,
|
|
||||||
array_array_of_model):
|
|
||||||
"""Sets the array_array_of_model of this ArrayTest.
|
"""Sets the array_array_of_model of this ArrayTest.
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +153,8 @@ class ArrayTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._array_array_of_model = (
|
self._array_array_of_model = (
|
||||||
array_array_of_model)
|
array_array_of_model
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,33 +10,45 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Capitalization(object):
|
class Capitalization(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'small_camel': 'str',
|
allowed_values = {
|
||||||
'capital_camel': 'str',
|
|
||||||
'small_snake': 'str',
|
|
||||||
'capital_snake': 'str',
|
|
||||||
'sca_eth_flow_points': 'str',
|
|
||||||
'att_name': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -45,22 +57,23 @@ class Capitalization(object):
|
|||||||
'small_snake': 'small_Snake', # noqa: E501
|
'small_snake': 'small_Snake', # noqa: E501
|
||||||
'capital_snake': 'Capital_Snake', # noqa: E501
|
'capital_snake': 'Capital_Snake', # noqa: E501
|
||||||
'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501
|
'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501
|
||||||
'att_name': 'ATT_NAME', # noqa: E501
|
'att_name': 'ATT_NAME' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'small_camel': 'str',
|
||||||
|
'capital_camel': 'str',
|
||||||
|
'small_snake': 'str',
|
||||||
|
'capital_snake': 'str',
|
||||||
|
'sca_eth_flow_points': 'str',
|
||||||
|
'att_name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501
|
def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501
|
||||||
"""Capitalization - a model defined in OpenAPI
|
"""Capitalization - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
small_camel (str): [optional] # noqa: E501
|
|
||||||
capital_camel (str): [optional] # noqa: E501
|
|
||||||
small_snake (str): [optional] # noqa: E501
|
|
||||||
capital_snake (str): [optional] # noqa: E501
|
|
||||||
sca_eth_flow_points (str): [optional] # noqa: E501
|
|
||||||
att_name (str): Name of the pet . [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._small_camel = None
|
self._small_camel = None
|
||||||
self._capital_camel = None
|
self._capital_camel = None
|
||||||
@ -71,17 +84,29 @@ class Capitalization(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if small_camel is not None:
|
if small_camel is not None:
|
||||||
self.small_camel = small_camel # noqa: E501
|
self.small_camel = (
|
||||||
|
small_camel
|
||||||
|
)
|
||||||
if capital_camel is not None:
|
if capital_camel is not None:
|
||||||
self.capital_camel = capital_camel # noqa: E501
|
self.capital_camel = (
|
||||||
|
capital_camel
|
||||||
|
)
|
||||||
if small_snake is not None:
|
if small_snake is not None:
|
||||||
self.small_snake = small_snake # noqa: E501
|
self.small_snake = (
|
||||||
|
small_snake
|
||||||
|
)
|
||||||
if capital_snake is not None:
|
if capital_snake is not None:
|
||||||
self.capital_snake = capital_snake # noqa: E501
|
self.capital_snake = (
|
||||||
|
capital_snake
|
||||||
|
)
|
||||||
if sca_eth_flow_points is not None:
|
if sca_eth_flow_points is not None:
|
||||||
self.sca_eth_flow_points = sca_eth_flow_points # noqa: E501
|
self.sca_eth_flow_points = (
|
||||||
|
sca_eth_flow_points
|
||||||
|
)
|
||||||
if att_name is not None:
|
if att_name is not None:
|
||||||
self.att_name = att_name # noqa: E501
|
self.att_name = (
|
||||||
|
att_name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def small_camel(self):
|
def small_camel(self):
|
||||||
@ -94,9 +119,7 @@ class Capitalization(object):
|
|||||||
return self._small_camel
|
return self._small_camel
|
||||||
|
|
||||||
@small_camel.setter
|
@small_camel.setter
|
||||||
def small_camel(
|
def small_camel(self, small_camel): # noqa: E501
|
||||||
self,
|
|
||||||
small_camel):
|
|
||||||
"""Sets the small_camel of this Capitalization.
|
"""Sets the small_camel of this Capitalization.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +128,8 @@ class Capitalization(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._small_camel = (
|
self._small_camel = (
|
||||||
small_camel)
|
small_camel
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def capital_camel(self):
|
def capital_camel(self):
|
||||||
@ -118,9 +142,7 @@ class Capitalization(object):
|
|||||||
return self._capital_camel
|
return self._capital_camel
|
||||||
|
|
||||||
@capital_camel.setter
|
@capital_camel.setter
|
||||||
def capital_camel(
|
def capital_camel(self, capital_camel): # noqa: E501
|
||||||
self,
|
|
||||||
capital_camel):
|
|
||||||
"""Sets the capital_camel of this Capitalization.
|
"""Sets the capital_camel of this Capitalization.
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +151,8 @@ class Capitalization(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._capital_camel = (
|
self._capital_camel = (
|
||||||
capital_camel)
|
capital_camel
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def small_snake(self):
|
def small_snake(self):
|
||||||
@ -142,9 +165,7 @@ class Capitalization(object):
|
|||||||
return self._small_snake
|
return self._small_snake
|
||||||
|
|
||||||
@small_snake.setter
|
@small_snake.setter
|
||||||
def small_snake(
|
def small_snake(self, small_snake): # noqa: E501
|
||||||
self,
|
|
||||||
small_snake):
|
|
||||||
"""Sets the small_snake of this Capitalization.
|
"""Sets the small_snake of this Capitalization.
|
||||||
|
|
||||||
|
|
||||||
@ -153,7 +174,8 @@ class Capitalization(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._small_snake = (
|
self._small_snake = (
|
||||||
small_snake)
|
small_snake
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def capital_snake(self):
|
def capital_snake(self):
|
||||||
@ -166,9 +188,7 @@ class Capitalization(object):
|
|||||||
return self._capital_snake
|
return self._capital_snake
|
||||||
|
|
||||||
@capital_snake.setter
|
@capital_snake.setter
|
||||||
def capital_snake(
|
def capital_snake(self, capital_snake): # noqa: E501
|
||||||
self,
|
|
||||||
capital_snake):
|
|
||||||
"""Sets the capital_snake of this Capitalization.
|
"""Sets the capital_snake of this Capitalization.
|
||||||
|
|
||||||
|
|
||||||
@ -177,7 +197,8 @@ class Capitalization(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._capital_snake = (
|
self._capital_snake = (
|
||||||
capital_snake)
|
capital_snake
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def sca_eth_flow_points(self):
|
def sca_eth_flow_points(self):
|
||||||
@ -190,9 +211,7 @@ class Capitalization(object):
|
|||||||
return self._sca_eth_flow_points
|
return self._sca_eth_flow_points
|
||||||
|
|
||||||
@sca_eth_flow_points.setter
|
@sca_eth_flow_points.setter
|
||||||
def sca_eth_flow_points(
|
def sca_eth_flow_points(self, sca_eth_flow_points): # noqa: E501
|
||||||
self,
|
|
||||||
sca_eth_flow_points):
|
|
||||||
"""Sets the sca_eth_flow_points of this Capitalization.
|
"""Sets the sca_eth_flow_points of this Capitalization.
|
||||||
|
|
||||||
|
|
||||||
@ -201,7 +220,8 @@ class Capitalization(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._sca_eth_flow_points = (
|
self._sca_eth_flow_points = (
|
||||||
sca_eth_flow_points)
|
sca_eth_flow_points
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def att_name(self):
|
def att_name(self):
|
||||||
@ -215,9 +235,7 @@ class Capitalization(object):
|
|||||||
return self._att_name
|
return self._att_name
|
||||||
|
|
||||||
@att_name.setter
|
@att_name.setter
|
||||||
def att_name(
|
def att_name(self, att_name): # noqa: E501
|
||||||
self,
|
|
||||||
att_name):
|
|
||||||
"""Sets the att_name of this Capitalization.
|
"""Sets the att_name of this Capitalization.
|
||||||
|
|
||||||
Name of the pet # noqa: E501
|
Name of the pet # noqa: E501
|
||||||
@ -227,7 +245,8 @@ class Capitalization(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._att_name = (
|
self._att_name = (
|
||||||
att_name)
|
att_name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Cat(object):
|
class Cat(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'class_name': 'str',
|
allowed_values = {
|
||||||
'declawed': 'bool',
|
|
||||||
'color': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'class_name': 'className', # noqa: E501
|
'declawed': 'declawed' # noqa: E501
|
||||||
'declawed': 'declawed', # noqa: E501
|
|
||||||
'color': 'color', # noqa: E501
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, class_name, declawed=None, color=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Cat - a model defined in OpenAPI
|
'declawed': 'bool'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
class_name (str):
|
}
|
||||||
|
|
||||||
Keyword Args: # noqa: E501
|
def __init__(self, declawed=None): # noqa: E501
|
||||||
declawed (bool): [optional] # noqa: E501
|
"""Cat - a model defined in OpenAPI""" # noqa: E501
|
||||||
color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._declawed = None
|
self._declawed = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if declawed is not None:
|
if declawed is not None:
|
||||||
self.declawed = declawed # noqa: E501
|
self.declawed = (
|
||||||
|
declawed
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def declawed(self):
|
def declawed(self):
|
||||||
@ -70,9 +84,7 @@ class Cat(object):
|
|||||||
return self._declawed
|
return self._declawed
|
||||||
|
|
||||||
@declawed.setter
|
@declawed.setter
|
||||||
def declawed(
|
def declawed(self, declawed): # noqa: E501
|
||||||
self,
|
|
||||||
declawed):
|
|
||||||
"""Sets the declawed of this Cat.
|
"""Sets the declawed of this Cat.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +93,8 @@ class Cat(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._declawed = (
|
self._declawed = (
|
||||||
declawed)
|
declawed
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CatAllOf(object):
|
class CatAllOf(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'declawed': 'bool',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'declawed': 'declawed', # noqa: E501
|
'declawed': 'declawed' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'declawed': 'bool'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, declawed=None): # noqa: E501
|
def __init__(self, declawed=None): # noqa: E501
|
||||||
"""CatAllOf - a model defined in OpenAPI
|
"""CatAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
declawed (bool): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._declawed = None
|
self._declawed = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if declawed is not None:
|
if declawed is not None:
|
||||||
self.declawed = declawed # noqa: E501
|
self.declawed = (
|
||||||
|
declawed
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def declawed(self):
|
def declawed(self):
|
||||||
@ -64,9 +84,7 @@ class CatAllOf(object):
|
|||||||
return self._declawed
|
return self._declawed
|
||||||
|
|
||||||
@declawed.setter
|
@declawed.setter
|
||||||
def declawed(
|
def declawed(self, declawed): # noqa: E501
|
||||||
self,
|
|
||||||
declawed):
|
|
||||||
"""Sets the declawed of this CatAllOf.
|
"""Sets the declawed of this CatAllOf.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class CatAllOf(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._declawed = (
|
self._declawed = (
|
||||||
declawed)
|
declawed
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,52 +10,71 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Category(object):
|
class Category(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
'id': 'int',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
|
||||||
'id': 'id', # noqa: E501
|
'id': 'id', # noqa: E501
|
||||||
|
'name': 'name' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name='default-name', id=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Category - a model defined in OpenAPI
|
'id': 'int',
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
|
}
|
||||||
|
|
||||||
Keyword Args:
|
def __init__(self, id=None, name='default-name'): # noqa: E501
|
||||||
name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501
|
"""Category - a model defined in OpenAPI""" # noqa: E501
|
||||||
id (int): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = None
|
self._id = None
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if id is not None:
|
if id is not None:
|
||||||
self.id = id # noqa: E501
|
self.id = (
|
||||||
|
id
|
||||||
|
)
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -69,9 +88,7 @@ class Category(object):
|
|||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(
|
def id(self, id): # noqa: E501
|
||||||
self,
|
|
||||||
id):
|
|
||||||
"""Sets the id of this Category.
|
"""Sets the id of this Category.
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +97,8 @@ class Category(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._id = (
|
self._id = (
|
||||||
id)
|
id
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -93,9 +111,7 @@ class Category(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this Category.
|
"""Sets the name of this Category.
|
||||||
|
|
||||||
|
|
||||||
@ -103,10 +119,11 @@ class Category(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if name is None:
|
if name is None:
|
||||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ClassModel(object):
|
class ClassModel(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'_class': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'_class': '_class', # noqa: E501
|
'_class': '_class' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'_class': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, _class=None): # noqa: E501
|
def __init__(self, _class=None): # noqa: E501
|
||||||
"""ClassModel - a model defined in OpenAPI
|
"""ClassModel - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
_class (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.__class = None
|
self.__class = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if _class is not None:
|
if _class is not None:
|
||||||
self._class = _class # noqa: E501
|
self._class = (
|
||||||
|
_class
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _class(self):
|
def _class(self):
|
||||||
@ -64,9 +84,7 @@ class ClassModel(object):
|
|||||||
return self.__class
|
return self.__class
|
||||||
|
|
||||||
@_class.setter
|
@_class.setter
|
||||||
def _class(
|
def _class(self, _class): # noqa: E501
|
||||||
self,
|
|
||||||
_class):
|
|
||||||
"""Sets the _class of this ClassModel.
|
"""Sets the _class of this ClassModel.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class ClassModel(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.__class = (
|
self.__class = (
|
||||||
_class)
|
_class
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Client(object):
|
class Client(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'client': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'client': 'client', # noqa: E501
|
'client': 'client' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'client': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, client=None): # noqa: E501
|
def __init__(self, client=None): # noqa: E501
|
||||||
"""Client - a model defined in OpenAPI
|
"""Client - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
client (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._client = None
|
self._client = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if client is not None:
|
if client is not None:
|
||||||
self.client = client # noqa: E501
|
self.client = (
|
||||||
|
client
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def client(self):
|
def client(self):
|
||||||
@ -64,9 +84,7 @@ class Client(object):
|
|||||||
return self._client
|
return self._client
|
||||||
|
|
||||||
@client.setter
|
@client.setter
|
||||||
def client(
|
def client(self, client): # noqa: E501
|
||||||
self,
|
|
||||||
client):
|
|
||||||
"""Sets the client of this Client.
|
"""Sets the client of this Client.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class Client(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._client = (
|
self._client = (
|
||||||
client)
|
client
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Dog(object):
|
class Dog(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'class_name': 'str',
|
allowed_values = {
|
||||||
'breed': 'str',
|
|
||||||
'color': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'class_name': 'className', # noqa: E501
|
'breed': 'breed' # noqa: E501
|
||||||
'breed': 'breed', # noqa: E501
|
|
||||||
'color': 'color', # noqa: E501
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, class_name, breed=None, color=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Dog - a model defined in OpenAPI
|
'breed': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
class_name (str):
|
}
|
||||||
|
|
||||||
Keyword Args: # noqa: E501
|
def __init__(self, breed=None): # noqa: E501
|
||||||
breed (str): [optional] # noqa: E501
|
"""Dog - a model defined in OpenAPI""" # noqa: E501
|
||||||
color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._breed = None
|
self._breed = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if breed is not None:
|
if breed is not None:
|
||||||
self.breed = breed # noqa: E501
|
self.breed = (
|
||||||
|
breed
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def breed(self):
|
def breed(self):
|
||||||
@ -70,9 +84,7 @@ class Dog(object):
|
|||||||
return self._breed
|
return self._breed
|
||||||
|
|
||||||
@breed.setter
|
@breed.setter
|
||||||
def breed(
|
def breed(self, breed): # noqa: E501
|
||||||
self,
|
|
||||||
breed):
|
|
||||||
"""Sets the breed of this Dog.
|
"""Sets the breed of this Dog.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +93,8 @@ class Dog(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._breed = (
|
self._breed = (
|
||||||
breed)
|
breed
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DogAllOf(object):
|
class DogAllOf(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'breed': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'breed': 'breed', # noqa: E501
|
'breed': 'breed' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'breed': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, breed=None): # noqa: E501
|
def __init__(self, breed=None): # noqa: E501
|
||||||
"""DogAllOf - a model defined in OpenAPI
|
"""DogAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
breed (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._breed = None
|
self._breed = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if breed is not None:
|
if breed is not None:
|
||||||
self.breed = breed # noqa: E501
|
self.breed = (
|
||||||
|
breed
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def breed(self):
|
def breed(self):
|
||||||
@ -64,9 +84,7 @@ class DogAllOf(object):
|
|||||||
return self._breed
|
return self._breed
|
||||||
|
|
||||||
@breed.setter
|
@breed.setter
|
||||||
def breed(
|
def breed(self, breed): # noqa: E501
|
||||||
self,
|
|
||||||
breed):
|
|
||||||
"""Sets the breed of this DogAllOf.
|
"""Sets the breed of this DogAllOf.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class DogAllOf(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._breed = (
|
self._breed = (
|
||||||
breed)
|
breed
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,83 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumArrays(object):
|
class EnumArrays(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'just_symbol': 'str',
|
allowed_values = {
|
||||||
'array_enum': 'list[str]',
|
('just_symbol',): {
|
||||||
|
'>=': ">=",
|
||||||
|
'$': "$"
|
||||||
|
},
|
||||||
|
('array_enum',): {
|
||||||
|
'FISH': "fish",
|
||||||
|
'CRAB': "crab"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'just_symbol': 'just_symbol', # noqa: E501
|
'just_symbol': 'just_symbol', # noqa: E501
|
||||||
'array_enum': 'array_enum', # noqa: E501
|
'array_enum': 'array_enum' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'just_symbol': 'str',
|
||||||
|
'array_enum': 'list[str]'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, just_symbol=None, array_enum=None): # noqa: E501
|
def __init__(self, just_symbol=None, array_enum=None): # noqa: E501
|
||||||
"""EnumArrays - a model defined in OpenAPI
|
"""EnumArrays - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
just_symbol (str): [optional] # noqa: E501
|
|
||||||
array_enum (list[str]): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._just_symbol = None
|
self._just_symbol = None
|
||||||
self._array_enum = None
|
self._array_enum = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if just_symbol is not None:
|
if just_symbol is not None:
|
||||||
self.just_symbol = just_symbol # noqa: E501
|
self.just_symbol = (
|
||||||
|
just_symbol
|
||||||
|
)
|
||||||
if array_enum is not None:
|
if array_enum is not None:
|
||||||
self.array_enum = array_enum # noqa: E501
|
self.array_enum = (
|
||||||
|
array_enum
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def just_symbol(self):
|
def just_symbol(self):
|
||||||
@ -70,24 +99,23 @@ class EnumArrays(object):
|
|||||||
return self._just_symbol
|
return self._just_symbol
|
||||||
|
|
||||||
@just_symbol.setter
|
@just_symbol.setter
|
||||||
def just_symbol(
|
def just_symbol(self, just_symbol): # noqa: E501
|
||||||
self,
|
|
||||||
just_symbol):
|
|
||||||
"""Sets the just_symbol of this EnumArrays.
|
"""Sets the just_symbol of this EnumArrays.
|
||||||
|
|
||||||
|
|
||||||
:param just_symbol: The just_symbol of this EnumArrays. # noqa: E501
|
:param just_symbol: The just_symbol of this EnumArrays. # noqa: E501
|
||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
allowed_values = [">=", "$"] # noqa: E501
|
check_allowed_values(
|
||||||
if just_symbol not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('just_symbol',),
|
||||||
"Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501
|
just_symbol,
|
||||||
.format(just_symbol, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._just_symbol = (
|
self._just_symbol = (
|
||||||
just_symbol)
|
just_symbol
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_enum(self):
|
def array_enum(self):
|
||||||
@ -100,25 +128,23 @@ class EnumArrays(object):
|
|||||||
return self._array_enum
|
return self._array_enum
|
||||||
|
|
||||||
@array_enum.setter
|
@array_enum.setter
|
||||||
def array_enum(
|
def array_enum(self, array_enum): # noqa: E501
|
||||||
self,
|
|
||||||
array_enum):
|
|
||||||
"""Sets the array_enum of this EnumArrays.
|
"""Sets the array_enum of this EnumArrays.
|
||||||
|
|
||||||
|
|
||||||
:param array_enum: The array_enum of this EnumArrays. # noqa: E501
|
:param array_enum: The array_enum of this EnumArrays. # noqa: E501
|
||||||
:type: list[str]
|
:type: list[str]
|
||||||
"""
|
"""
|
||||||
allowed_values = ["fish", "crab"] # noqa: E501
|
check_allowed_values(
|
||||||
if not set(array_enum).issubset(set(allowed_values)):
|
self.allowed_values,
|
||||||
raise ValueError(
|
('array_enum',),
|
||||||
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
array_enum,
|
||||||
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
self.validations
|
||||||
", ".join(map(str, allowed_values)))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self._array_enum = (
|
self._array_enum = (
|
||||||
array_enum)
|
array_enum
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,75 +10,97 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumClass(object):
|
class EnumClass(ModelSimple):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
allowed enum values
|
|
||||||
"""
|
|
||||||
_ABC = "_abc"
|
|
||||||
_EFG = "-efg"
|
|
||||||
_XYZ_ = "(xyz)"
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
openapi_types (dict): The key is attribute name
|
openapi_types (dict): The key is attribute name
|
||||||
and the value is attribute type.
|
and the value is attribute type.
|
||||||
attribute_map (dict): The key is attribute name
|
validations (dict): The key is the tuple path to the attribute
|
||||||
and the value is json key in definition.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
allowed_values = {
|
||||||
|
('value',): {
|
||||||
|
'_ABC': "_abc",
|
||||||
|
'-EFG': "-efg",
|
||||||
|
'(XYZ)': "(xyz)"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
openapi_types = {
|
openapi_types = {
|
||||||
|
'value': 'str'
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self): # noqa: E501
|
def __init__(self, value='-efg'): # noqa: E501
|
||||||
"""EnumClass - a model defined in OpenAPI
|
"""EnumClass - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._value = None
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
"""
|
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
def to_dict(self):
|
self.value = value
|
||||||
"""Returns the model properties as a dict"""
|
|
||||||
result = {}
|
|
||||||
|
|
||||||
for attr, _ in six.iteritems(self.openapi_types):
|
@property
|
||||||
value = getattr(self, attr)
|
def value(self):
|
||||||
if isinstance(value, list):
|
"""Gets the value of this EnumClass. # noqa: E501
|
||||||
result[attr] = list(map(
|
|
||||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
||||||
|
:return: The value of this EnumClass. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._value
|
||||||
|
|
||||||
|
@value.setter
|
||||||
|
def value(self, value): # noqa: E501
|
||||||
|
"""Sets the value of this EnumClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param value: The value of this EnumClass. # noqa: E501
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
if value is None:
|
||||||
|
raise ApiValueError("Invalid value for `value`, must not be `None`") # noqa: E501
|
||||||
|
check_allowed_values(
|
||||||
|
self.allowed_values,
|
||||||
|
('value',),
|
||||||
|
value,
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
|
||||||
|
self._value = (
|
||||||
value
|
value
|
||||||
))
|
)
|
||||||
elif hasattr(value, "to_dict"):
|
|
||||||
result[attr] = value.to_dict()
|
|
||||||
elif isinstance(value, dict):
|
|
||||||
result[attr] = dict(map(
|
|
||||||
lambda item: (item[0], item[1].to_dict())
|
|
||||||
if hasattr(item[1], "to_dict") else item,
|
|
||||||
value.items()
|
|
||||||
))
|
|
||||||
else:
|
|
||||||
result[attr] = value
|
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
||||||
def to_str(self):
|
def to_str(self):
|
||||||
"""Returns the string representation of the model"""
|
"""Returns the string representation of the model"""
|
||||||
return pprint.pformat(self.to_dict())
|
return str(self._value)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""For `print` and `pprint`"""
|
"""For `print` and `pprint`"""
|
||||||
|
@ -10,54 +10,86 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumTest(object):
|
class EnumTest(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'enum_string_required': 'str',
|
allowed_values = {
|
||||||
'enum_string': 'str',
|
('enum_string',): {
|
||||||
'enum_integer': 'int',
|
'UPPER': "UPPER",
|
||||||
'enum_number': 'float',
|
'LOWER': "lower",
|
||||||
'outer_enum': 'OuterEnum',
|
'EMPTY': ""
|
||||||
|
},
|
||||||
|
('enum_string_required',): {
|
||||||
|
'UPPER': "UPPER",
|
||||||
|
'LOWER': "lower",
|
||||||
|
'EMPTY': ""
|
||||||
|
},
|
||||||
|
('enum_integer',): {
|
||||||
|
'1': 1,
|
||||||
|
'-1': -1
|
||||||
|
},
|
||||||
|
('enum_number',): {
|
||||||
|
'1.1': 1.1,
|
||||||
|
'-1.2': -1.2
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'enum_string_required': 'enum_string_required', # noqa: E501
|
|
||||||
'enum_string': 'enum_string', # noqa: E501
|
'enum_string': 'enum_string', # noqa: E501
|
||||||
|
'enum_string_required': 'enum_string_required', # noqa: E501
|
||||||
'enum_integer': 'enum_integer', # noqa: E501
|
'enum_integer': 'enum_integer', # noqa: E501
|
||||||
'enum_number': 'enum_number', # noqa: E501
|
'enum_number': 'enum_number', # noqa: E501
|
||||||
'outer_enum': 'outerEnum', # noqa: E501
|
'outer_enum': 'outerEnum' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, enum_string_required, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501
|
openapi_types = {
|
||||||
"""EnumTest - a model defined in OpenAPI
|
'enum_string': 'str',
|
||||||
|
'enum_string_required': 'str',
|
||||||
|
'enum_integer': 'int',
|
||||||
|
'enum_number': 'float',
|
||||||
|
'outer_enum': 'OuterEnum'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
enum_string_required (str):
|
}
|
||||||
|
|
||||||
Keyword Args: # noqa: E501
|
def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501
|
||||||
enum_string (str): [optional] # noqa: E501
|
"""EnumTest - a model defined in OpenAPI""" # noqa: E501
|
||||||
enum_integer (int): [optional] # noqa: E501
|
|
||||||
enum_number (float): [optional] # noqa: E501
|
|
||||||
outer_enum (OuterEnum): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._enum_string = None
|
self._enum_string = None
|
||||||
self._enum_string_required = None
|
self._enum_string_required = None
|
||||||
@ -67,14 +99,22 @@ class EnumTest(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if enum_string is not None:
|
if enum_string is not None:
|
||||||
self.enum_string = enum_string # noqa: E501
|
self.enum_string = (
|
||||||
|
enum_string
|
||||||
|
)
|
||||||
self.enum_string_required = enum_string_required
|
self.enum_string_required = enum_string_required
|
||||||
if enum_integer is not None:
|
if enum_integer is not None:
|
||||||
self.enum_integer = enum_integer # noqa: E501
|
self.enum_integer = (
|
||||||
|
enum_integer
|
||||||
|
)
|
||||||
if enum_number is not None:
|
if enum_number is not None:
|
||||||
self.enum_number = enum_number # noqa: E501
|
self.enum_number = (
|
||||||
|
enum_number
|
||||||
|
)
|
||||||
if outer_enum is not None:
|
if outer_enum is not None:
|
||||||
self.outer_enum = outer_enum # noqa: E501
|
self.outer_enum = (
|
||||||
|
outer_enum
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def enum_string(self):
|
def enum_string(self):
|
||||||
@ -87,24 +127,23 @@ class EnumTest(object):
|
|||||||
return self._enum_string
|
return self._enum_string
|
||||||
|
|
||||||
@enum_string.setter
|
@enum_string.setter
|
||||||
def enum_string(
|
def enum_string(self, enum_string): # noqa: E501
|
||||||
self,
|
|
||||||
enum_string):
|
|
||||||
"""Sets the enum_string of this EnumTest.
|
"""Sets the enum_string of this EnumTest.
|
||||||
|
|
||||||
|
|
||||||
:param enum_string: The enum_string of this EnumTest. # noqa: E501
|
:param enum_string: The enum_string of this EnumTest. # noqa: E501
|
||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
allowed_values = ["UPPER", "lower", ""] # noqa: E501
|
check_allowed_values(
|
||||||
if enum_string not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('enum_string',),
|
||||||
"Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501
|
enum_string,
|
||||||
.format(enum_string, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._enum_string = (
|
self._enum_string = (
|
||||||
enum_string)
|
enum_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def enum_string_required(self):
|
def enum_string_required(self):
|
||||||
@ -117,9 +156,7 @@ class EnumTest(object):
|
|||||||
return self._enum_string_required
|
return self._enum_string_required
|
||||||
|
|
||||||
@enum_string_required.setter
|
@enum_string_required.setter
|
||||||
def enum_string_required(
|
def enum_string_required(self, enum_string_required): # noqa: E501
|
||||||
self,
|
|
||||||
enum_string_required):
|
|
||||||
"""Sets the enum_string_required of this EnumTest.
|
"""Sets the enum_string_required of this EnumTest.
|
||||||
|
|
||||||
|
|
||||||
@ -127,16 +164,17 @@ class EnumTest(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if enum_string_required is None:
|
if enum_string_required is None:
|
||||||
raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501
|
||||||
allowed_values = ["UPPER", "lower", ""] # noqa: E501
|
check_allowed_values(
|
||||||
if enum_string_required not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('enum_string_required',),
|
||||||
"Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501
|
enum_string_required,
|
||||||
.format(enum_string_required, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._enum_string_required = (
|
self._enum_string_required = (
|
||||||
enum_string_required)
|
enum_string_required
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def enum_integer(self):
|
def enum_integer(self):
|
||||||
@ -149,24 +187,23 @@ class EnumTest(object):
|
|||||||
return self._enum_integer
|
return self._enum_integer
|
||||||
|
|
||||||
@enum_integer.setter
|
@enum_integer.setter
|
||||||
def enum_integer(
|
def enum_integer(self, enum_integer): # noqa: E501
|
||||||
self,
|
|
||||||
enum_integer):
|
|
||||||
"""Sets the enum_integer of this EnumTest.
|
"""Sets the enum_integer of this EnumTest.
|
||||||
|
|
||||||
|
|
||||||
:param enum_integer: The enum_integer of this EnumTest. # noqa: E501
|
:param enum_integer: The enum_integer of this EnumTest. # noqa: E501
|
||||||
:type: int
|
:type: int
|
||||||
"""
|
"""
|
||||||
allowed_values = [1, -1] # noqa: E501
|
check_allowed_values(
|
||||||
if enum_integer not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('enum_integer',),
|
||||||
"Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501
|
enum_integer,
|
||||||
.format(enum_integer, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._enum_integer = (
|
self._enum_integer = (
|
||||||
enum_integer)
|
enum_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def enum_number(self):
|
def enum_number(self):
|
||||||
@ -179,24 +216,23 @@ class EnumTest(object):
|
|||||||
return self._enum_number
|
return self._enum_number
|
||||||
|
|
||||||
@enum_number.setter
|
@enum_number.setter
|
||||||
def enum_number(
|
def enum_number(self, enum_number): # noqa: E501
|
||||||
self,
|
|
||||||
enum_number):
|
|
||||||
"""Sets the enum_number of this EnumTest.
|
"""Sets the enum_number of this EnumTest.
|
||||||
|
|
||||||
|
|
||||||
:param enum_number: The enum_number of this EnumTest. # noqa: E501
|
:param enum_number: The enum_number of this EnumTest. # noqa: E501
|
||||||
:type: float
|
:type: float
|
||||||
"""
|
"""
|
||||||
allowed_values = [1.1, -1.2] # noqa: E501
|
check_allowed_values(
|
||||||
if enum_number not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('enum_number',),
|
||||||
"Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501
|
enum_number,
|
||||||
.format(enum_number, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._enum_number = (
|
self._enum_number = (
|
||||||
enum_number)
|
enum_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def outer_enum(self):
|
def outer_enum(self):
|
||||||
@ -209,9 +245,7 @@ class EnumTest(object):
|
|||||||
return self._outer_enum
|
return self._outer_enum
|
||||||
|
|
||||||
@outer_enum.setter
|
@outer_enum.setter
|
||||||
def outer_enum(
|
def outer_enum(self, outer_enum): # noqa: E501
|
||||||
self,
|
|
||||||
outer_enum):
|
|
||||||
"""Sets the outer_enum of this EnumTest.
|
"""Sets the outer_enum of this EnumTest.
|
||||||
|
|
||||||
|
|
||||||
@ -220,7 +254,8 @@ class EnumTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._outer_enum = (
|
self._outer_enum = (
|
||||||
outer_enum)
|
outer_enum
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class File(object):
|
class File(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'source_uri': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'source_uri': 'sourceURI', # noqa: E501
|
'source_uri': 'sourceURI' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'source_uri': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, source_uri=None): # noqa: E501
|
def __init__(self, source_uri=None): # noqa: E501
|
||||||
"""File - a model defined in OpenAPI
|
"""File - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
source_uri (str): Test capitalization. [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._source_uri = None
|
self._source_uri = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if source_uri is not None:
|
if source_uri is not None:
|
||||||
self.source_uri = source_uri # noqa: E501
|
self.source_uri = (
|
||||||
|
source_uri
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_uri(self):
|
def source_uri(self):
|
||||||
@ -65,9 +85,7 @@ class File(object):
|
|||||||
return self._source_uri
|
return self._source_uri
|
||||||
|
|
||||||
@source_uri.setter
|
@source_uri.setter
|
||||||
def source_uri(
|
def source_uri(self, source_uri): # noqa: E501
|
||||||
self,
|
|
||||||
source_uri):
|
|
||||||
"""Sets the source_uri of this File.
|
"""Sets the source_uri of this File.
|
||||||
|
|
||||||
Test capitalization # noqa: E501
|
Test capitalization # noqa: E501
|
||||||
@ -77,7 +95,8 @@ class File(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._source_uri = (
|
self._source_uri = (
|
||||||
source_uri)
|
source_uri
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,75 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FileSchemaTestClass(object):
|
class FileSchemaTestClass(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'file': 'File',
|
allowed_values = {
|
||||||
'files': 'list[File]',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'file': 'file', # noqa: E501
|
'file': 'file', # noqa: E501
|
||||||
'files': 'files', # noqa: E501
|
'files': 'files' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'file': 'File',
|
||||||
|
'files': 'list[File]'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, file=None, files=None): # noqa: E501
|
def __init__(self, file=None, files=None): # noqa: E501
|
||||||
"""FileSchemaTestClass - a model defined in OpenAPI
|
"""FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
file (File): [optional] # noqa: E501
|
|
||||||
files (list[File]): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._file = None
|
self._file = None
|
||||||
self._files = None
|
self._files = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if file is not None:
|
if file is not None:
|
||||||
self.file = file # noqa: E501
|
self.file = (
|
||||||
|
file
|
||||||
|
)
|
||||||
if files is not None:
|
if files is not None:
|
||||||
self.files = files # noqa: E501
|
self.files = (
|
||||||
|
files
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def file(self):
|
def file(self):
|
||||||
@ -70,9 +91,7 @@ class FileSchemaTestClass(object):
|
|||||||
return self._file
|
return self._file
|
||||||
|
|
||||||
@file.setter
|
@file.setter
|
||||||
def file(
|
def file(self, file): # noqa: E501
|
||||||
self,
|
|
||||||
file):
|
|
||||||
"""Sets the file of this FileSchemaTestClass.
|
"""Sets the file of this FileSchemaTestClass.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +100,8 @@ class FileSchemaTestClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._file = (
|
self._file = (
|
||||||
file)
|
file
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def files(self):
|
def files(self):
|
||||||
@ -94,9 +114,7 @@ class FileSchemaTestClass(object):
|
|||||||
return self._files
|
return self._files
|
||||||
|
|
||||||
@files.setter
|
@files.setter
|
||||||
def files(
|
def files(self, files): # noqa: E501
|
||||||
self,
|
|
||||||
files):
|
|
||||||
"""Sets the files of this FileSchemaTestClass.
|
"""Sets the files of this FileSchemaTestClass.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +123,8 @@ class FileSchemaTestClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._files = (
|
self._files = (
|
||||||
files)
|
files
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,78 +10,126 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FormatTest(object):
|
class FormatTest(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'number': 'float',
|
allowed_values = {
|
||||||
'byte': 'str',
|
|
||||||
'date': 'date',
|
|
||||||
'password': 'str',
|
|
||||||
'integer': 'int',
|
|
||||||
'int32': 'int',
|
|
||||||
'int64': 'int',
|
|
||||||
'float': 'float',
|
|
||||||
'double': 'float',
|
|
||||||
'string': 'str',
|
|
||||||
'binary': 'file',
|
|
||||||
'date_time': 'datetime',
|
|
||||||
'uuid': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'number': 'number', # noqa: E501
|
|
||||||
'byte': 'byte', # noqa: E501
|
|
||||||
'date': 'date', # noqa: E501
|
|
||||||
'password': 'password', # noqa: E501
|
|
||||||
'integer': 'integer', # noqa: E501
|
'integer': 'integer', # noqa: E501
|
||||||
'int32': 'int32', # noqa: E501
|
'int32': 'int32', # noqa: E501
|
||||||
'int64': 'int64', # noqa: E501
|
'int64': 'int64', # noqa: E501
|
||||||
|
'number': 'number', # noqa: E501
|
||||||
'float': 'float', # noqa: E501
|
'float': 'float', # noqa: E501
|
||||||
'double': 'double', # noqa: E501
|
'double': 'double', # noqa: E501
|
||||||
'string': 'string', # noqa: E501
|
'string': 'string', # noqa: E501
|
||||||
|
'byte': 'byte', # noqa: E501
|
||||||
'binary': 'binary', # noqa: E501
|
'binary': 'binary', # noqa: E501
|
||||||
|
'date': 'date', # noqa: E501
|
||||||
'date_time': 'dateTime', # noqa: E501
|
'date_time': 'dateTime', # noqa: E501
|
||||||
'uuid': 'uuid', # noqa: E501
|
'uuid': 'uuid', # noqa: E501
|
||||||
|
'password': 'password' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, number, byte, date, password, integer=None, int32=None, int64=None, float=None, double=None, string=None, binary=None, date_time=None, uuid=None): # noqa: E501
|
openapi_types = {
|
||||||
"""FormatTest - a model defined in OpenAPI
|
'integer': 'int',
|
||||||
|
'int32': 'int',
|
||||||
|
'int64': 'int',
|
||||||
|
'number': 'float',
|
||||||
|
'float': 'float',
|
||||||
|
'double': 'float',
|
||||||
|
'string': 'str',
|
||||||
|
'byte': 'str',
|
||||||
|
'binary': 'file',
|
||||||
|
'date': 'date',
|
||||||
|
'date_time': 'datetime',
|
||||||
|
'uuid': 'str',
|
||||||
|
'password': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
number (float):
|
('integer',): {
|
||||||
byte (str):
|
|
||||||
date (date):
|
|
||||||
password (str):
|
|
||||||
|
|
||||||
Keyword Args: # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501
|
'inclusive_maximum': 100,
|
||||||
integer (int): [optional] # noqa: E501
|
'inclusive_minimum': 10,
|
||||||
int32 (int): [optional] # noqa: E501
|
},
|
||||||
int64 (int): [optional] # noqa: E501
|
('int32',): {
|
||||||
float (float): [optional] # noqa: E501
|
|
||||||
double (float): [optional] # noqa: E501
|
'inclusive_maximum': 200,
|
||||||
string (str): [optional] # noqa: E501
|
'inclusive_minimum': 20,
|
||||||
binary (file): [optional] # noqa: E501
|
},
|
||||||
date_time (datetime): [optional] # noqa: E501
|
('number',): {
|
||||||
uuid (str): [optional] # noqa: E501
|
|
||||||
"""
|
'inclusive_maximum': 543.2,
|
||||||
|
'inclusive_minimum': 32.1,
|
||||||
|
},
|
||||||
|
('float',): {
|
||||||
|
|
||||||
|
'inclusive_maximum': 987.6,
|
||||||
|
'inclusive_minimum': 54.3,
|
||||||
|
},
|
||||||
|
('double',): {
|
||||||
|
|
||||||
|
'inclusive_maximum': 123.4,
|
||||||
|
'inclusive_minimum': 67.8,
|
||||||
|
},
|
||||||
|
('string',): {
|
||||||
|
|
||||||
|
'regex': {
|
||||||
|
'pattern': r'^[a-z]+$', # noqa: E501
|
||||||
|
'flags': (re.IGNORECASE)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
('byte',): {
|
||||||
|
|
||||||
|
'regex': {
|
||||||
|
'pattern': r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', # noqa: E501
|
||||||
|
},
|
||||||
|
},
|
||||||
|
('password',): {
|
||||||
|
'max_length': 64,
|
||||||
|
'min_length': 10,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501
|
||||||
|
"""FormatTest - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
self._integer = None
|
self._integer = None
|
||||||
self._int32 = None
|
self._int32 = None
|
||||||
@ -99,26 +147,44 @@ class FormatTest(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if integer is not None:
|
if integer is not None:
|
||||||
self.integer = integer # noqa: E501
|
self.integer = (
|
||||||
|
integer
|
||||||
|
)
|
||||||
if int32 is not None:
|
if int32 is not None:
|
||||||
self.int32 = int32 # noqa: E501
|
self.int32 = (
|
||||||
|
int32
|
||||||
|
)
|
||||||
if int64 is not None:
|
if int64 is not None:
|
||||||
self.int64 = int64 # noqa: E501
|
self.int64 = (
|
||||||
|
int64
|
||||||
|
)
|
||||||
self.number = number
|
self.number = number
|
||||||
if float is not None:
|
if float is not None:
|
||||||
self.float = float # noqa: E501
|
self.float = (
|
||||||
|
float
|
||||||
|
)
|
||||||
if double is not None:
|
if double is not None:
|
||||||
self.double = double # noqa: E501
|
self.double = (
|
||||||
|
double
|
||||||
|
)
|
||||||
if string is not None:
|
if string is not None:
|
||||||
self.string = string # noqa: E501
|
self.string = (
|
||||||
|
string
|
||||||
|
)
|
||||||
self.byte = byte
|
self.byte = byte
|
||||||
if binary is not None:
|
if binary is not None:
|
||||||
self.binary = binary # noqa: E501
|
self.binary = (
|
||||||
|
binary
|
||||||
|
)
|
||||||
self.date = date
|
self.date = date
|
||||||
if date_time is not None:
|
if date_time is not None:
|
||||||
self.date_time = date_time # noqa: E501
|
self.date_time = (
|
||||||
|
date_time
|
||||||
|
)
|
||||||
if uuid is not None:
|
if uuid is not None:
|
||||||
self.uuid = uuid # noqa: E501
|
self.uuid = (
|
||||||
|
uuid
|
||||||
|
)
|
||||||
self.password = password
|
self.password = password
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -132,22 +198,22 @@ class FormatTest(object):
|
|||||||
return self._integer
|
return self._integer
|
||||||
|
|
||||||
@integer.setter
|
@integer.setter
|
||||||
def integer(
|
def integer(self, integer): # noqa: E501
|
||||||
self,
|
|
||||||
integer):
|
|
||||||
"""Sets the integer of this FormatTest.
|
"""Sets the integer of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
:param integer: The integer of this FormatTest. # noqa: E501
|
:param integer: The integer of this FormatTest. # noqa: E501
|
||||||
:type: int
|
:type: int
|
||||||
"""
|
"""
|
||||||
if integer is not None and integer > 100: # noqa: E501
|
check_validations(
|
||||||
raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501
|
self.validations,
|
||||||
if integer is not None and integer < 10: # noqa: E501
|
('integer',),
|
||||||
raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501
|
integer
|
||||||
|
)
|
||||||
|
|
||||||
self._integer = (
|
self._integer = (
|
||||||
integer)
|
integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def int32(self):
|
def int32(self):
|
||||||
@ -160,22 +226,22 @@ class FormatTest(object):
|
|||||||
return self._int32
|
return self._int32
|
||||||
|
|
||||||
@int32.setter
|
@int32.setter
|
||||||
def int32(
|
def int32(self, int32): # noqa: E501
|
||||||
self,
|
|
||||||
int32):
|
|
||||||
"""Sets the int32 of this FormatTest.
|
"""Sets the int32 of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
:param int32: The int32 of this FormatTest. # noqa: E501
|
:param int32: The int32 of this FormatTest. # noqa: E501
|
||||||
:type: int
|
:type: int
|
||||||
"""
|
"""
|
||||||
if int32 is not None and int32 > 200: # noqa: E501
|
check_validations(
|
||||||
raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501
|
self.validations,
|
||||||
if int32 is not None and int32 < 20: # noqa: E501
|
('int32',),
|
||||||
raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501
|
int32
|
||||||
|
)
|
||||||
|
|
||||||
self._int32 = (
|
self._int32 = (
|
||||||
int32)
|
int32
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def int64(self):
|
def int64(self):
|
||||||
@ -188,9 +254,7 @@ class FormatTest(object):
|
|||||||
return self._int64
|
return self._int64
|
||||||
|
|
||||||
@int64.setter
|
@int64.setter
|
||||||
def int64(
|
def int64(self, int64): # noqa: E501
|
||||||
self,
|
|
||||||
int64):
|
|
||||||
"""Sets the int64 of this FormatTest.
|
"""Sets the int64 of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -199,7 +263,8 @@ class FormatTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._int64 = (
|
self._int64 = (
|
||||||
int64)
|
int64
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number(self):
|
def number(self):
|
||||||
@ -212,9 +277,7 @@ class FormatTest(object):
|
|||||||
return self._number
|
return self._number
|
||||||
|
|
||||||
@number.setter
|
@number.setter
|
||||||
def number(
|
def number(self, number): # noqa: E501
|
||||||
self,
|
|
||||||
number):
|
|
||||||
"""Sets the number of this FormatTest.
|
"""Sets the number of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -222,14 +285,16 @@ class FormatTest(object):
|
|||||||
:type: float
|
:type: float
|
||||||
"""
|
"""
|
||||||
if number is None:
|
if number is None:
|
||||||
raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `number`, must not be `None`") # noqa: E501
|
||||||
if number is not None and number > 543.2: # noqa: E501
|
check_validations(
|
||||||
raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501
|
self.validations,
|
||||||
if number is not None and number < 32.1: # noqa: E501
|
('number',),
|
||||||
raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501
|
number
|
||||||
|
)
|
||||||
|
|
||||||
self._number = (
|
self._number = (
|
||||||
number)
|
number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def float(self):
|
def float(self):
|
||||||
@ -242,22 +307,22 @@ class FormatTest(object):
|
|||||||
return self._float
|
return self._float
|
||||||
|
|
||||||
@float.setter
|
@float.setter
|
||||||
def float(
|
def float(self, float): # noqa: E501
|
||||||
self,
|
|
||||||
float):
|
|
||||||
"""Sets the float of this FormatTest.
|
"""Sets the float of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
:param float: The float of this FormatTest. # noqa: E501
|
:param float: The float of this FormatTest. # noqa: E501
|
||||||
:type: float
|
:type: float
|
||||||
"""
|
"""
|
||||||
if float is not None and float > 987.6: # noqa: E501
|
check_validations(
|
||||||
raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501
|
self.validations,
|
||||||
if float is not None and float < 54.3: # noqa: E501
|
('float',),
|
||||||
raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501
|
float
|
||||||
|
)
|
||||||
|
|
||||||
self._float = (
|
self._float = (
|
||||||
float)
|
float
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def double(self):
|
def double(self):
|
||||||
@ -270,22 +335,22 @@ class FormatTest(object):
|
|||||||
return self._double
|
return self._double
|
||||||
|
|
||||||
@double.setter
|
@double.setter
|
||||||
def double(
|
def double(self, double): # noqa: E501
|
||||||
self,
|
|
||||||
double):
|
|
||||||
"""Sets the double of this FormatTest.
|
"""Sets the double of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
:param double: The double of this FormatTest. # noqa: E501
|
:param double: The double of this FormatTest. # noqa: E501
|
||||||
:type: float
|
:type: float
|
||||||
"""
|
"""
|
||||||
if double is not None and double > 123.4: # noqa: E501
|
check_validations(
|
||||||
raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501
|
self.validations,
|
||||||
if double is not None and double < 67.8: # noqa: E501
|
('double',),
|
||||||
raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501
|
double
|
||||||
|
)
|
||||||
|
|
||||||
self._double = (
|
self._double = (
|
||||||
double)
|
double
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def string(self):
|
def string(self):
|
||||||
@ -298,20 +363,22 @@ class FormatTest(object):
|
|||||||
return self._string
|
return self._string
|
||||||
|
|
||||||
@string.setter
|
@string.setter
|
||||||
def string(
|
def string(self, string): # noqa: E501
|
||||||
self,
|
|
||||||
string):
|
|
||||||
"""Sets the string of this FormatTest.
|
"""Sets the string of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
:param string: The string of this FormatTest. # noqa: E501
|
:param string: The string of this FormatTest. # noqa: E501
|
||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501
|
check_validations(
|
||||||
raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501
|
self.validations,
|
||||||
|
('string',),
|
||||||
|
string
|
||||||
|
)
|
||||||
|
|
||||||
self._string = (
|
self._string = (
|
||||||
string)
|
string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def byte(self):
|
def byte(self):
|
||||||
@ -324,9 +391,7 @@ class FormatTest(object):
|
|||||||
return self._byte
|
return self._byte
|
||||||
|
|
||||||
@byte.setter
|
@byte.setter
|
||||||
def byte(
|
def byte(self, byte): # noqa: E501
|
||||||
self,
|
|
||||||
byte):
|
|
||||||
"""Sets the byte of this FormatTest.
|
"""Sets the byte of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -334,12 +399,16 @@ class FormatTest(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if byte is None:
|
if byte is None:
|
||||||
raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `byte`, must not be `None`") # noqa: E501
|
||||||
if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501
|
check_validations(
|
||||||
raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501
|
self.validations,
|
||||||
|
('byte',),
|
||||||
|
byte
|
||||||
|
)
|
||||||
|
|
||||||
self._byte = (
|
self._byte = (
|
||||||
byte)
|
byte
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def binary(self):
|
def binary(self):
|
||||||
@ -352,9 +421,7 @@ class FormatTest(object):
|
|||||||
return self._binary
|
return self._binary
|
||||||
|
|
||||||
@binary.setter
|
@binary.setter
|
||||||
def binary(
|
def binary(self, binary): # noqa: E501
|
||||||
self,
|
|
||||||
binary):
|
|
||||||
"""Sets the binary of this FormatTest.
|
"""Sets the binary of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -363,7 +430,8 @@ class FormatTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._binary = (
|
self._binary = (
|
||||||
binary)
|
binary
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def date(self):
|
def date(self):
|
||||||
@ -376,9 +444,7 @@ class FormatTest(object):
|
|||||||
return self._date
|
return self._date
|
||||||
|
|
||||||
@date.setter
|
@date.setter
|
||||||
def date(
|
def date(self, date): # noqa: E501
|
||||||
self,
|
|
||||||
date):
|
|
||||||
"""Sets the date of this FormatTest.
|
"""Sets the date of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -386,10 +452,11 @@ class FormatTest(object):
|
|||||||
:type: date
|
:type: date
|
||||||
"""
|
"""
|
||||||
if date is None:
|
if date is None:
|
||||||
raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `date`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._date = (
|
self._date = (
|
||||||
date)
|
date
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def date_time(self):
|
def date_time(self):
|
||||||
@ -402,9 +469,7 @@ class FormatTest(object):
|
|||||||
return self._date_time
|
return self._date_time
|
||||||
|
|
||||||
@date_time.setter
|
@date_time.setter
|
||||||
def date_time(
|
def date_time(self, date_time): # noqa: E501
|
||||||
self,
|
|
||||||
date_time):
|
|
||||||
"""Sets the date_time of this FormatTest.
|
"""Sets the date_time of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -413,7 +478,8 @@ class FormatTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._date_time = (
|
self._date_time = (
|
||||||
date_time)
|
date_time
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uuid(self):
|
def uuid(self):
|
||||||
@ -426,9 +492,7 @@ class FormatTest(object):
|
|||||||
return self._uuid
|
return self._uuid
|
||||||
|
|
||||||
@uuid.setter
|
@uuid.setter
|
||||||
def uuid(
|
def uuid(self, uuid): # noqa: E501
|
||||||
self,
|
|
||||||
uuid):
|
|
||||||
"""Sets the uuid of this FormatTest.
|
"""Sets the uuid of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -437,7 +501,8 @@ class FormatTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._uuid = (
|
self._uuid = (
|
||||||
uuid)
|
uuid
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def password(self):
|
def password(self):
|
||||||
@ -450,9 +515,7 @@ class FormatTest(object):
|
|||||||
return self._password
|
return self._password
|
||||||
|
|
||||||
@password.setter
|
@password.setter
|
||||||
def password(
|
def password(self, password): # noqa: E501
|
||||||
self,
|
|
||||||
password):
|
|
||||||
"""Sets the password of this FormatTest.
|
"""Sets the password of this FormatTest.
|
||||||
|
|
||||||
|
|
||||||
@ -460,14 +523,16 @@ class FormatTest(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if password is None:
|
if password is None:
|
||||||
raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `password`, must not be `None`") # noqa: E501
|
||||||
if password is not None and len(password) > 64:
|
check_validations(
|
||||||
raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501
|
self.validations,
|
||||||
if password is not None and len(password) < 10:
|
('password',),
|
||||||
raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501
|
password
|
||||||
|
)
|
||||||
|
|
||||||
self._password = (
|
self._password = (
|
||||||
password)
|
password
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,75 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class HasOnlyReadOnly(object):
|
class HasOnlyReadOnly(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'bar': 'str',
|
allowed_values = {
|
||||||
'foo': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'bar': 'bar', # noqa: E501
|
'bar': 'bar', # noqa: E501
|
||||||
'foo': 'foo', # noqa: E501
|
'foo': 'foo' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'bar': 'str',
|
||||||
|
'foo': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, bar=None, foo=None): # noqa: E501
|
def __init__(self, bar=None, foo=None): # noqa: E501
|
||||||
"""HasOnlyReadOnly - a model defined in OpenAPI
|
"""HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
bar (str): [optional] # noqa: E501
|
|
||||||
foo (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._bar = None
|
self._bar = None
|
||||||
self._foo = None
|
self._foo = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if bar is not None:
|
if bar is not None:
|
||||||
self.bar = bar # noqa: E501
|
self.bar = (
|
||||||
|
bar
|
||||||
|
)
|
||||||
if foo is not None:
|
if foo is not None:
|
||||||
self.foo = foo # noqa: E501
|
self.foo = (
|
||||||
|
foo
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bar(self):
|
def bar(self):
|
||||||
@ -70,9 +91,7 @@ class HasOnlyReadOnly(object):
|
|||||||
return self._bar
|
return self._bar
|
||||||
|
|
||||||
@bar.setter
|
@bar.setter
|
||||||
def bar(
|
def bar(self, bar): # noqa: E501
|
||||||
self,
|
|
||||||
bar):
|
|
||||||
"""Sets the bar of this HasOnlyReadOnly.
|
"""Sets the bar of this HasOnlyReadOnly.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +100,8 @@ class HasOnlyReadOnly(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._bar = (
|
self._bar = (
|
||||||
bar)
|
bar
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def foo(self):
|
def foo(self):
|
||||||
@ -94,9 +114,7 @@ class HasOnlyReadOnly(object):
|
|||||||
return self._foo
|
return self._foo
|
||||||
|
|
||||||
@foo.setter
|
@foo.setter
|
||||||
def foo(
|
def foo(self, foo): # noqa: E501
|
||||||
self,
|
|
||||||
foo):
|
|
||||||
"""Sets the foo of this HasOnlyReadOnly.
|
"""Sets the foo of this HasOnlyReadOnly.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +123,8 @@ class HasOnlyReadOnly(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._foo = (
|
self._foo = (
|
||||||
foo)
|
foo
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class List(object):
|
class List(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'_123_list': 'str',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'_123_list': '123-list', # noqa: E501
|
'_123_list': '123-list' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'_123_list': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, _123_list=None): # noqa: E501
|
def __init__(self, _123_list=None): # noqa: E501
|
||||||
"""List - a model defined in OpenAPI
|
"""List - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
_123_list (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.__123_list = None
|
self.__123_list = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if _123_list is not None:
|
if _123_list is not None:
|
||||||
self._123_list = _123_list # noqa: E501
|
self._123_list = (
|
||||||
|
_123_list
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _123_list(self):
|
def _123_list(self):
|
||||||
@ -64,9 +84,7 @@ class List(object):
|
|||||||
return self.__123_list
|
return self.__123_list
|
||||||
|
|
||||||
@_123_list.setter
|
@_123_list.setter
|
||||||
def _123_list(
|
def _123_list(self, _123_list): # noqa: E501
|
||||||
self,
|
|
||||||
_123_list):
|
|
||||||
"""Sets the _123_list of this List.
|
"""Sets the _123_list of this List.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class List(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.__123_list = (
|
self.__123_list = (
|
||||||
_123_list)
|
_123_list
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,51 +10,70 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class MapTest(object):
|
class MapTest(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'map_map_of_string': 'dict(str, dict(str, str))',
|
allowed_values = {
|
||||||
'map_of_enum_string': 'dict(str, str)',
|
('map_of_enum_string',): {
|
||||||
'direct_map': 'dict(str, bool)',
|
'UPPER': "UPPER",
|
||||||
'indirect_map': 'dict(str, bool)',
|
'LOWER': "lower"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'map_map_of_string': 'map_map_of_string', # noqa: E501
|
'map_map_of_string': 'map_map_of_string', # noqa: E501
|
||||||
'map_of_enum_string': 'map_of_enum_string', # noqa: E501
|
'map_of_enum_string': 'map_of_enum_string', # noqa: E501
|
||||||
'direct_map': 'direct_map', # noqa: E501
|
'direct_map': 'direct_map', # noqa: E501
|
||||||
'indirect_map': 'indirect_map', # noqa: E501
|
'indirect_map': 'indirect_map' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'map_map_of_string': 'dict(str, dict(str, str))',
|
||||||
|
'map_of_enum_string': 'dict(str, str)',
|
||||||
|
'direct_map': 'dict(str, bool)',
|
||||||
|
'indirect_map': 'StringBooleanMap'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501
|
def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501
|
||||||
"""MapTest - a model defined in OpenAPI
|
"""MapTest - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
map_map_of_string (dict(str, dict(str, str))): [optional] # noqa: E501
|
|
||||||
map_of_enum_string (dict(str, str)): [optional] # noqa: E501
|
|
||||||
direct_map (dict(str, bool)): [optional] # noqa: E501
|
|
||||||
indirect_map (dict(str, bool)): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._map_map_of_string = None
|
self._map_map_of_string = None
|
||||||
self._map_of_enum_string = None
|
self._map_of_enum_string = None
|
||||||
@ -63,13 +82,21 @@ class MapTest(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if map_map_of_string is not None:
|
if map_map_of_string is not None:
|
||||||
self.map_map_of_string = map_map_of_string # noqa: E501
|
self.map_map_of_string = (
|
||||||
|
map_map_of_string
|
||||||
|
)
|
||||||
if map_of_enum_string is not None:
|
if map_of_enum_string is not None:
|
||||||
self.map_of_enum_string = map_of_enum_string # noqa: E501
|
self.map_of_enum_string = (
|
||||||
|
map_of_enum_string
|
||||||
|
)
|
||||||
if direct_map is not None:
|
if direct_map is not None:
|
||||||
self.direct_map = direct_map # noqa: E501
|
self.direct_map = (
|
||||||
|
direct_map
|
||||||
|
)
|
||||||
if indirect_map is not None:
|
if indirect_map is not None:
|
||||||
self.indirect_map = indirect_map # noqa: E501
|
self.indirect_map = (
|
||||||
|
indirect_map
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_map_of_string(self):
|
def map_map_of_string(self):
|
||||||
@ -82,9 +109,7 @@ class MapTest(object):
|
|||||||
return self._map_map_of_string
|
return self._map_map_of_string
|
||||||
|
|
||||||
@map_map_of_string.setter
|
@map_map_of_string.setter
|
||||||
def map_map_of_string(
|
def map_map_of_string(self, map_map_of_string): # noqa: E501
|
||||||
self,
|
|
||||||
map_map_of_string):
|
|
||||||
"""Sets the map_map_of_string of this MapTest.
|
"""Sets the map_map_of_string of this MapTest.
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +118,8 @@ class MapTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map_map_of_string = (
|
self._map_map_of_string = (
|
||||||
map_map_of_string)
|
map_map_of_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map_of_enum_string(self):
|
def map_of_enum_string(self):
|
||||||
@ -106,25 +132,23 @@ class MapTest(object):
|
|||||||
return self._map_of_enum_string
|
return self._map_of_enum_string
|
||||||
|
|
||||||
@map_of_enum_string.setter
|
@map_of_enum_string.setter
|
||||||
def map_of_enum_string(
|
def map_of_enum_string(self, map_of_enum_string): # noqa: E501
|
||||||
self,
|
|
||||||
map_of_enum_string):
|
|
||||||
"""Sets the map_of_enum_string of this MapTest.
|
"""Sets the map_of_enum_string of this MapTest.
|
||||||
|
|
||||||
|
|
||||||
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
|
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
|
||||||
:type: dict(str, str)
|
:type: dict(str, str)
|
||||||
"""
|
"""
|
||||||
allowed_values = ["UPPER", "lower"] # noqa: E501
|
check_allowed_values(
|
||||||
if not set(map_of_enum_string.keys()).issubset(set(allowed_values)):
|
self.allowed_values,
|
||||||
raise ValueError(
|
('map_of_enum_string',),
|
||||||
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
map_of_enum_string,
|
||||||
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
self.validations
|
||||||
", ".join(map(str, allowed_values)))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self._map_of_enum_string = (
|
self._map_of_enum_string = (
|
||||||
map_of_enum_string)
|
map_of_enum_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def direct_map(self):
|
def direct_map(self):
|
||||||
@ -137,9 +161,7 @@ class MapTest(object):
|
|||||||
return self._direct_map
|
return self._direct_map
|
||||||
|
|
||||||
@direct_map.setter
|
@direct_map.setter
|
||||||
def direct_map(
|
def direct_map(self, direct_map): # noqa: E501
|
||||||
self,
|
|
||||||
direct_map):
|
|
||||||
"""Sets the direct_map of this MapTest.
|
"""Sets the direct_map of this MapTest.
|
||||||
|
|
||||||
|
|
||||||
@ -148,7 +170,8 @@ class MapTest(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._direct_map = (
|
self._direct_map = (
|
||||||
direct_map)
|
direct_map
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def indirect_map(self):
|
def indirect_map(self):
|
||||||
@ -156,23 +179,22 @@ class MapTest(object):
|
|||||||
|
|
||||||
|
|
||||||
:return: The indirect_map of this MapTest. # noqa: E501
|
:return: The indirect_map of this MapTest. # noqa: E501
|
||||||
:rtype: dict(str, bool)
|
:rtype: StringBooleanMap
|
||||||
"""
|
"""
|
||||||
return self._indirect_map
|
return self._indirect_map
|
||||||
|
|
||||||
@indirect_map.setter
|
@indirect_map.setter
|
||||||
def indirect_map(
|
def indirect_map(self, indirect_map): # noqa: E501
|
||||||
self,
|
|
||||||
indirect_map):
|
|
||||||
"""Sets the indirect_map of this MapTest.
|
"""Sets the indirect_map of this MapTest.
|
||||||
|
|
||||||
|
|
||||||
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
|
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
|
||||||
:type: dict(str, bool)
|
:type: StringBooleanMap
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._indirect_map = (
|
self._indirect_map = (
|
||||||
indirect_map)
|
indirect_map
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,64 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class MixedPropertiesAndAdditionalPropertiesClass(object):
|
class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'uuid': 'str',
|
allowed_values = {
|
||||||
'date_time': 'datetime',
|
|
||||||
'map': 'dict(str, Animal)',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'uuid': 'uuid', # noqa: E501
|
'uuid': 'uuid', # noqa: E501
|
||||||
'date_time': 'dateTime', # noqa: E501
|
'date_time': 'dateTime', # noqa: E501
|
||||||
'map': 'map', # noqa: E501
|
'map': 'map' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'uuid': 'str',
|
||||||
|
'date_time': 'datetime',
|
||||||
|
'map': 'dict(str, Animal)'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501
|
def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501
|
||||||
"""MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI
|
"""MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
uuid (str): [optional] # noqa: E501
|
|
||||||
date_time (datetime): [optional] # noqa: E501
|
|
||||||
map (dict(str, Animal)): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._uuid = None
|
self._uuid = None
|
||||||
self._date_time = None
|
self._date_time = None
|
||||||
@ -59,11 +75,17 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if uuid is not None:
|
if uuid is not None:
|
||||||
self.uuid = uuid # noqa: E501
|
self.uuid = (
|
||||||
|
uuid
|
||||||
|
)
|
||||||
if date_time is not None:
|
if date_time is not None:
|
||||||
self.date_time = date_time # noqa: E501
|
self.date_time = (
|
||||||
|
date_time
|
||||||
|
)
|
||||||
if map is not None:
|
if map is not None:
|
||||||
self.map = map # noqa: E501
|
self.map = (
|
||||||
|
map
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uuid(self):
|
def uuid(self):
|
||||||
@ -76,9 +98,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
return self._uuid
|
return self._uuid
|
||||||
|
|
||||||
@uuid.setter
|
@uuid.setter
|
||||||
def uuid(
|
def uuid(self, uuid): # noqa: E501
|
||||||
self,
|
|
||||||
uuid):
|
|
||||||
"""Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass.
|
"""Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +107,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._uuid = (
|
self._uuid = (
|
||||||
uuid)
|
uuid
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def date_time(self):
|
def date_time(self):
|
||||||
@ -100,9 +121,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
return self._date_time
|
return self._date_time
|
||||||
|
|
||||||
@date_time.setter
|
@date_time.setter
|
||||||
def date_time(
|
def date_time(self, date_time): # noqa: E501
|
||||||
self,
|
|
||||||
date_time):
|
|
||||||
"""Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass.
|
"""Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +130,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._date_time = (
|
self._date_time = (
|
||||||
date_time)
|
date_time
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def map(self):
|
def map(self):
|
||||||
@ -124,9 +144,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
return self._map
|
return self._map
|
||||||
|
|
||||||
@map.setter
|
@map.setter
|
||||||
def map(
|
def map(self, map): # noqa: E501
|
||||||
self,
|
|
||||||
map):
|
|
||||||
"""Sets the map of this MixedPropertiesAndAdditionalPropertiesClass.
|
"""Sets the map of this MixedPropertiesAndAdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +153,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._map = (
|
self._map = (
|
||||||
map)
|
map
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,75 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Model200Response(object):
|
class Model200Response(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'int',
|
allowed_values = {
|
||||||
'_class': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name', # noqa: E501
|
||||||
'_class': 'class', # noqa: E501
|
'_class': 'class' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'int',
|
||||||
|
'_class': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name=None, _class=None): # noqa: E501
|
def __init__(self, name=None, _class=None): # noqa: E501
|
||||||
"""Model200Response - a model defined in OpenAPI
|
"""Model200Response - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
name (int): [optional] # noqa: E501
|
|
||||||
_class (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.__class = None
|
self.__class = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
if _class is not None:
|
if _class is not None:
|
||||||
self._class = _class # noqa: E501
|
self._class = (
|
||||||
|
_class
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -70,9 +91,7 @@ class Model200Response(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this Model200Response.
|
"""Sets the name of this Model200Response.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +100,8 @@ class Model200Response(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _class(self):
|
def _class(self):
|
||||||
@ -94,9 +114,7 @@ class Model200Response(object):
|
|||||||
return self.__class
|
return self.__class
|
||||||
|
|
||||||
@_class.setter
|
@_class.setter
|
||||||
def _class(
|
def _class(self, _class): # noqa: E501
|
||||||
self,
|
|
||||||
_class):
|
|
||||||
"""Sets the _class of this Model200Response.
|
"""Sets the _class of this Model200Response.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +123,8 @@ class Model200Response(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.__class = (
|
self.__class = (
|
||||||
_class)
|
_class
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ModelReturn(object):
|
class ModelReturn(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'_return': 'int',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'_return': 'return', # noqa: E501
|
'_return': 'return' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'_return': 'int'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, _return=None): # noqa: E501
|
def __init__(self, _return=None): # noqa: E501
|
||||||
"""ModelReturn - a model defined in OpenAPI
|
"""ModelReturn - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
_return (int): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.__return = None
|
self.__return = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if _return is not None:
|
if _return is not None:
|
||||||
self._return = _return # noqa: E501
|
self._return = (
|
||||||
|
_return
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _return(self):
|
def _return(self):
|
||||||
@ -64,9 +84,7 @@ class ModelReturn(object):
|
|||||||
return self.__return
|
return self.__return
|
||||||
|
|
||||||
@_return.setter
|
@_return.setter
|
||||||
def _return(
|
def _return(self, _return): # noqa: E501
|
||||||
self,
|
|
||||||
_return):
|
|
||||||
"""Sets the _return of this ModelReturn.
|
"""Sets the _return of this ModelReturn.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class ModelReturn(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.__return = (
|
self.__return = (
|
||||||
_return)
|
_return
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,51 +10,66 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Name(object):
|
class Name(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'int',
|
allowed_values = {
|
||||||
'snake_case': 'int',
|
|
||||||
'_property': 'str',
|
|
||||||
'_123_number': 'int',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name', # noqa: E501
|
||||||
'snake_case': 'snake_case', # noqa: E501
|
'snake_case': 'snake_case', # noqa: E501
|
||||||
'_property': 'property', # noqa: E501
|
'_property': 'property', # noqa: E501
|
||||||
'_123_number': '123Number', # noqa: E501
|
'_123_number': '123Number' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name, snake_case=None, _property=None, _123_number=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Name - a model defined in OpenAPI
|
'name': 'int',
|
||||||
|
'snake_case': 'int',
|
||||||
|
'_property': 'str',
|
||||||
|
'_123_number': 'int'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
name (int):
|
}
|
||||||
|
|
||||||
Keyword Args: # noqa: E501
|
def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501
|
||||||
snake_case (int): [optional] # noqa: E501
|
"""Name - a model defined in OpenAPI""" # noqa: E501
|
||||||
_property (str): [optional] # noqa: E501
|
|
||||||
_123_number (int): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self._snake_case = None
|
self._snake_case = None
|
||||||
@ -64,11 +79,17 @@ class Name(object):
|
|||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
if snake_case is not None:
|
if snake_case is not None:
|
||||||
self.snake_case = snake_case # noqa: E501
|
self.snake_case = (
|
||||||
|
snake_case
|
||||||
|
)
|
||||||
if _property is not None:
|
if _property is not None:
|
||||||
self._property = _property # noqa: E501
|
self._property = (
|
||||||
|
_property
|
||||||
|
)
|
||||||
if _123_number is not None:
|
if _123_number is not None:
|
||||||
self._123_number = _123_number # noqa: E501
|
self._123_number = (
|
||||||
|
_123_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -81,9 +102,7 @@ class Name(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this Name.
|
"""Sets the name of this Name.
|
||||||
|
|
||||||
|
|
||||||
@ -91,10 +110,11 @@ class Name(object):
|
|||||||
:type: int
|
:type: int
|
||||||
"""
|
"""
|
||||||
if name is None:
|
if name is None:
|
||||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def snake_case(self):
|
def snake_case(self):
|
||||||
@ -107,9 +127,7 @@ class Name(object):
|
|||||||
return self._snake_case
|
return self._snake_case
|
||||||
|
|
||||||
@snake_case.setter
|
@snake_case.setter
|
||||||
def snake_case(
|
def snake_case(self, snake_case): # noqa: E501
|
||||||
self,
|
|
||||||
snake_case):
|
|
||||||
"""Sets the snake_case of this Name.
|
"""Sets the snake_case of this Name.
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +136,8 @@ class Name(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._snake_case = (
|
self._snake_case = (
|
||||||
snake_case)
|
snake_case
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _property(self):
|
def _property(self):
|
||||||
@ -131,9 +150,7 @@ class Name(object):
|
|||||||
return self.__property
|
return self.__property
|
||||||
|
|
||||||
@_property.setter
|
@_property.setter
|
||||||
def _property(
|
def _property(self, _property): # noqa: E501
|
||||||
self,
|
|
||||||
_property):
|
|
||||||
"""Sets the _property of this Name.
|
"""Sets the _property of this Name.
|
||||||
|
|
||||||
|
|
||||||
@ -142,7 +159,8 @@ class Name(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.__property = (
|
self.__property = (
|
||||||
_property)
|
_property
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _123_number(self):
|
def _123_number(self):
|
||||||
@ -155,9 +173,7 @@ class Name(object):
|
|||||||
return self.__123_number
|
return self.__123_number
|
||||||
|
|
||||||
@_123_number.setter
|
@_123_number.setter
|
||||||
def _123_number(
|
def _123_number(self, _123_number): # noqa: E501
|
||||||
self,
|
|
||||||
_123_number):
|
|
||||||
"""Sets the _123_number of this Name.
|
"""Sets the _123_number of this Name.
|
||||||
|
|
||||||
|
|
||||||
@ -166,7 +182,8 @@ class Name(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.__123_number = (
|
self.__123_number = (
|
||||||
_123_number)
|
_123_number
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class NumberOnly(object):
|
class NumberOnly(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'just_number': 'float',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'just_number': 'JustNumber', # noqa: E501
|
'just_number': 'JustNumber' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'just_number': 'float'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, just_number=None): # noqa: E501
|
def __init__(self, just_number=None): # noqa: E501
|
||||||
"""NumberOnly - a model defined in OpenAPI
|
"""NumberOnly - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
just_number (float): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._just_number = None
|
self._just_number = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if just_number is not None:
|
if just_number is not None:
|
||||||
self.just_number = just_number # noqa: E501
|
self.just_number = (
|
||||||
|
just_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def just_number(self):
|
def just_number(self):
|
||||||
@ -64,9 +84,7 @@ class NumberOnly(object):
|
|||||||
return self._just_number
|
return self._just_number
|
||||||
|
|
||||||
@just_number.setter
|
@just_number.setter
|
||||||
def just_number(
|
def just_number(self, just_number): # noqa: E501
|
||||||
self,
|
|
||||||
just_number):
|
|
||||||
"""Sets the just_number of this NumberOnly.
|
"""Sets the just_number of this NumberOnly.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class NumberOnly(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._just_number = (
|
self._just_number = (
|
||||||
just_number)
|
just_number
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,33 +10,50 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Order(object):
|
class Order(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'id': 'int',
|
allowed_values = {
|
||||||
'pet_id': 'int',
|
('status',): {
|
||||||
'quantity': 'int',
|
'PLACED': "placed",
|
||||||
'ship_date': 'datetime',
|
'APPROVED': "approved",
|
||||||
'status': 'str',
|
'DELIVERED': "delivered"
|
||||||
'complete': 'bool',
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -45,22 +62,23 @@ class Order(object):
|
|||||||
'quantity': 'quantity', # noqa: E501
|
'quantity': 'quantity', # noqa: E501
|
||||||
'ship_date': 'shipDate', # noqa: E501
|
'ship_date': 'shipDate', # noqa: E501
|
||||||
'status': 'status', # noqa: E501
|
'status': 'status', # noqa: E501
|
||||||
'complete': 'complete', # noqa: E501
|
'complete': 'complete' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Order - a model defined in OpenAPI
|
'id': 'int',
|
||||||
|
'pet_id': 'int',
|
||||||
|
'quantity': 'int',
|
||||||
|
'ship_date': 'datetime',
|
||||||
|
'status': 'str',
|
||||||
|
'complete': 'bool'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501
|
||||||
Keyword Args:
|
"""Order - a model defined in OpenAPI""" # noqa: E501
|
||||||
id (int): [optional] # noqa: E501
|
|
||||||
pet_id (int): [optional] # noqa: E501
|
|
||||||
quantity (int): [optional] # noqa: E501
|
|
||||||
ship_date (datetime): [optional] # noqa: E501
|
|
||||||
status (str): Order Status. [optional] # noqa: E501
|
|
||||||
complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = None
|
self._id = None
|
||||||
self._pet_id = None
|
self._pet_id = None
|
||||||
@ -71,17 +89,29 @@ class Order(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if id is not None:
|
if id is not None:
|
||||||
self.id = id # noqa: E501
|
self.id = (
|
||||||
|
id
|
||||||
|
)
|
||||||
if pet_id is not None:
|
if pet_id is not None:
|
||||||
self.pet_id = pet_id # noqa: E501
|
self.pet_id = (
|
||||||
|
pet_id
|
||||||
|
)
|
||||||
if quantity is not None:
|
if quantity is not None:
|
||||||
self.quantity = quantity # noqa: E501
|
self.quantity = (
|
||||||
|
quantity
|
||||||
|
)
|
||||||
if ship_date is not None:
|
if ship_date is not None:
|
||||||
self.ship_date = ship_date # noqa: E501
|
self.ship_date = (
|
||||||
|
ship_date
|
||||||
|
)
|
||||||
if status is not None:
|
if status is not None:
|
||||||
self.status = status # noqa: E501
|
self.status = (
|
||||||
|
status
|
||||||
|
)
|
||||||
if complete is not None:
|
if complete is not None:
|
||||||
self.complete = complete # noqa: E501
|
self.complete = (
|
||||||
|
complete
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
@ -94,9 +124,7 @@ class Order(object):
|
|||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(
|
def id(self, id): # noqa: E501
|
||||||
self,
|
|
||||||
id):
|
|
||||||
"""Sets the id of this Order.
|
"""Sets the id of this Order.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +133,8 @@ class Order(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._id = (
|
self._id = (
|
||||||
id)
|
id
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pet_id(self):
|
def pet_id(self):
|
||||||
@ -118,9 +147,7 @@ class Order(object):
|
|||||||
return self._pet_id
|
return self._pet_id
|
||||||
|
|
||||||
@pet_id.setter
|
@pet_id.setter
|
||||||
def pet_id(
|
def pet_id(self, pet_id): # noqa: E501
|
||||||
self,
|
|
||||||
pet_id):
|
|
||||||
"""Sets the pet_id of this Order.
|
"""Sets the pet_id of this Order.
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +156,8 @@ class Order(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._pet_id = (
|
self._pet_id = (
|
||||||
pet_id)
|
pet_id
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def quantity(self):
|
def quantity(self):
|
||||||
@ -142,9 +170,7 @@ class Order(object):
|
|||||||
return self._quantity
|
return self._quantity
|
||||||
|
|
||||||
@quantity.setter
|
@quantity.setter
|
||||||
def quantity(
|
def quantity(self, quantity): # noqa: E501
|
||||||
self,
|
|
||||||
quantity):
|
|
||||||
"""Sets the quantity of this Order.
|
"""Sets the quantity of this Order.
|
||||||
|
|
||||||
|
|
||||||
@ -153,7 +179,8 @@ class Order(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._quantity = (
|
self._quantity = (
|
||||||
quantity)
|
quantity
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ship_date(self):
|
def ship_date(self):
|
||||||
@ -166,9 +193,7 @@ class Order(object):
|
|||||||
return self._ship_date
|
return self._ship_date
|
||||||
|
|
||||||
@ship_date.setter
|
@ship_date.setter
|
||||||
def ship_date(
|
def ship_date(self, ship_date): # noqa: E501
|
||||||
self,
|
|
||||||
ship_date):
|
|
||||||
"""Sets the ship_date of this Order.
|
"""Sets the ship_date of this Order.
|
||||||
|
|
||||||
|
|
||||||
@ -177,7 +202,8 @@ class Order(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._ship_date = (
|
self._ship_date = (
|
||||||
ship_date)
|
ship_date
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
@ -191,9 +217,7 @@ class Order(object):
|
|||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
@status.setter
|
@status.setter
|
||||||
def status(
|
def status(self, status): # noqa: E501
|
||||||
self,
|
|
||||||
status):
|
|
||||||
"""Sets the status of this Order.
|
"""Sets the status of this Order.
|
||||||
|
|
||||||
Order Status # noqa: E501
|
Order Status # noqa: E501
|
||||||
@ -201,15 +225,16 @@ class Order(object):
|
|||||||
:param status: The status of this Order. # noqa: E501
|
:param status: The status of this Order. # noqa: E501
|
||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
allowed_values = ["placed", "approved", "delivered"] # noqa: E501
|
check_allowed_values(
|
||||||
if status not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('status',),
|
||||||
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
|
status,
|
||||||
.format(status, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._status = (
|
self._status = (
|
||||||
status)
|
status
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def complete(self):
|
def complete(self):
|
||||||
@ -222,9 +247,7 @@ class Order(object):
|
|||||||
return self._complete
|
return self._complete
|
||||||
|
|
||||||
@complete.setter
|
@complete.setter
|
||||||
def complete(
|
def complete(self, complete): # noqa: E501
|
||||||
self,
|
|
||||||
complete):
|
|
||||||
"""Sets the complete of this Order.
|
"""Sets the complete of this Order.
|
||||||
|
|
||||||
|
|
||||||
@ -233,7 +256,8 @@ class Order(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._complete = (
|
self._complete = (
|
||||||
complete)
|
complete
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,64 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class OuterComposite(object):
|
class OuterComposite(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'my_number': 'float',
|
allowed_values = {
|
||||||
'my_string': 'str',
|
|
||||||
'my_boolean': 'bool',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'my_number': 'my_number', # noqa: E501
|
'my_number': 'my_number', # noqa: E501
|
||||||
'my_string': 'my_string', # noqa: E501
|
'my_string': 'my_string', # noqa: E501
|
||||||
'my_boolean': 'my_boolean', # noqa: E501
|
'my_boolean': 'my_boolean' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'my_number': 'OuterNumber',
|
||||||
|
'my_string': 'str',
|
||||||
|
'my_boolean': 'bool'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501
|
def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501
|
||||||
"""OuterComposite - a model defined in OpenAPI
|
"""OuterComposite - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
my_number (float): [optional] # noqa: E501
|
|
||||||
my_string (str): [optional] # noqa: E501
|
|
||||||
my_boolean (bool): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._my_number = None
|
self._my_number = None
|
||||||
self._my_string = None
|
self._my_string = None
|
||||||
@ -59,11 +75,17 @@ class OuterComposite(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if my_number is not None:
|
if my_number is not None:
|
||||||
self.my_number = my_number # noqa: E501
|
self.my_number = (
|
||||||
|
my_number
|
||||||
|
)
|
||||||
if my_string is not None:
|
if my_string is not None:
|
||||||
self.my_string = my_string # noqa: E501
|
self.my_string = (
|
||||||
|
my_string
|
||||||
|
)
|
||||||
if my_boolean is not None:
|
if my_boolean is not None:
|
||||||
self.my_boolean = my_boolean # noqa: E501
|
self.my_boolean = (
|
||||||
|
my_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def my_number(self):
|
def my_number(self):
|
||||||
@ -71,23 +93,22 @@ class OuterComposite(object):
|
|||||||
|
|
||||||
|
|
||||||
:return: The my_number of this OuterComposite. # noqa: E501
|
:return: The my_number of this OuterComposite. # noqa: E501
|
||||||
:rtype: float
|
:rtype: OuterNumber
|
||||||
"""
|
"""
|
||||||
return self._my_number
|
return self._my_number
|
||||||
|
|
||||||
@my_number.setter
|
@my_number.setter
|
||||||
def my_number(
|
def my_number(self, my_number): # noqa: E501
|
||||||
self,
|
|
||||||
my_number):
|
|
||||||
"""Sets the my_number of this OuterComposite.
|
"""Sets the my_number of this OuterComposite.
|
||||||
|
|
||||||
|
|
||||||
:param my_number: The my_number of this OuterComposite. # noqa: E501
|
:param my_number: The my_number of this OuterComposite. # noqa: E501
|
||||||
:type: float
|
:type: OuterNumber
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._my_number = (
|
self._my_number = (
|
||||||
my_number)
|
my_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def my_string(self):
|
def my_string(self):
|
||||||
@ -100,9 +121,7 @@ class OuterComposite(object):
|
|||||||
return self._my_string
|
return self._my_string
|
||||||
|
|
||||||
@my_string.setter
|
@my_string.setter
|
||||||
def my_string(
|
def my_string(self, my_string): # noqa: E501
|
||||||
self,
|
|
||||||
my_string):
|
|
||||||
"""Sets the my_string of this OuterComposite.
|
"""Sets the my_string of this OuterComposite.
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +130,8 @@ class OuterComposite(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._my_string = (
|
self._my_string = (
|
||||||
my_string)
|
my_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def my_boolean(self):
|
def my_boolean(self):
|
||||||
@ -124,9 +144,7 @@ class OuterComposite(object):
|
|||||||
return self._my_boolean
|
return self._my_boolean
|
||||||
|
|
||||||
@my_boolean.setter
|
@my_boolean.setter
|
||||||
def my_boolean(
|
def my_boolean(self, my_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
my_boolean):
|
|
||||||
"""Sets the my_boolean of this OuterComposite.
|
"""Sets the my_boolean of this OuterComposite.
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +153,8 @@ class OuterComposite(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._my_boolean = (
|
self._my_boolean = (
|
||||||
my_boolean)
|
my_boolean
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,75 +10,97 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class OuterEnum(object):
|
class OuterEnum(ModelSimple):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
allowed enum values
|
|
||||||
"""
|
|
||||||
PLACED = "placed"
|
|
||||||
APPROVED = "approved"
|
|
||||||
DELIVERED = "delivered"
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
openapi_types (dict): The key is attribute name
|
openapi_types (dict): The key is attribute name
|
||||||
and the value is attribute type.
|
and the value is attribute type.
|
||||||
attribute_map (dict): The key is attribute name
|
validations (dict): The key is the tuple path to the attribute
|
||||||
and the value is json key in definition.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
allowed_values = {
|
||||||
|
('value',): {
|
||||||
|
'PLACED': "placed",
|
||||||
|
'APPROVED': "approved",
|
||||||
|
'DELIVERED': "delivered"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
openapi_types = {
|
openapi_types = {
|
||||||
|
'value': 'str'
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self): # noqa: E501
|
def __init__(self, value=None): # noqa: E501
|
||||||
"""OuterEnum - a model defined in OpenAPI
|
"""OuterEnum - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._value = None
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
"""
|
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
def to_dict(self):
|
self.value = value
|
||||||
"""Returns the model properties as a dict"""
|
|
||||||
result = {}
|
|
||||||
|
|
||||||
for attr, _ in six.iteritems(self.openapi_types):
|
@property
|
||||||
value = getattr(self, attr)
|
def value(self):
|
||||||
if isinstance(value, list):
|
"""Gets the value of this OuterEnum. # noqa: E501
|
||||||
result[attr] = list(map(
|
|
||||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
||||||
|
:return: The value of this OuterEnum. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._value
|
||||||
|
|
||||||
|
@value.setter
|
||||||
|
def value(self, value): # noqa: E501
|
||||||
|
"""Sets the value of this OuterEnum.
|
||||||
|
|
||||||
|
|
||||||
|
:param value: The value of this OuterEnum. # noqa: E501
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
if value is None:
|
||||||
|
raise ApiValueError("Invalid value for `value`, must not be `None`") # noqa: E501
|
||||||
|
check_allowed_values(
|
||||||
|
self.allowed_values,
|
||||||
|
('value',),
|
||||||
|
value,
|
||||||
|
self.validations
|
||||||
|
)
|
||||||
|
|
||||||
|
self._value = (
|
||||||
value
|
value
|
||||||
))
|
)
|
||||||
elif hasattr(value, "to_dict"):
|
|
||||||
result[attr] = value.to_dict()
|
|
||||||
elif isinstance(value, dict):
|
|
||||||
result[attr] = dict(map(
|
|
||||||
lambda item: (item[0], item[1].to_dict())
|
|
||||||
if hasattr(item[1], "to_dict") else item,
|
|
||||||
value.items()
|
|
||||||
))
|
|
||||||
else:
|
|
||||||
result[attr] = value
|
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
||||||
def to_str(self):
|
def to_str(self):
|
||||||
"""Returns the string representation of the model"""
|
"""Returns the string representation of the model"""
|
||||||
return pprint.pformat(self.to_dict())
|
return str(self._value)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""For `print` and `pprint`"""
|
"""For `print` and `pprint`"""
|
||||||
|
@ -0,0 +1,117 @@
|
|||||||
|
# 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 pprint # noqa: F401
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class OuterNumber(ModelSimple):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
|
"""
|
||||||
|
|
||||||
|
allowed_values = {
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'value': 'float'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
|
('value',): {
|
||||||
|
|
||||||
|
'inclusive_maximum': 2E+1,
|
||||||
|
'inclusive_minimum': 1E+1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, value=None): # noqa: E501
|
||||||
|
"""OuterNumber - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._value = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def value(self):
|
||||||
|
"""Gets the value of this OuterNumber. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The value of this OuterNumber. # noqa: E501
|
||||||
|
:rtype: float
|
||||||
|
"""
|
||||||
|
return self._value
|
||||||
|
|
||||||
|
@value.setter
|
||||||
|
def value(self, value): # noqa: E501
|
||||||
|
"""Sets the value of this OuterNumber.
|
||||||
|
|
||||||
|
|
||||||
|
:param value: The value of this OuterNumber. # noqa: E501
|
||||||
|
:type: float
|
||||||
|
"""
|
||||||
|
if value is None:
|
||||||
|
raise ApiValueError("Invalid value for `value`, must not be `None`") # noqa: E501
|
||||||
|
check_validations(
|
||||||
|
self.validations,
|
||||||
|
('value',),
|
||||||
|
value
|
||||||
|
)
|
||||||
|
|
||||||
|
self._value = (
|
||||||
|
value
|
||||||
|
)
|
||||||
|
|
||||||
|
def to_str(self):
|
||||||
|
"""Returns the string representation of the model"""
|
||||||
|
return str(self._value)
|
||||||
|
|
||||||
|
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, OuterNumber):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -10,57 +10,75 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Pet(object):
|
class Pet(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'name': 'str',
|
allowed_values = {
|
||||||
'photo_urls': 'list[str]',
|
('status',): {
|
||||||
'id': 'int',
|
'AVAILABLE': "available",
|
||||||
'category': 'Category',
|
'PENDING': "pending",
|
||||||
'tags': 'list[Tag]',
|
'SOLD': "sold"
|
||||||
'status': 'str',
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'name': 'name', # noqa: E501
|
|
||||||
'photo_urls': 'photoUrls', # noqa: E501
|
|
||||||
'id': 'id', # noqa: E501
|
'id': 'id', # noqa: E501
|
||||||
'category': 'category', # noqa: E501
|
'category': 'category', # noqa: E501
|
||||||
|
'name': 'name', # noqa: E501
|
||||||
|
'photo_urls': 'photoUrls', # noqa: E501
|
||||||
'tags': 'tags', # noqa: E501
|
'tags': 'tags', # noqa: E501
|
||||||
'status': 'status', # noqa: E501
|
'status': 'status' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name, photo_urls, id=None, category=None, tags=None, status=None): # noqa: E501
|
openapi_types = {
|
||||||
"""Pet - a model defined in OpenAPI
|
'id': 'int',
|
||||||
|
'category': 'Category',
|
||||||
|
'name': 'str',
|
||||||
|
'photo_urls': 'list[str]',
|
||||||
|
'tags': 'list[Tag]',
|
||||||
|
'status': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
name (str):
|
}
|
||||||
photo_urls (list[str]):
|
|
||||||
|
|
||||||
Keyword Args: # noqa: E501 # noqa: E501
|
def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501
|
||||||
id (int): [optional] # noqa: E501
|
"""Pet - a model defined in OpenAPI""" # noqa: E501
|
||||||
category (Category): [optional] # noqa: E501
|
|
||||||
tags (list[Tag]): [optional] # noqa: E501
|
|
||||||
status (str): pet status in the store. [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = None
|
self._id = None
|
||||||
self._category = None
|
self._category = None
|
||||||
@ -71,15 +89,23 @@ class Pet(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if id is not None:
|
if id is not None:
|
||||||
self.id = id # noqa: E501
|
self.id = (
|
||||||
|
id
|
||||||
|
)
|
||||||
if category is not None:
|
if category is not None:
|
||||||
self.category = category # noqa: E501
|
self.category = (
|
||||||
|
category
|
||||||
|
)
|
||||||
self.name = name
|
self.name = name
|
||||||
self.photo_urls = photo_urls
|
self.photo_urls = photo_urls
|
||||||
if tags is not None:
|
if tags is not None:
|
||||||
self.tags = tags # noqa: E501
|
self.tags = (
|
||||||
|
tags
|
||||||
|
)
|
||||||
if status is not None:
|
if status is not None:
|
||||||
self.status = status # noqa: E501
|
self.status = (
|
||||||
|
status
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
@ -92,9 +118,7 @@ class Pet(object):
|
|||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(
|
def id(self, id): # noqa: E501
|
||||||
self,
|
|
||||||
id):
|
|
||||||
"""Sets the id of this Pet.
|
"""Sets the id of this Pet.
|
||||||
|
|
||||||
|
|
||||||
@ -103,7 +127,8 @@ class Pet(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._id = (
|
self._id = (
|
||||||
id)
|
id
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def category(self):
|
def category(self):
|
||||||
@ -116,9 +141,7 @@ class Pet(object):
|
|||||||
return self._category
|
return self._category
|
||||||
|
|
||||||
@category.setter
|
@category.setter
|
||||||
def category(
|
def category(self, category): # noqa: E501
|
||||||
self,
|
|
||||||
category):
|
|
||||||
"""Sets the category of this Pet.
|
"""Sets the category of this Pet.
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +150,8 @@ class Pet(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._category = (
|
self._category = (
|
||||||
category)
|
category
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -140,9 +164,7 @@ class Pet(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this Pet.
|
"""Sets the name of this Pet.
|
||||||
|
|
||||||
|
|
||||||
@ -150,10 +172,11 @@ class Pet(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if name is None:
|
if name is None:
|
||||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def photo_urls(self):
|
def photo_urls(self):
|
||||||
@ -166,9 +189,7 @@ class Pet(object):
|
|||||||
return self._photo_urls
|
return self._photo_urls
|
||||||
|
|
||||||
@photo_urls.setter
|
@photo_urls.setter
|
||||||
def photo_urls(
|
def photo_urls(self, photo_urls): # noqa: E501
|
||||||
self,
|
|
||||||
photo_urls):
|
|
||||||
"""Sets the photo_urls of this Pet.
|
"""Sets the photo_urls of this Pet.
|
||||||
|
|
||||||
|
|
||||||
@ -176,10 +197,11 @@ class Pet(object):
|
|||||||
:type: list[str]
|
:type: list[str]
|
||||||
"""
|
"""
|
||||||
if photo_urls is None:
|
if photo_urls is None:
|
||||||
raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._photo_urls = (
|
self._photo_urls = (
|
||||||
photo_urls)
|
photo_urls
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tags(self):
|
def tags(self):
|
||||||
@ -192,9 +214,7 @@ class Pet(object):
|
|||||||
return self._tags
|
return self._tags
|
||||||
|
|
||||||
@tags.setter
|
@tags.setter
|
||||||
def tags(
|
def tags(self, tags): # noqa: E501
|
||||||
self,
|
|
||||||
tags):
|
|
||||||
"""Sets the tags of this Pet.
|
"""Sets the tags of this Pet.
|
||||||
|
|
||||||
|
|
||||||
@ -203,7 +223,8 @@ class Pet(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._tags = (
|
self._tags = (
|
||||||
tags)
|
tags
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
@ -217,9 +238,7 @@ class Pet(object):
|
|||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
@status.setter
|
@status.setter
|
||||||
def status(
|
def status(self, status): # noqa: E501
|
||||||
self,
|
|
||||||
status):
|
|
||||||
"""Sets the status of this Pet.
|
"""Sets the status of this Pet.
|
||||||
|
|
||||||
pet status in the store # noqa: E501
|
pet status in the store # noqa: E501
|
||||||
@ -227,15 +246,16 @@ class Pet(object):
|
|||||||
:param status: The status of this Pet. # noqa: E501
|
:param status: The status of this Pet. # noqa: E501
|
||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
allowed_values = ["available", "pending", "sold"] # noqa: E501
|
check_allowed_values(
|
||||||
if status not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('status',),
|
||||||
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
|
status,
|
||||||
.format(status, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._status = (
|
self._status = (
|
||||||
status)
|
status
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,54 +10,75 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ReadOnlyFirst(object):
|
class ReadOnlyFirst(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'bar': 'str',
|
allowed_values = {
|
||||||
'baz': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'bar': 'bar', # noqa: E501
|
'bar': 'bar', # noqa: E501
|
||||||
'baz': 'baz', # noqa: E501
|
'baz': 'baz' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'bar': 'str',
|
||||||
|
'baz': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, bar=None, baz=None): # noqa: E501
|
def __init__(self, bar=None, baz=None): # noqa: E501
|
||||||
"""ReadOnlyFirst - a model defined in OpenAPI
|
"""ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
bar (str): [optional] # noqa: E501
|
|
||||||
baz (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._bar = None
|
self._bar = None
|
||||||
self._baz = None
|
self._baz = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if bar is not None:
|
if bar is not None:
|
||||||
self.bar = bar # noqa: E501
|
self.bar = (
|
||||||
|
bar
|
||||||
|
)
|
||||||
if baz is not None:
|
if baz is not None:
|
||||||
self.baz = baz # noqa: E501
|
self.baz = (
|
||||||
|
baz
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bar(self):
|
def bar(self):
|
||||||
@ -70,9 +91,7 @@ class ReadOnlyFirst(object):
|
|||||||
return self._bar
|
return self._bar
|
||||||
|
|
||||||
@bar.setter
|
@bar.setter
|
||||||
def bar(
|
def bar(self, bar): # noqa: E501
|
||||||
self,
|
|
||||||
bar):
|
|
||||||
"""Sets the bar of this ReadOnlyFirst.
|
"""Sets the bar of this ReadOnlyFirst.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +100,8 @@ class ReadOnlyFirst(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._bar = (
|
self._bar = (
|
||||||
bar)
|
bar
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def baz(self):
|
def baz(self):
|
||||||
@ -94,9 +114,7 @@ class ReadOnlyFirst(object):
|
|||||||
return self._baz
|
return self._baz
|
||||||
|
|
||||||
@baz.setter
|
@baz.setter
|
||||||
def baz(
|
def baz(self, baz): # noqa: E501
|
||||||
self,
|
|
||||||
baz):
|
|
||||||
"""Sets the baz of this ReadOnlyFirst.
|
"""Sets the baz of this ReadOnlyFirst.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +123,8 @@ class ReadOnlyFirst(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._baz = (
|
self._baz = (
|
||||||
baz)
|
baz
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,48 +10,68 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SpecialModelName(object):
|
class SpecialModelName(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'special_property_name': 'int',
|
allowed_values = {
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'special_property_name': '$special[property.name]', # noqa: E501
|
'special_property_name': '$special[property.name]' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'special_property_name': 'int'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, special_property_name=None): # noqa: E501
|
def __init__(self, special_property_name=None): # noqa: E501
|
||||||
"""SpecialModelName - a model defined in OpenAPI
|
"""SpecialModelName - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
special_property_name (int): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._special_property_name = None
|
self._special_property_name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if special_property_name is not None:
|
if special_property_name is not None:
|
||||||
self.special_property_name = special_property_name # noqa: E501
|
self.special_property_name = (
|
||||||
|
special_property_name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def special_property_name(self):
|
def special_property_name(self):
|
||||||
@ -64,9 +84,7 @@ class SpecialModelName(object):
|
|||||||
return self._special_property_name
|
return self._special_property_name
|
||||||
|
|
||||||
@special_property_name.setter
|
@special_property_name.setter
|
||||||
def special_property_name(
|
def special_property_name(self, special_property_name): # noqa: E501
|
||||||
self,
|
|
||||||
special_property_name):
|
|
||||||
"""Sets the special_property_name of this SpecialModelName.
|
"""Sets the special_property_name of this SpecialModelName.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +93,8 @@ class SpecialModelName(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._special_property_name = (
|
self._special_property_name = (
|
||||||
special_property_name)
|
special_property_name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -0,0 +1,108 @@
|
|||||||
|
# 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 pprint # noqa: F401
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class StringBooleanMap(ModelNormal):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
|
"""
|
||||||
|
|
||||||
|
allowed_values = {
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self): # noqa: E501
|
||||||
|
"""StringBooleanMap - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""Returns the model properties as a dict"""
|
||||||
|
result = {}
|
||||||
|
|
||||||
|
for attr, _ in six.iteritems(self.openapi_types):
|
||||||
|
value = getattr(self, attr)
|
||||||
|
if isinstance(value, list):
|
||||||
|
result[attr] = list(map(
|
||||||
|
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||||
|
value
|
||||||
|
))
|
||||||
|
elif hasattr(value, "to_dict"):
|
||||||
|
result[attr] = value.to_dict()
|
||||||
|
elif isinstance(value, dict):
|
||||||
|
result[attr] = dict(map(
|
||||||
|
lambda item: (item[0], item[1].to_dict())
|
||||||
|
if hasattr(item[1], "to_dict") else item,
|
||||||
|
value.items()
|
||||||
|
))
|
||||||
|
else:
|
||||||
|
result[attr] = 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, StringBooleanMap):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -10,54 +10,75 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Tag(object):
|
class Tag(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'id': 'int',
|
allowed_values = {
|
||||||
'name': 'str',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'id': 'id', # noqa: E501
|
'id': 'id', # noqa: E501
|
||||||
'name': 'name', # noqa: E501
|
'name': 'name' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'id': 'int',
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, id=None, name=None): # noqa: E501
|
def __init__(self, id=None, name=None): # noqa: E501
|
||||||
"""Tag - a model defined in OpenAPI
|
"""Tag - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
id (int): [optional] # noqa: E501
|
|
||||||
name (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = None
|
self._id = None
|
||||||
self._name = None
|
self._name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if id is not None:
|
if id is not None:
|
||||||
self.id = id # noqa: E501
|
self.id = (
|
||||||
|
id
|
||||||
|
)
|
||||||
if name is not None:
|
if name is not None:
|
||||||
self.name = name # noqa: E501
|
self.name = (
|
||||||
|
name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
@ -70,9 +91,7 @@ class Tag(object):
|
|||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(
|
def id(self, id): # noqa: E501
|
||||||
self,
|
|
||||||
id):
|
|
||||||
"""Sets the id of this Tag.
|
"""Sets the id of this Tag.
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +100,8 @@ class Tag(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._id = (
|
self._id = (
|
||||||
id)
|
id
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -94,9 +114,7 @@ class Tag(object):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(
|
def name(self, name): # noqa: E501
|
||||||
self,
|
|
||||||
name):
|
|
||||||
"""Sets the name of this Tag.
|
"""Sets the name of this Tag.
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +123,8 @@ class Tag(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name = (
|
self._name = (
|
||||||
name)
|
name
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,34 +10,45 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TypeHolderDefault(object):
|
class TypeHolderDefault(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'string_item': 'str',
|
allowed_values = {
|
||||||
'number_item': 'float',
|
|
||||||
'integer_item': 'int',
|
|
||||||
'bool_item': 'bool',
|
|
||||||
'array_item': 'list[int]',
|
|
||||||
'date_item': 'date',
|
|
||||||
'datetime_item': 'datetime',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -45,25 +56,26 @@ class TypeHolderDefault(object):
|
|||||||
'number_item': 'number_item', # noqa: E501
|
'number_item': 'number_item', # noqa: E501
|
||||||
'integer_item': 'integer_item', # noqa: E501
|
'integer_item': 'integer_item', # noqa: E501
|
||||||
'bool_item': 'bool_item', # noqa: E501
|
'bool_item': 'bool_item', # noqa: E501
|
||||||
'array_item': 'array_item', # noqa: E501
|
|
||||||
'date_item': 'date_item', # noqa: E501
|
'date_item': 'date_item', # noqa: E501
|
||||||
'datetime_item': 'datetime_item', # noqa: E501
|
'datetime_item': 'datetime_item', # noqa: E501
|
||||||
|
'array_item': 'array_item' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, array_item, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, date_item=None, datetime_item=None): # noqa: E501
|
openapi_types = {
|
||||||
"""TypeHolderDefault - a model defined in OpenAPI
|
'string_item': 'str',
|
||||||
|
'number_item': 'float',
|
||||||
|
'integer_item': 'int',
|
||||||
|
'bool_item': 'bool',
|
||||||
|
'date_item': 'date',
|
||||||
|
'datetime_item': 'datetime',
|
||||||
|
'array_item': 'list[int]'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
array_item (list[int]):
|
}
|
||||||
|
|
||||||
Keyword Args:
|
def __init__(self, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, date_item=None, datetime_item=None, array_item=None): # noqa: E501
|
||||||
string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501
|
"""TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501
|
||||||
number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501
|
|
||||||
integer_item (int): defaults to -2, must be one of [-2] # noqa: E501
|
|
||||||
bool_item (bool): defaults to True, must be one of [True] # noqa: E501 # noqa: E501
|
|
||||||
date_item (date): [optional] # noqa: E501
|
|
||||||
datetime_item (datetime): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._string_item = None
|
self._string_item = None
|
||||||
self._number_item = None
|
self._number_item = None
|
||||||
@ -79,9 +91,13 @@ class TypeHolderDefault(object):
|
|||||||
self.integer_item = integer_item
|
self.integer_item = integer_item
|
||||||
self.bool_item = bool_item
|
self.bool_item = bool_item
|
||||||
if date_item is not None:
|
if date_item is not None:
|
||||||
self.date_item = date_item # noqa: E501
|
self.date_item = (
|
||||||
|
date_item
|
||||||
|
)
|
||||||
if datetime_item is not None:
|
if datetime_item is not None:
|
||||||
self.datetime_item = datetime_item # noqa: E501
|
self.datetime_item = (
|
||||||
|
datetime_item
|
||||||
|
)
|
||||||
self.array_item = array_item
|
self.array_item = array_item
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -95,9 +111,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._string_item
|
return self._string_item
|
||||||
|
|
||||||
@string_item.setter
|
@string_item.setter
|
||||||
def string_item(
|
def string_item(self, string_item): # noqa: E501
|
||||||
self,
|
|
||||||
string_item):
|
|
||||||
"""Sets the string_item of this TypeHolderDefault.
|
"""Sets the string_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -105,10 +119,11 @@ class TypeHolderDefault(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if string_item is None:
|
if string_item is None:
|
||||||
raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._string_item = (
|
self._string_item = (
|
||||||
string_item)
|
string_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number_item(self):
|
def number_item(self):
|
||||||
@ -121,9 +136,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._number_item
|
return self._number_item
|
||||||
|
|
||||||
@number_item.setter
|
@number_item.setter
|
||||||
def number_item(
|
def number_item(self, number_item): # noqa: E501
|
||||||
self,
|
|
||||||
number_item):
|
|
||||||
"""Sets the number_item of this TypeHolderDefault.
|
"""Sets the number_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -131,10 +144,11 @@ class TypeHolderDefault(object):
|
|||||||
:type: float
|
:type: float
|
||||||
"""
|
"""
|
||||||
if number_item is None:
|
if number_item is None:
|
||||||
raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._number_item = (
|
self._number_item = (
|
||||||
number_item)
|
number_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def integer_item(self):
|
def integer_item(self):
|
||||||
@ -147,9 +161,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._integer_item
|
return self._integer_item
|
||||||
|
|
||||||
@integer_item.setter
|
@integer_item.setter
|
||||||
def integer_item(
|
def integer_item(self, integer_item): # noqa: E501
|
||||||
self,
|
|
||||||
integer_item):
|
|
||||||
"""Sets the integer_item of this TypeHolderDefault.
|
"""Sets the integer_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -157,10 +169,11 @@ class TypeHolderDefault(object):
|
|||||||
:type: int
|
:type: int
|
||||||
"""
|
"""
|
||||||
if integer_item is None:
|
if integer_item is None:
|
||||||
raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._integer_item = (
|
self._integer_item = (
|
||||||
integer_item)
|
integer_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bool_item(self):
|
def bool_item(self):
|
||||||
@ -173,9 +186,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._bool_item
|
return self._bool_item
|
||||||
|
|
||||||
@bool_item.setter
|
@bool_item.setter
|
||||||
def bool_item(
|
def bool_item(self, bool_item): # noqa: E501
|
||||||
self,
|
|
||||||
bool_item):
|
|
||||||
"""Sets the bool_item of this TypeHolderDefault.
|
"""Sets the bool_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -183,10 +194,11 @@ class TypeHolderDefault(object):
|
|||||||
:type: bool
|
:type: bool
|
||||||
"""
|
"""
|
||||||
if bool_item is None:
|
if bool_item is None:
|
||||||
raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._bool_item = (
|
self._bool_item = (
|
||||||
bool_item)
|
bool_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def date_item(self):
|
def date_item(self):
|
||||||
@ -199,9 +211,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._date_item
|
return self._date_item
|
||||||
|
|
||||||
@date_item.setter
|
@date_item.setter
|
||||||
def date_item(
|
def date_item(self, date_item): # noqa: E501
|
||||||
self,
|
|
||||||
date_item):
|
|
||||||
"""Sets the date_item of this TypeHolderDefault.
|
"""Sets the date_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -210,7 +220,8 @@ class TypeHolderDefault(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._date_item = (
|
self._date_item = (
|
||||||
date_item)
|
date_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def datetime_item(self):
|
def datetime_item(self):
|
||||||
@ -223,9 +234,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._datetime_item
|
return self._datetime_item
|
||||||
|
|
||||||
@datetime_item.setter
|
@datetime_item.setter
|
||||||
def datetime_item(
|
def datetime_item(self, datetime_item): # noqa: E501
|
||||||
self,
|
|
||||||
datetime_item):
|
|
||||||
"""Sets the datetime_item of this TypeHolderDefault.
|
"""Sets the datetime_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -234,7 +243,8 @@ class TypeHolderDefault(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._datetime_item = (
|
self._datetime_item = (
|
||||||
datetime_item)
|
datetime_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_item(self):
|
def array_item(self):
|
||||||
@ -247,9 +257,7 @@ class TypeHolderDefault(object):
|
|||||||
return self._array_item
|
return self._array_item
|
||||||
|
|
||||||
@array_item.setter
|
@array_item.setter
|
||||||
def array_item(
|
def array_item(self, array_item): # noqa: E501
|
||||||
self,
|
|
||||||
array_item):
|
|
||||||
"""Sets the array_item of this TypeHolderDefault.
|
"""Sets the array_item of this TypeHolderDefault.
|
||||||
|
|
||||||
|
|
||||||
@ -257,10 +265,11 @@ class TypeHolderDefault(object):
|
|||||||
:type: list[int]
|
:type: list[int]
|
||||||
"""
|
"""
|
||||||
if array_item is None:
|
if array_item is None:
|
||||||
raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._array_item = (
|
self._array_item = (
|
||||||
array_item)
|
array_item
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,32 +10,54 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TypeHolderExample(object):
|
class TypeHolderExample(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'string_item': 'str',
|
allowed_values = {
|
||||||
'number_item': 'float',
|
('string_item',): {
|
||||||
'integer_item': 'int',
|
'WHAT': "what"
|
||||||
'bool_item': 'bool',
|
},
|
||||||
'array_item': 'list[int]',
|
('number_item',): {
|
||||||
|
'1.234': 1.234
|
||||||
|
},
|
||||||
|
('integer_item',): {
|
||||||
|
'-2': -2
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -43,21 +65,22 @@ class TypeHolderExample(object):
|
|||||||
'number_item': 'number_item', # noqa: E501
|
'number_item': 'number_item', # noqa: E501
|
||||||
'integer_item': 'integer_item', # noqa: E501
|
'integer_item': 'integer_item', # noqa: E501
|
||||||
'bool_item': 'bool_item', # noqa: E501
|
'bool_item': 'bool_item', # noqa: E501
|
||||||
'array_item': 'array_item', # noqa: E501
|
'array_item': 'array_item' # noqa: E501
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, integer_item=-2): # noqa: E501
|
openapi_types = {
|
||||||
"""TypeHolderExample - a model defined in OpenAPI
|
'string_item': 'str',
|
||||||
|
'number_item': 'float',
|
||||||
|
'integer_item': 'int',
|
||||||
|
'bool_item': 'bool',
|
||||||
|
'array_item': 'list[int]'
|
||||||
|
}
|
||||||
|
|
||||||
Args:
|
validations = {
|
||||||
bool_item (bool):
|
}
|
||||||
array_item (list[int]):
|
|
||||||
|
|
||||||
Keyword Args:
|
def __init__(self, string_item='what', number_item=1.234, integer_item=-2, bool_item=None, array_item=None): # noqa: E501
|
||||||
string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501
|
"""TypeHolderExample - a model defined in OpenAPI""" # noqa: E501
|
||||||
number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501
|
|
||||||
integer_item (int): defaults to -2, must be one of [-2] # noqa: E501 # noqa: E501 # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._string_item = None
|
self._string_item = None
|
||||||
self._number_item = None
|
self._number_item = None
|
||||||
@ -83,9 +106,7 @@ class TypeHolderExample(object):
|
|||||||
return self._string_item
|
return self._string_item
|
||||||
|
|
||||||
@string_item.setter
|
@string_item.setter
|
||||||
def string_item(
|
def string_item(self, string_item): # noqa: E501
|
||||||
self,
|
|
||||||
string_item):
|
|
||||||
"""Sets the string_item of this TypeHolderExample.
|
"""Sets the string_item of this TypeHolderExample.
|
||||||
|
|
||||||
|
|
||||||
@ -93,16 +114,17 @@ class TypeHolderExample(object):
|
|||||||
:type: str
|
:type: str
|
||||||
"""
|
"""
|
||||||
if string_item is None:
|
if string_item is None:
|
||||||
raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501
|
||||||
allowed_values = ["what"] # noqa: E501
|
check_allowed_values(
|
||||||
if string_item not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('string_item',),
|
||||||
"Invalid value for `string_item` ({0}), must be one of {1}" # noqa: E501
|
string_item,
|
||||||
.format(string_item, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._string_item = (
|
self._string_item = (
|
||||||
string_item)
|
string_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number_item(self):
|
def number_item(self):
|
||||||
@ -115,9 +137,7 @@ class TypeHolderExample(object):
|
|||||||
return self._number_item
|
return self._number_item
|
||||||
|
|
||||||
@number_item.setter
|
@number_item.setter
|
||||||
def number_item(
|
def number_item(self, number_item): # noqa: E501
|
||||||
self,
|
|
||||||
number_item):
|
|
||||||
"""Sets the number_item of this TypeHolderExample.
|
"""Sets the number_item of this TypeHolderExample.
|
||||||
|
|
||||||
|
|
||||||
@ -125,16 +145,17 @@ class TypeHolderExample(object):
|
|||||||
:type: float
|
:type: float
|
||||||
"""
|
"""
|
||||||
if number_item is None:
|
if number_item is None:
|
||||||
raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501
|
||||||
allowed_values = [1.234] # noqa: E501
|
check_allowed_values(
|
||||||
if number_item not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('number_item',),
|
||||||
"Invalid value for `number_item` ({0}), must be one of {1}" # noqa: E501
|
number_item,
|
||||||
.format(number_item, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._number_item = (
|
self._number_item = (
|
||||||
number_item)
|
number_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def integer_item(self):
|
def integer_item(self):
|
||||||
@ -147,9 +168,7 @@ class TypeHolderExample(object):
|
|||||||
return self._integer_item
|
return self._integer_item
|
||||||
|
|
||||||
@integer_item.setter
|
@integer_item.setter
|
||||||
def integer_item(
|
def integer_item(self, integer_item): # noqa: E501
|
||||||
self,
|
|
||||||
integer_item):
|
|
||||||
"""Sets the integer_item of this TypeHolderExample.
|
"""Sets the integer_item of this TypeHolderExample.
|
||||||
|
|
||||||
|
|
||||||
@ -157,16 +176,17 @@ class TypeHolderExample(object):
|
|||||||
:type: int
|
:type: int
|
||||||
"""
|
"""
|
||||||
if integer_item is None:
|
if integer_item is None:
|
||||||
raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501
|
||||||
allowed_values = [-2] # noqa: E501
|
check_allowed_values(
|
||||||
if integer_item not in allowed_values:
|
self.allowed_values,
|
||||||
raise ValueError(
|
('integer_item',),
|
||||||
"Invalid value for `integer_item` ({0}), must be one of {1}" # noqa: E501
|
integer_item,
|
||||||
.format(integer_item, allowed_values)
|
self.validations
|
||||||
)
|
)
|
||||||
|
|
||||||
self._integer_item = (
|
self._integer_item = (
|
||||||
integer_item)
|
integer_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bool_item(self):
|
def bool_item(self):
|
||||||
@ -179,9 +199,7 @@ class TypeHolderExample(object):
|
|||||||
return self._bool_item
|
return self._bool_item
|
||||||
|
|
||||||
@bool_item.setter
|
@bool_item.setter
|
||||||
def bool_item(
|
def bool_item(self, bool_item): # noqa: E501
|
||||||
self,
|
|
||||||
bool_item):
|
|
||||||
"""Sets the bool_item of this TypeHolderExample.
|
"""Sets the bool_item of this TypeHolderExample.
|
||||||
|
|
||||||
|
|
||||||
@ -189,10 +207,11 @@ class TypeHolderExample(object):
|
|||||||
:type: bool
|
:type: bool
|
||||||
"""
|
"""
|
||||||
if bool_item is None:
|
if bool_item is None:
|
||||||
raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._bool_item = (
|
self._bool_item = (
|
||||||
bool_item)
|
bool_item
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def array_item(self):
|
def array_item(self):
|
||||||
@ -205,9 +224,7 @@ class TypeHolderExample(object):
|
|||||||
return self._array_item
|
return self._array_item
|
||||||
|
|
||||||
@array_item.setter
|
@array_item.setter
|
||||||
def array_item(
|
def array_item(self, array_item): # noqa: E501
|
||||||
self,
|
|
||||||
array_item):
|
|
||||||
"""Sets the array_item of this TypeHolderExample.
|
"""Sets the array_item of this TypeHolderExample.
|
||||||
|
|
||||||
|
|
||||||
@ -215,10 +232,11 @@ class TypeHolderExample(object):
|
|||||||
:type: list[int]
|
:type: list[int]
|
||||||
"""
|
"""
|
||||||
if array_item is None:
|
if array_item is None:
|
||||||
raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501
|
raise ApiValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._array_item = (
|
self._array_item = (
|
||||||
array_item)
|
array_item
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,35 +10,45 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class User(object):
|
class User(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'id': 'int',
|
allowed_values = {
|
||||||
'username': 'str',
|
|
||||||
'first_name': 'str',
|
|
||||||
'last_name': 'str',
|
|
||||||
'email': 'str',
|
|
||||||
'password': 'str',
|
|
||||||
'phone': 'str',
|
|
||||||
'user_status': 'int',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -49,24 +59,25 @@ class User(object):
|
|||||||
'email': 'email', # noqa: E501
|
'email': 'email', # noqa: E501
|
||||||
'password': 'password', # noqa: E501
|
'password': 'password', # noqa: E501
|
||||||
'phone': 'phone', # noqa: E501
|
'phone': 'phone', # noqa: E501
|
||||||
'user_status': 'userStatus', # noqa: E501
|
'user_status': 'userStatus' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'id': 'int',
|
||||||
|
'username': 'str',
|
||||||
|
'first_name': 'str',
|
||||||
|
'last_name': 'str',
|
||||||
|
'email': 'str',
|
||||||
|
'password': 'str',
|
||||||
|
'phone': 'str',
|
||||||
|
'user_status': 'int'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501
|
def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501
|
||||||
"""User - a model defined in OpenAPI
|
"""User - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
id (int): [optional] # noqa: E501
|
|
||||||
username (str): [optional] # noqa: E501
|
|
||||||
first_name (str): [optional] # noqa: E501
|
|
||||||
last_name (str): [optional] # noqa: E501
|
|
||||||
email (str): [optional] # noqa: E501
|
|
||||||
password (str): [optional] # noqa: E501
|
|
||||||
phone (str): [optional] # noqa: E501
|
|
||||||
user_status (int): User Status. [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = None
|
self._id = None
|
||||||
self._username = None
|
self._username = None
|
||||||
@ -79,21 +90,37 @@ class User(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if id is not None:
|
if id is not None:
|
||||||
self.id = id # noqa: E501
|
self.id = (
|
||||||
|
id
|
||||||
|
)
|
||||||
if username is not None:
|
if username is not None:
|
||||||
self.username = username # noqa: E501
|
self.username = (
|
||||||
|
username
|
||||||
|
)
|
||||||
if first_name is not None:
|
if first_name is not None:
|
||||||
self.first_name = first_name # noqa: E501
|
self.first_name = (
|
||||||
|
first_name
|
||||||
|
)
|
||||||
if last_name is not None:
|
if last_name is not None:
|
||||||
self.last_name = last_name # noqa: E501
|
self.last_name = (
|
||||||
|
last_name
|
||||||
|
)
|
||||||
if email is not None:
|
if email is not None:
|
||||||
self.email = email # noqa: E501
|
self.email = (
|
||||||
|
email
|
||||||
|
)
|
||||||
if password is not None:
|
if password is not None:
|
||||||
self.password = password # noqa: E501
|
self.password = (
|
||||||
|
password
|
||||||
|
)
|
||||||
if phone is not None:
|
if phone is not None:
|
||||||
self.phone = phone # noqa: E501
|
self.phone = (
|
||||||
|
phone
|
||||||
|
)
|
||||||
if user_status is not None:
|
if user_status is not None:
|
||||||
self.user_status = user_status # noqa: E501
|
self.user_status = (
|
||||||
|
user_status
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
@ -106,9 +133,7 @@ class User(object):
|
|||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(
|
def id(self, id): # noqa: E501
|
||||||
self,
|
|
||||||
id):
|
|
||||||
"""Sets the id of this User.
|
"""Sets the id of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -117,7 +142,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._id = (
|
self._id = (
|
||||||
id)
|
id
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def username(self):
|
def username(self):
|
||||||
@ -130,9 +156,7 @@ class User(object):
|
|||||||
return self._username
|
return self._username
|
||||||
|
|
||||||
@username.setter
|
@username.setter
|
||||||
def username(
|
def username(self, username): # noqa: E501
|
||||||
self,
|
|
||||||
username):
|
|
||||||
"""Sets the username of this User.
|
"""Sets the username of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +165,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._username = (
|
self._username = (
|
||||||
username)
|
username
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def first_name(self):
|
def first_name(self):
|
||||||
@ -154,9 +179,7 @@ class User(object):
|
|||||||
return self._first_name
|
return self._first_name
|
||||||
|
|
||||||
@first_name.setter
|
@first_name.setter
|
||||||
def first_name(
|
def first_name(self, first_name): # noqa: E501
|
||||||
self,
|
|
||||||
first_name):
|
|
||||||
"""Sets the first_name of this User.
|
"""Sets the first_name of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -165,7 +188,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._first_name = (
|
self._first_name = (
|
||||||
first_name)
|
first_name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def last_name(self):
|
def last_name(self):
|
||||||
@ -178,9 +202,7 @@ class User(object):
|
|||||||
return self._last_name
|
return self._last_name
|
||||||
|
|
||||||
@last_name.setter
|
@last_name.setter
|
||||||
def last_name(
|
def last_name(self, last_name): # noqa: E501
|
||||||
self,
|
|
||||||
last_name):
|
|
||||||
"""Sets the last_name of this User.
|
"""Sets the last_name of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -189,7 +211,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._last_name = (
|
self._last_name = (
|
||||||
last_name)
|
last_name
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def email(self):
|
def email(self):
|
||||||
@ -202,9 +225,7 @@ class User(object):
|
|||||||
return self._email
|
return self._email
|
||||||
|
|
||||||
@email.setter
|
@email.setter
|
||||||
def email(
|
def email(self, email): # noqa: E501
|
||||||
self,
|
|
||||||
email):
|
|
||||||
"""Sets the email of this User.
|
"""Sets the email of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -213,7 +234,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._email = (
|
self._email = (
|
||||||
email)
|
email
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def password(self):
|
def password(self):
|
||||||
@ -226,9 +248,7 @@ class User(object):
|
|||||||
return self._password
|
return self._password
|
||||||
|
|
||||||
@password.setter
|
@password.setter
|
||||||
def password(
|
def password(self, password): # noqa: E501
|
||||||
self,
|
|
||||||
password):
|
|
||||||
"""Sets the password of this User.
|
"""Sets the password of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -237,7 +257,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._password = (
|
self._password = (
|
||||||
password)
|
password
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def phone(self):
|
def phone(self):
|
||||||
@ -250,9 +271,7 @@ class User(object):
|
|||||||
return self._phone
|
return self._phone
|
||||||
|
|
||||||
@phone.setter
|
@phone.setter
|
||||||
def phone(
|
def phone(self, phone): # noqa: E501
|
||||||
self,
|
|
||||||
phone):
|
|
||||||
"""Sets the phone of this User.
|
"""Sets the phone of this User.
|
||||||
|
|
||||||
|
|
||||||
@ -261,7 +280,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._phone = (
|
self._phone = (
|
||||||
phone)
|
phone
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_status(self):
|
def user_status(self):
|
||||||
@ -275,9 +295,7 @@ class User(object):
|
|||||||
return self._user_status
|
return self._user_status
|
||||||
|
|
||||||
@user_status.setter
|
@user_status.setter
|
||||||
def user_status(
|
def user_status(self, user_status): # noqa: E501
|
||||||
self,
|
|
||||||
user_status):
|
|
||||||
"""Sets the user_status of this User.
|
"""Sets the user_status of this User.
|
||||||
|
|
||||||
User Status # noqa: E501
|
User Status # noqa: E501
|
||||||
@ -287,7 +305,8 @@ class User(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._user_status = (
|
self._user_status = (
|
||||||
user_status)
|
user_status
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -10,56 +10,45 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import pprint
|
import pprint # noqa: F401
|
||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
|
|
||||||
import six
|
import six # noqa: F401
|
||||||
|
|
||||||
|
from petstore_api.exceptions import ApiValueError # noqa: F401
|
||||||
|
from petstore_api.model_utils import ( # noqa: F401
|
||||||
|
ModelNormal,
|
||||||
|
ModelSimple,
|
||||||
|
check_allowed_values,
|
||||||
|
check_validations
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class XmlItem(object):
|
class XmlItem(ModelNormal):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://openapi-generator.tech
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attributes:
|
Attributes:
|
||||||
openapi_types (dict): The key is attribute name
|
allowed_values (dict): The key is the tuple path to the attribute
|
||||||
and the value is attribute type.
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
with a capitalized key describing the allowed value and an allowed
|
||||||
|
value. These dicts store the allowed enum values.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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.
|
||||||
|
openapi_types (dict): The key is attribute name
|
||||||
|
and the value is attribute type.
|
||||||
|
validations (dict): The key is the tuple path to the attribute
|
||||||
|
and the for var_name this is (var_name,). The value is a dict
|
||||||
|
that stores validations for max_length, min_length, max_items,
|
||||||
|
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||||
|
inclusive_minimum, and regex.
|
||||||
"""
|
"""
|
||||||
openapi_types = {
|
|
||||||
'attribute_string': 'str',
|
allowed_values = {
|
||||||
'attribute_number': 'float',
|
|
||||||
'attribute_integer': 'int',
|
|
||||||
'attribute_boolean': 'bool',
|
|
||||||
'wrapped_array': 'list[int]',
|
|
||||||
'name_string': 'str',
|
|
||||||
'name_number': 'float',
|
|
||||||
'name_integer': 'int',
|
|
||||||
'name_boolean': 'bool',
|
|
||||||
'name_array': 'list[int]',
|
|
||||||
'name_wrapped_array': 'list[int]',
|
|
||||||
'prefix_string': 'str',
|
|
||||||
'prefix_number': 'float',
|
|
||||||
'prefix_integer': 'int',
|
|
||||||
'prefix_boolean': 'bool',
|
|
||||||
'prefix_array': 'list[int]',
|
|
||||||
'prefix_wrapped_array': 'list[int]',
|
|
||||||
'namespace_string': 'str',
|
|
||||||
'namespace_number': 'float',
|
|
||||||
'namespace_integer': 'int',
|
|
||||||
'namespace_boolean': 'bool',
|
|
||||||
'namespace_array': 'list[int]',
|
|
||||||
'namespace_wrapped_array': 'list[int]',
|
|
||||||
'prefix_ns_string': 'str',
|
|
||||||
'prefix_ns_number': 'float',
|
|
||||||
'prefix_ns_integer': 'int',
|
|
||||||
'prefix_ns_boolean': 'bool',
|
|
||||||
'prefix_ns_array': 'list[int]',
|
|
||||||
'prefix_ns_wrapped_array': 'list[int]',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
@ -91,45 +80,46 @@ class XmlItem(object):
|
|||||||
'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501
|
'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501
|
||||||
'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501
|
'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501
|
||||||
'prefix_ns_array': 'prefix_ns_array', # noqa: E501
|
'prefix_ns_array': 'prefix_ns_array', # noqa: E501
|
||||||
'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array', # noqa: E501
|
'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' # noqa: E501
|
||||||
|
}
|
||||||
|
|
||||||
|
openapi_types = {
|
||||||
|
'attribute_string': 'str',
|
||||||
|
'attribute_number': 'float',
|
||||||
|
'attribute_integer': 'int',
|
||||||
|
'attribute_boolean': 'bool',
|
||||||
|
'wrapped_array': 'list[int]',
|
||||||
|
'name_string': 'str',
|
||||||
|
'name_number': 'float',
|
||||||
|
'name_integer': 'int',
|
||||||
|
'name_boolean': 'bool',
|
||||||
|
'name_array': 'list[int]',
|
||||||
|
'name_wrapped_array': 'list[int]',
|
||||||
|
'prefix_string': 'str',
|
||||||
|
'prefix_number': 'float',
|
||||||
|
'prefix_integer': 'int',
|
||||||
|
'prefix_boolean': 'bool',
|
||||||
|
'prefix_array': 'list[int]',
|
||||||
|
'prefix_wrapped_array': 'list[int]',
|
||||||
|
'namespace_string': 'str',
|
||||||
|
'namespace_number': 'float',
|
||||||
|
'namespace_integer': 'int',
|
||||||
|
'namespace_boolean': 'bool',
|
||||||
|
'namespace_array': 'list[int]',
|
||||||
|
'namespace_wrapped_array': 'list[int]',
|
||||||
|
'prefix_ns_string': 'str',
|
||||||
|
'prefix_ns_number': 'float',
|
||||||
|
'prefix_ns_integer': 'int',
|
||||||
|
'prefix_ns_boolean': 'bool',
|
||||||
|
'prefix_ns_array': 'list[int]',
|
||||||
|
'prefix_ns_wrapped_array': 'list[int]'
|
||||||
|
}
|
||||||
|
|
||||||
|
validations = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None): # noqa: E501
|
def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None): # noqa: E501
|
||||||
"""XmlItem - a model defined in OpenAPI
|
"""XmlItem - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
attribute_string (str): [optional] # noqa: E501
|
|
||||||
attribute_number (float): [optional] # noqa: E501
|
|
||||||
attribute_integer (int): [optional] # noqa: E501
|
|
||||||
attribute_boolean (bool): [optional] # noqa: E501
|
|
||||||
wrapped_array (list[int]): [optional] # noqa: E501
|
|
||||||
name_string (str): [optional] # noqa: E501
|
|
||||||
name_number (float): [optional] # noqa: E501
|
|
||||||
name_integer (int): [optional] # noqa: E501
|
|
||||||
name_boolean (bool): [optional] # noqa: E501
|
|
||||||
name_array (list[int]): [optional] # noqa: E501
|
|
||||||
name_wrapped_array (list[int]): [optional] # noqa: E501
|
|
||||||
prefix_string (str): [optional] # noqa: E501
|
|
||||||
prefix_number (float): [optional] # noqa: E501
|
|
||||||
prefix_integer (int): [optional] # noqa: E501
|
|
||||||
prefix_boolean (bool): [optional] # noqa: E501
|
|
||||||
prefix_array (list[int]): [optional] # noqa: E501
|
|
||||||
prefix_wrapped_array (list[int]): [optional] # noqa: E501
|
|
||||||
namespace_string (str): [optional] # noqa: E501
|
|
||||||
namespace_number (float): [optional] # noqa: E501
|
|
||||||
namespace_integer (int): [optional] # noqa: E501
|
|
||||||
namespace_boolean (bool): [optional] # noqa: E501
|
|
||||||
namespace_array (list[int]): [optional] # noqa: E501
|
|
||||||
namespace_wrapped_array (list[int]): [optional] # noqa: E501
|
|
||||||
prefix_ns_string (str): [optional] # noqa: E501
|
|
||||||
prefix_ns_number (float): [optional] # noqa: E501
|
|
||||||
prefix_ns_integer (int): [optional] # noqa: E501
|
|
||||||
prefix_ns_boolean (bool): [optional] # noqa: E501
|
|
||||||
prefix_ns_array (list[int]): [optional] # noqa: E501
|
|
||||||
prefix_ns_wrapped_array (list[int]): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._attribute_string = None
|
self._attribute_string = None
|
||||||
self._attribute_number = None
|
self._attribute_number = None
|
||||||
@ -163,63 +153,121 @@ class XmlItem(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
|
|
||||||
if attribute_string is not None:
|
if attribute_string is not None:
|
||||||
self.attribute_string = attribute_string # noqa: E501
|
self.attribute_string = (
|
||||||
|
attribute_string
|
||||||
|
)
|
||||||
if attribute_number is not None:
|
if attribute_number is not None:
|
||||||
self.attribute_number = attribute_number # noqa: E501
|
self.attribute_number = (
|
||||||
|
attribute_number
|
||||||
|
)
|
||||||
if attribute_integer is not None:
|
if attribute_integer is not None:
|
||||||
self.attribute_integer = attribute_integer # noqa: E501
|
self.attribute_integer = (
|
||||||
|
attribute_integer
|
||||||
|
)
|
||||||
if attribute_boolean is not None:
|
if attribute_boolean is not None:
|
||||||
self.attribute_boolean = attribute_boolean # noqa: E501
|
self.attribute_boolean = (
|
||||||
|
attribute_boolean
|
||||||
|
)
|
||||||
if wrapped_array is not None:
|
if wrapped_array is not None:
|
||||||
self.wrapped_array = wrapped_array # noqa: E501
|
self.wrapped_array = (
|
||||||
|
wrapped_array
|
||||||
|
)
|
||||||
if name_string is not None:
|
if name_string is not None:
|
||||||
self.name_string = name_string # noqa: E501
|
self.name_string = (
|
||||||
|
name_string
|
||||||
|
)
|
||||||
if name_number is not None:
|
if name_number is not None:
|
||||||
self.name_number = name_number # noqa: E501
|
self.name_number = (
|
||||||
|
name_number
|
||||||
|
)
|
||||||
if name_integer is not None:
|
if name_integer is not None:
|
||||||
self.name_integer = name_integer # noqa: E501
|
self.name_integer = (
|
||||||
|
name_integer
|
||||||
|
)
|
||||||
if name_boolean is not None:
|
if name_boolean is not None:
|
||||||
self.name_boolean = name_boolean # noqa: E501
|
self.name_boolean = (
|
||||||
|
name_boolean
|
||||||
|
)
|
||||||
if name_array is not None:
|
if name_array is not None:
|
||||||
self.name_array = name_array # noqa: E501
|
self.name_array = (
|
||||||
|
name_array
|
||||||
|
)
|
||||||
if name_wrapped_array is not None:
|
if name_wrapped_array is not None:
|
||||||
self.name_wrapped_array = name_wrapped_array # noqa: E501
|
self.name_wrapped_array = (
|
||||||
|
name_wrapped_array
|
||||||
|
)
|
||||||
if prefix_string is not None:
|
if prefix_string is not None:
|
||||||
self.prefix_string = prefix_string # noqa: E501
|
self.prefix_string = (
|
||||||
|
prefix_string
|
||||||
|
)
|
||||||
if prefix_number is not None:
|
if prefix_number is not None:
|
||||||
self.prefix_number = prefix_number # noqa: E501
|
self.prefix_number = (
|
||||||
|
prefix_number
|
||||||
|
)
|
||||||
if prefix_integer is not None:
|
if prefix_integer is not None:
|
||||||
self.prefix_integer = prefix_integer # noqa: E501
|
self.prefix_integer = (
|
||||||
|
prefix_integer
|
||||||
|
)
|
||||||
if prefix_boolean is not None:
|
if prefix_boolean is not None:
|
||||||
self.prefix_boolean = prefix_boolean # noqa: E501
|
self.prefix_boolean = (
|
||||||
|
prefix_boolean
|
||||||
|
)
|
||||||
if prefix_array is not None:
|
if prefix_array is not None:
|
||||||
self.prefix_array = prefix_array # noqa: E501
|
self.prefix_array = (
|
||||||
|
prefix_array
|
||||||
|
)
|
||||||
if prefix_wrapped_array is not None:
|
if prefix_wrapped_array is not None:
|
||||||
self.prefix_wrapped_array = prefix_wrapped_array # noqa: E501
|
self.prefix_wrapped_array = (
|
||||||
|
prefix_wrapped_array
|
||||||
|
)
|
||||||
if namespace_string is not None:
|
if namespace_string is not None:
|
||||||
self.namespace_string = namespace_string # noqa: E501
|
self.namespace_string = (
|
||||||
|
namespace_string
|
||||||
|
)
|
||||||
if namespace_number is not None:
|
if namespace_number is not None:
|
||||||
self.namespace_number = namespace_number # noqa: E501
|
self.namespace_number = (
|
||||||
|
namespace_number
|
||||||
|
)
|
||||||
if namespace_integer is not None:
|
if namespace_integer is not None:
|
||||||
self.namespace_integer = namespace_integer # noqa: E501
|
self.namespace_integer = (
|
||||||
|
namespace_integer
|
||||||
|
)
|
||||||
if namespace_boolean is not None:
|
if namespace_boolean is not None:
|
||||||
self.namespace_boolean = namespace_boolean # noqa: E501
|
self.namespace_boolean = (
|
||||||
|
namespace_boolean
|
||||||
|
)
|
||||||
if namespace_array is not None:
|
if namespace_array is not None:
|
||||||
self.namespace_array = namespace_array # noqa: E501
|
self.namespace_array = (
|
||||||
|
namespace_array
|
||||||
|
)
|
||||||
if namespace_wrapped_array is not None:
|
if namespace_wrapped_array is not None:
|
||||||
self.namespace_wrapped_array = namespace_wrapped_array # noqa: E501
|
self.namespace_wrapped_array = (
|
||||||
|
namespace_wrapped_array
|
||||||
|
)
|
||||||
if prefix_ns_string is not None:
|
if prefix_ns_string is not None:
|
||||||
self.prefix_ns_string = prefix_ns_string # noqa: E501
|
self.prefix_ns_string = (
|
||||||
|
prefix_ns_string
|
||||||
|
)
|
||||||
if prefix_ns_number is not None:
|
if prefix_ns_number is not None:
|
||||||
self.prefix_ns_number = prefix_ns_number # noqa: E501
|
self.prefix_ns_number = (
|
||||||
|
prefix_ns_number
|
||||||
|
)
|
||||||
if prefix_ns_integer is not None:
|
if prefix_ns_integer is not None:
|
||||||
self.prefix_ns_integer = prefix_ns_integer # noqa: E501
|
self.prefix_ns_integer = (
|
||||||
|
prefix_ns_integer
|
||||||
|
)
|
||||||
if prefix_ns_boolean is not None:
|
if prefix_ns_boolean is not None:
|
||||||
self.prefix_ns_boolean = prefix_ns_boolean # noqa: E501
|
self.prefix_ns_boolean = (
|
||||||
|
prefix_ns_boolean
|
||||||
|
)
|
||||||
if prefix_ns_array is not None:
|
if prefix_ns_array is not None:
|
||||||
self.prefix_ns_array = prefix_ns_array # noqa: E501
|
self.prefix_ns_array = (
|
||||||
|
prefix_ns_array
|
||||||
|
)
|
||||||
if prefix_ns_wrapped_array is not None:
|
if prefix_ns_wrapped_array is not None:
|
||||||
self.prefix_ns_wrapped_array = prefix_ns_wrapped_array # noqa: E501
|
self.prefix_ns_wrapped_array = (
|
||||||
|
prefix_ns_wrapped_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def attribute_string(self):
|
def attribute_string(self):
|
||||||
@ -232,9 +280,7 @@ class XmlItem(object):
|
|||||||
return self._attribute_string
|
return self._attribute_string
|
||||||
|
|
||||||
@attribute_string.setter
|
@attribute_string.setter
|
||||||
def attribute_string(
|
def attribute_string(self, attribute_string): # noqa: E501
|
||||||
self,
|
|
||||||
attribute_string):
|
|
||||||
"""Sets the attribute_string of this XmlItem.
|
"""Sets the attribute_string of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -243,7 +289,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._attribute_string = (
|
self._attribute_string = (
|
||||||
attribute_string)
|
attribute_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def attribute_number(self):
|
def attribute_number(self):
|
||||||
@ -256,9 +303,7 @@ class XmlItem(object):
|
|||||||
return self._attribute_number
|
return self._attribute_number
|
||||||
|
|
||||||
@attribute_number.setter
|
@attribute_number.setter
|
||||||
def attribute_number(
|
def attribute_number(self, attribute_number): # noqa: E501
|
||||||
self,
|
|
||||||
attribute_number):
|
|
||||||
"""Sets the attribute_number of this XmlItem.
|
"""Sets the attribute_number of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -267,7 +312,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._attribute_number = (
|
self._attribute_number = (
|
||||||
attribute_number)
|
attribute_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def attribute_integer(self):
|
def attribute_integer(self):
|
||||||
@ -280,9 +326,7 @@ class XmlItem(object):
|
|||||||
return self._attribute_integer
|
return self._attribute_integer
|
||||||
|
|
||||||
@attribute_integer.setter
|
@attribute_integer.setter
|
||||||
def attribute_integer(
|
def attribute_integer(self, attribute_integer): # noqa: E501
|
||||||
self,
|
|
||||||
attribute_integer):
|
|
||||||
"""Sets the attribute_integer of this XmlItem.
|
"""Sets the attribute_integer of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -291,7 +335,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._attribute_integer = (
|
self._attribute_integer = (
|
||||||
attribute_integer)
|
attribute_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def attribute_boolean(self):
|
def attribute_boolean(self):
|
||||||
@ -304,9 +349,7 @@ class XmlItem(object):
|
|||||||
return self._attribute_boolean
|
return self._attribute_boolean
|
||||||
|
|
||||||
@attribute_boolean.setter
|
@attribute_boolean.setter
|
||||||
def attribute_boolean(
|
def attribute_boolean(self, attribute_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
attribute_boolean):
|
|
||||||
"""Sets the attribute_boolean of this XmlItem.
|
"""Sets the attribute_boolean of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -315,7 +358,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._attribute_boolean = (
|
self._attribute_boolean = (
|
||||||
attribute_boolean)
|
attribute_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def wrapped_array(self):
|
def wrapped_array(self):
|
||||||
@ -328,9 +372,7 @@ class XmlItem(object):
|
|||||||
return self._wrapped_array
|
return self._wrapped_array
|
||||||
|
|
||||||
@wrapped_array.setter
|
@wrapped_array.setter
|
||||||
def wrapped_array(
|
def wrapped_array(self, wrapped_array): # noqa: E501
|
||||||
self,
|
|
||||||
wrapped_array):
|
|
||||||
"""Sets the wrapped_array of this XmlItem.
|
"""Sets the wrapped_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -339,7 +381,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._wrapped_array = (
|
self._wrapped_array = (
|
||||||
wrapped_array)
|
wrapped_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_string(self):
|
def name_string(self):
|
||||||
@ -352,9 +395,7 @@ class XmlItem(object):
|
|||||||
return self._name_string
|
return self._name_string
|
||||||
|
|
||||||
@name_string.setter
|
@name_string.setter
|
||||||
def name_string(
|
def name_string(self, name_string): # noqa: E501
|
||||||
self,
|
|
||||||
name_string):
|
|
||||||
"""Sets the name_string of this XmlItem.
|
"""Sets the name_string of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -363,7 +404,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name_string = (
|
self._name_string = (
|
||||||
name_string)
|
name_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_number(self):
|
def name_number(self):
|
||||||
@ -376,9 +418,7 @@ class XmlItem(object):
|
|||||||
return self._name_number
|
return self._name_number
|
||||||
|
|
||||||
@name_number.setter
|
@name_number.setter
|
||||||
def name_number(
|
def name_number(self, name_number): # noqa: E501
|
||||||
self,
|
|
||||||
name_number):
|
|
||||||
"""Sets the name_number of this XmlItem.
|
"""Sets the name_number of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -387,7 +427,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name_number = (
|
self._name_number = (
|
||||||
name_number)
|
name_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_integer(self):
|
def name_integer(self):
|
||||||
@ -400,9 +441,7 @@ class XmlItem(object):
|
|||||||
return self._name_integer
|
return self._name_integer
|
||||||
|
|
||||||
@name_integer.setter
|
@name_integer.setter
|
||||||
def name_integer(
|
def name_integer(self, name_integer): # noqa: E501
|
||||||
self,
|
|
||||||
name_integer):
|
|
||||||
"""Sets the name_integer of this XmlItem.
|
"""Sets the name_integer of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -411,7 +450,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name_integer = (
|
self._name_integer = (
|
||||||
name_integer)
|
name_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_boolean(self):
|
def name_boolean(self):
|
||||||
@ -424,9 +464,7 @@ class XmlItem(object):
|
|||||||
return self._name_boolean
|
return self._name_boolean
|
||||||
|
|
||||||
@name_boolean.setter
|
@name_boolean.setter
|
||||||
def name_boolean(
|
def name_boolean(self, name_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
name_boolean):
|
|
||||||
"""Sets the name_boolean of this XmlItem.
|
"""Sets the name_boolean of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -435,7 +473,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name_boolean = (
|
self._name_boolean = (
|
||||||
name_boolean)
|
name_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_array(self):
|
def name_array(self):
|
||||||
@ -448,9 +487,7 @@ class XmlItem(object):
|
|||||||
return self._name_array
|
return self._name_array
|
||||||
|
|
||||||
@name_array.setter
|
@name_array.setter
|
||||||
def name_array(
|
def name_array(self, name_array): # noqa: E501
|
||||||
self,
|
|
||||||
name_array):
|
|
||||||
"""Sets the name_array of this XmlItem.
|
"""Sets the name_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -459,7 +496,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name_array = (
|
self._name_array = (
|
||||||
name_array)
|
name_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_wrapped_array(self):
|
def name_wrapped_array(self):
|
||||||
@ -472,9 +510,7 @@ class XmlItem(object):
|
|||||||
return self._name_wrapped_array
|
return self._name_wrapped_array
|
||||||
|
|
||||||
@name_wrapped_array.setter
|
@name_wrapped_array.setter
|
||||||
def name_wrapped_array(
|
def name_wrapped_array(self, name_wrapped_array): # noqa: E501
|
||||||
self,
|
|
||||||
name_wrapped_array):
|
|
||||||
"""Sets the name_wrapped_array of this XmlItem.
|
"""Sets the name_wrapped_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -483,7 +519,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._name_wrapped_array = (
|
self._name_wrapped_array = (
|
||||||
name_wrapped_array)
|
name_wrapped_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_string(self):
|
def prefix_string(self):
|
||||||
@ -496,9 +533,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_string
|
return self._prefix_string
|
||||||
|
|
||||||
@prefix_string.setter
|
@prefix_string.setter
|
||||||
def prefix_string(
|
def prefix_string(self, prefix_string): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_string):
|
|
||||||
"""Sets the prefix_string of this XmlItem.
|
"""Sets the prefix_string of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -507,7 +542,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_string = (
|
self._prefix_string = (
|
||||||
prefix_string)
|
prefix_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_number(self):
|
def prefix_number(self):
|
||||||
@ -520,9 +556,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_number
|
return self._prefix_number
|
||||||
|
|
||||||
@prefix_number.setter
|
@prefix_number.setter
|
||||||
def prefix_number(
|
def prefix_number(self, prefix_number): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_number):
|
|
||||||
"""Sets the prefix_number of this XmlItem.
|
"""Sets the prefix_number of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -531,7 +565,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_number = (
|
self._prefix_number = (
|
||||||
prefix_number)
|
prefix_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_integer(self):
|
def prefix_integer(self):
|
||||||
@ -544,9 +579,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_integer
|
return self._prefix_integer
|
||||||
|
|
||||||
@prefix_integer.setter
|
@prefix_integer.setter
|
||||||
def prefix_integer(
|
def prefix_integer(self, prefix_integer): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_integer):
|
|
||||||
"""Sets the prefix_integer of this XmlItem.
|
"""Sets the prefix_integer of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -555,7 +588,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_integer = (
|
self._prefix_integer = (
|
||||||
prefix_integer)
|
prefix_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_boolean(self):
|
def prefix_boolean(self):
|
||||||
@ -568,9 +602,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_boolean
|
return self._prefix_boolean
|
||||||
|
|
||||||
@prefix_boolean.setter
|
@prefix_boolean.setter
|
||||||
def prefix_boolean(
|
def prefix_boolean(self, prefix_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_boolean):
|
|
||||||
"""Sets the prefix_boolean of this XmlItem.
|
"""Sets the prefix_boolean of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -579,7 +611,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_boolean = (
|
self._prefix_boolean = (
|
||||||
prefix_boolean)
|
prefix_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_array(self):
|
def prefix_array(self):
|
||||||
@ -592,9 +625,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_array
|
return self._prefix_array
|
||||||
|
|
||||||
@prefix_array.setter
|
@prefix_array.setter
|
||||||
def prefix_array(
|
def prefix_array(self, prefix_array): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_array):
|
|
||||||
"""Sets the prefix_array of this XmlItem.
|
"""Sets the prefix_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -603,7 +634,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_array = (
|
self._prefix_array = (
|
||||||
prefix_array)
|
prefix_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_wrapped_array(self):
|
def prefix_wrapped_array(self):
|
||||||
@ -616,9 +648,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_wrapped_array
|
return self._prefix_wrapped_array
|
||||||
|
|
||||||
@prefix_wrapped_array.setter
|
@prefix_wrapped_array.setter
|
||||||
def prefix_wrapped_array(
|
def prefix_wrapped_array(self, prefix_wrapped_array): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_wrapped_array):
|
|
||||||
"""Sets the prefix_wrapped_array of this XmlItem.
|
"""Sets the prefix_wrapped_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -627,7 +657,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_wrapped_array = (
|
self._prefix_wrapped_array = (
|
||||||
prefix_wrapped_array)
|
prefix_wrapped_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def namespace_string(self):
|
def namespace_string(self):
|
||||||
@ -640,9 +671,7 @@ class XmlItem(object):
|
|||||||
return self._namespace_string
|
return self._namespace_string
|
||||||
|
|
||||||
@namespace_string.setter
|
@namespace_string.setter
|
||||||
def namespace_string(
|
def namespace_string(self, namespace_string): # noqa: E501
|
||||||
self,
|
|
||||||
namespace_string):
|
|
||||||
"""Sets the namespace_string of this XmlItem.
|
"""Sets the namespace_string of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -651,7 +680,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._namespace_string = (
|
self._namespace_string = (
|
||||||
namespace_string)
|
namespace_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def namespace_number(self):
|
def namespace_number(self):
|
||||||
@ -664,9 +694,7 @@ class XmlItem(object):
|
|||||||
return self._namespace_number
|
return self._namespace_number
|
||||||
|
|
||||||
@namespace_number.setter
|
@namespace_number.setter
|
||||||
def namespace_number(
|
def namespace_number(self, namespace_number): # noqa: E501
|
||||||
self,
|
|
||||||
namespace_number):
|
|
||||||
"""Sets the namespace_number of this XmlItem.
|
"""Sets the namespace_number of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -675,7 +703,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._namespace_number = (
|
self._namespace_number = (
|
||||||
namespace_number)
|
namespace_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def namespace_integer(self):
|
def namespace_integer(self):
|
||||||
@ -688,9 +717,7 @@ class XmlItem(object):
|
|||||||
return self._namespace_integer
|
return self._namespace_integer
|
||||||
|
|
||||||
@namespace_integer.setter
|
@namespace_integer.setter
|
||||||
def namespace_integer(
|
def namespace_integer(self, namespace_integer): # noqa: E501
|
||||||
self,
|
|
||||||
namespace_integer):
|
|
||||||
"""Sets the namespace_integer of this XmlItem.
|
"""Sets the namespace_integer of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -699,7 +726,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._namespace_integer = (
|
self._namespace_integer = (
|
||||||
namespace_integer)
|
namespace_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def namespace_boolean(self):
|
def namespace_boolean(self):
|
||||||
@ -712,9 +740,7 @@ class XmlItem(object):
|
|||||||
return self._namespace_boolean
|
return self._namespace_boolean
|
||||||
|
|
||||||
@namespace_boolean.setter
|
@namespace_boolean.setter
|
||||||
def namespace_boolean(
|
def namespace_boolean(self, namespace_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
namespace_boolean):
|
|
||||||
"""Sets the namespace_boolean of this XmlItem.
|
"""Sets the namespace_boolean of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -723,7 +749,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._namespace_boolean = (
|
self._namespace_boolean = (
|
||||||
namespace_boolean)
|
namespace_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def namespace_array(self):
|
def namespace_array(self):
|
||||||
@ -736,9 +763,7 @@ class XmlItem(object):
|
|||||||
return self._namespace_array
|
return self._namespace_array
|
||||||
|
|
||||||
@namespace_array.setter
|
@namespace_array.setter
|
||||||
def namespace_array(
|
def namespace_array(self, namespace_array): # noqa: E501
|
||||||
self,
|
|
||||||
namespace_array):
|
|
||||||
"""Sets the namespace_array of this XmlItem.
|
"""Sets the namespace_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -747,7 +772,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._namespace_array = (
|
self._namespace_array = (
|
||||||
namespace_array)
|
namespace_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def namespace_wrapped_array(self):
|
def namespace_wrapped_array(self):
|
||||||
@ -760,9 +786,7 @@ class XmlItem(object):
|
|||||||
return self._namespace_wrapped_array
|
return self._namespace_wrapped_array
|
||||||
|
|
||||||
@namespace_wrapped_array.setter
|
@namespace_wrapped_array.setter
|
||||||
def namespace_wrapped_array(
|
def namespace_wrapped_array(self, namespace_wrapped_array): # noqa: E501
|
||||||
self,
|
|
||||||
namespace_wrapped_array):
|
|
||||||
"""Sets the namespace_wrapped_array of this XmlItem.
|
"""Sets the namespace_wrapped_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -771,7 +795,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._namespace_wrapped_array = (
|
self._namespace_wrapped_array = (
|
||||||
namespace_wrapped_array)
|
namespace_wrapped_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_ns_string(self):
|
def prefix_ns_string(self):
|
||||||
@ -784,9 +809,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_ns_string
|
return self._prefix_ns_string
|
||||||
|
|
||||||
@prefix_ns_string.setter
|
@prefix_ns_string.setter
|
||||||
def prefix_ns_string(
|
def prefix_ns_string(self, prefix_ns_string): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_ns_string):
|
|
||||||
"""Sets the prefix_ns_string of this XmlItem.
|
"""Sets the prefix_ns_string of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -795,7 +818,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_ns_string = (
|
self._prefix_ns_string = (
|
||||||
prefix_ns_string)
|
prefix_ns_string
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_ns_number(self):
|
def prefix_ns_number(self):
|
||||||
@ -808,9 +832,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_ns_number
|
return self._prefix_ns_number
|
||||||
|
|
||||||
@prefix_ns_number.setter
|
@prefix_ns_number.setter
|
||||||
def prefix_ns_number(
|
def prefix_ns_number(self, prefix_ns_number): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_ns_number):
|
|
||||||
"""Sets the prefix_ns_number of this XmlItem.
|
"""Sets the prefix_ns_number of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -819,7 +841,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_ns_number = (
|
self._prefix_ns_number = (
|
||||||
prefix_ns_number)
|
prefix_ns_number
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_ns_integer(self):
|
def prefix_ns_integer(self):
|
||||||
@ -832,9 +855,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_ns_integer
|
return self._prefix_ns_integer
|
||||||
|
|
||||||
@prefix_ns_integer.setter
|
@prefix_ns_integer.setter
|
||||||
def prefix_ns_integer(
|
def prefix_ns_integer(self, prefix_ns_integer): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_ns_integer):
|
|
||||||
"""Sets the prefix_ns_integer of this XmlItem.
|
"""Sets the prefix_ns_integer of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -843,7 +864,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_ns_integer = (
|
self._prefix_ns_integer = (
|
||||||
prefix_ns_integer)
|
prefix_ns_integer
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_ns_boolean(self):
|
def prefix_ns_boolean(self):
|
||||||
@ -856,9 +878,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_ns_boolean
|
return self._prefix_ns_boolean
|
||||||
|
|
||||||
@prefix_ns_boolean.setter
|
@prefix_ns_boolean.setter
|
||||||
def prefix_ns_boolean(
|
def prefix_ns_boolean(self, prefix_ns_boolean): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_ns_boolean):
|
|
||||||
"""Sets the prefix_ns_boolean of this XmlItem.
|
"""Sets the prefix_ns_boolean of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -867,7 +887,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_ns_boolean = (
|
self._prefix_ns_boolean = (
|
||||||
prefix_ns_boolean)
|
prefix_ns_boolean
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_ns_array(self):
|
def prefix_ns_array(self):
|
||||||
@ -880,9 +901,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_ns_array
|
return self._prefix_ns_array
|
||||||
|
|
||||||
@prefix_ns_array.setter
|
@prefix_ns_array.setter
|
||||||
def prefix_ns_array(
|
def prefix_ns_array(self, prefix_ns_array): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_ns_array):
|
|
||||||
"""Sets the prefix_ns_array of this XmlItem.
|
"""Sets the prefix_ns_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -891,7 +910,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_ns_array = (
|
self._prefix_ns_array = (
|
||||||
prefix_ns_array)
|
prefix_ns_array
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prefix_ns_wrapped_array(self):
|
def prefix_ns_wrapped_array(self):
|
||||||
@ -904,9 +924,7 @@ class XmlItem(object):
|
|||||||
return self._prefix_ns_wrapped_array
|
return self._prefix_ns_wrapped_array
|
||||||
|
|
||||||
@prefix_ns_wrapped_array.setter
|
@prefix_ns_wrapped_array.setter
|
||||||
def prefix_ns_wrapped_array(
|
def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): # noqa: E501
|
||||||
self,
|
|
||||||
prefix_ns_wrapped_array):
|
|
||||||
"""Sets the prefix_ns_wrapped_array of this XmlItem.
|
"""Sets the prefix_ns_wrapped_array of this XmlItem.
|
||||||
|
|
||||||
|
|
||||||
@ -915,7 +933,8 @@ class XmlItem(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self._prefix_ns_wrapped_array = (
|
self._prefix_ns_wrapped_array = (
|
||||||
prefix_ns_wrapped_array)
|
prefix_ns_wrapped_array
|
||||||
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
|
@ -31,7 +31,7 @@ setup(
|
|||||||
url="",
|
url="",
|
||||||
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
|
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
|
||||||
install_requires=REQUIRES,
|
install_requires=REQUIRES,
|
||||||
packages=find_packages(),
|
packages=find_packages(exclude=["test", "tests"]),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
long_description="""\
|
long_description="""\
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
@ -40,11 +40,23 @@ class TestFakeApi(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def test_fake_outer_enum_serialize(self):
|
||||||
|
"""Test case for fake_outer_enum_serialize
|
||||||
|
|
||||||
|
"""
|
||||||
|
# verify that the input and output are type OuterEnum
|
||||||
|
endpoint = self.api.fake_outer_enum_serialize
|
||||||
|
assert endpoint.openapi_types['body'] == 'OuterEnum'
|
||||||
|
assert endpoint.settings['response_type'] == 'OuterEnum'
|
||||||
|
|
||||||
def test_fake_outer_number_serialize(self):
|
def test_fake_outer_number_serialize(self):
|
||||||
"""Test case for fake_outer_number_serialize
|
"""Test case for fake_outer_number_serialize
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
# verify that the input and output are the correct type
|
||||||
|
endpoint = self.api.fake_outer_number_serialize
|
||||||
|
assert endpoint.openapi_types['body'] == 'OuterNumber'
|
||||||
|
assert endpoint.settings['response_type'] == 'OuterNumber'
|
||||||
|
|
||||||
def test_fake_outer_string_serialize(self):
|
def test_fake_outer_string_serialize(self):
|
||||||
"""Test case for fake_outer_string_serialize
|
"""Test case for fake_outer_string_serialize
|
||||||
@ -70,14 +82,38 @@ class TestFakeApi(unittest.TestCase):
|
|||||||
|
|
||||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
|
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):
|
def test_test_enum_parameters(self):
|
||||||
"""Test case for test_enum_parameters
|
"""Test case for test_enum_parameters
|
||||||
|
|
||||||
To test enum parameters # noqa: E501
|
To test enum parameters # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
# 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_inline_additional_properties(self):
|
def test_test_inline_additional_properties(self):
|
||||||
"""Test case for test_inline_additional_properties
|
"""Test case for test_inline_additional_properties
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
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
|
This spec 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
|
OpenAPI spec version: 1.0.0
|
||||||
Generated by: https://openapi-generator.tech
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
@ -16,23 +14,138 @@ import unittest
|
|||||||
|
|
||||||
import petstore_api
|
import petstore_api
|
||||||
from petstore_api.models.format_test import FormatTest # noqa: E501
|
from petstore_api.models.format_test import FormatTest # noqa: E501
|
||||||
from petstore_api.rest import ApiException
|
from petstore_api import ApiValueError
|
||||||
|
|
||||||
|
|
||||||
class TestFormatTest(unittest.TestCase):
|
class TestFormatTest(unittest.TestCase):
|
||||||
"""FormatTest unit test stubs"""
|
"""FormatTest unit test stubs"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pass
|
self.required_named_args = dict(
|
||||||
|
number=40.1,
|
||||||
|
byte='what',
|
||||||
|
date='2019-03-23',
|
||||||
|
password='rainbowtable'
|
||||||
|
)
|
||||||
|
|
||||||
def tearDown(self):
|
def test_integer(self):
|
||||||
pass
|
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(ApiValueError):
|
||||||
|
keyword_args[var_name] = validations[key] + adder
|
||||||
|
FormatTest(**keyword_args)
|
||||||
|
|
||||||
def testFormatTest(self):
|
# value inside the bounds works
|
||||||
"""Test FormatTest"""
|
keyword_args[var_name] = validations[key]
|
||||||
# FIXME: construct object with mandatory attributes with example values
|
assert (getattr(FormatTest(**keyword_args), var_name) ==
|
||||||
# model = petstore_api.models.format_test.FormatTest() # noqa: E501
|
validations[key])
|
||||||
pass
|
|
||||||
|
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(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(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(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(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(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(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__':
|
if __name__ == '__main__':
|
||||||
|
@ -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
|
This spec 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
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -30,10 +30,18 @@ class TestOuterEnum(unittest.TestCase):
|
|||||||
|
|
||||||
def testOuterEnum(self):
|
def testOuterEnum(self):
|
||||||
"""Test OuterEnum"""
|
"""Test OuterEnum"""
|
||||||
# FIXME: construct object with mandatory attributes with example values
|
# make sure that we can access its allowed_values
|
||||||
# model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501
|
assert OuterEnum.allowed_values[('value',)] == {
|
||||||
pass
|
'PLACED': "placed",
|
||||||
|
'APPROVED': "approved",
|
||||||
|
'DELIVERED': "delivered"
|
||||||
|
}
|
||||||
|
# make sure that an exception is thrown on an invalid value
|
||||||
|
with self.assertRaises(petstore_api.ApiValueError):
|
||||||
|
OuterEnum('bad_value')
|
||||||
|
# make sure valid value works
|
||||||
|
valid_value = OuterEnum.allowed_values[('value',)]['PLACED']
|
||||||
|
assert valid_value == OuterEnum(valid_value).value
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user