forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen into issue1948
This commit is contained in:
commit
aa9e19f3d9
11
.gitignore
vendored
11
.gitignore
vendored
@ -43,6 +43,7 @@ samples/server-generator/scalatra/output/.history
|
|||||||
# nodejs
|
# nodejs
|
||||||
samples/server-generator/node/output/node_modules
|
samples/server-generator/node/output/node_modules
|
||||||
samples/server/petstore/nodejs/node_modules
|
samples/server/petstore/nodejs/node_modules
|
||||||
|
samples/server/petstore/nodejs-server/node_modules
|
||||||
|
|
||||||
# qt5 cpp
|
# qt5 cpp
|
||||||
samples/client/petstore/qt5cpp/PetStore/moc_*
|
samples/client/petstore/qt5cpp/PetStore/moc_*
|
||||||
@ -55,6 +56,12 @@ samples/client/petstore/qt5cpp/PetStore/Makefile
|
|||||||
**/.gradle/
|
**/.gradle/
|
||||||
samples/client/petstore/java/hello.txt
|
samples/client/petstore/java/hello.txt
|
||||||
samples/client/petstore/android/default/hello.txt
|
samples/client/petstore/android/default/hello.txt
|
||||||
|
samples/client/petstore/android/volley/.gradle/
|
||||||
|
samples/client/petstore/android/volley/build/
|
||||||
|
samples/client/petstore/java/jersey2/.gradle/
|
||||||
|
samples/client/petstore/java/jersey2/build/
|
||||||
|
samples/client/petstore/java/okhttp-gson/.gradle/
|
||||||
|
samples/client/petstore/java/okhttp-gson/build/
|
||||||
|
|
||||||
#PHP
|
#PHP
|
||||||
samples/client/petstore/php/SwaggerClient-php/composer.lock
|
samples/client/petstore/php/SwaggerClient-php/composer.lock
|
||||||
@ -87,6 +94,10 @@ samples/client/petstore/csharp/SwaggerClientTest/bin
|
|||||||
samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/
|
samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/
|
||||||
samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/
|
samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/
|
||||||
samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/
|
samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/
|
||||||
|
samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/nuget.exe
|
||||||
|
samples/client/petstore/csharp/SwaggerClientTest/TestResult.xml
|
||||||
|
samples/client/petstore/csharp/SwaggerClientTest/nuget.exe
|
||||||
|
samples/client/petstore/csharp/SwaggerClientTest/testrunner/
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
*.pyc
|
*.pyc
|
||||||
|
@ -65,7 +65,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
|||||||
Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
||||||
-------------------------- | ------------ | -------------------------- | -----
|
-------------------------- | ------------ | -------------------------- | -----
|
||||||
2.1.7-SNAPSHOT | | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen)
|
2.1.7-SNAPSHOT | | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen)
|
||||||
2.1.6 (**current stable**) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.5)
|
2.1.6 (**current stable**) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6)
|
||||||
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)
|
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)
|
||||||
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ public class CodegenProperty {
|
|||||||
public Boolean exclusiveMinimum;
|
public Boolean exclusiveMinimum;
|
||||||
public Boolean exclusiveMaximum;
|
public Boolean exclusiveMaximum;
|
||||||
public Boolean hasMore, required, secondaryParam;
|
public Boolean hasMore, required, secondaryParam;
|
||||||
|
public Boolean hasMoreNonReadOnly; // for model constructor, true if next properyt is not readonly
|
||||||
public Boolean isPrimitiveType, isContainer, isNotContainer;
|
public Boolean isPrimitiveType, isContainer, isNotContainer;
|
||||||
public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime;
|
public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime;
|
||||||
public Boolean isListContainer, isMapContainer;
|
public Boolean isListContainer, isMapContainer;
|
||||||
@ -63,6 +64,7 @@ public class CodegenProperty {
|
|||||||
result = prime * result + ((exclusiveMinimum == null) ? 0 : exclusiveMinimum.hashCode());
|
result = prime * result + ((exclusiveMinimum == null) ? 0 : exclusiveMinimum.hashCode());
|
||||||
result = prime * result + ((getter == null) ? 0 : getter.hashCode());
|
result = prime * result + ((getter == null) ? 0 : getter.hashCode());
|
||||||
result = prime * result + ((hasMore == null) ? 0 : hasMore.hashCode());
|
result = prime * result + ((hasMore == null) ? 0 : hasMore.hashCode());
|
||||||
|
result = prime * result + ((hasMoreNonReadOnly == null) ? 0 : hasMoreNonReadOnly.hashCode());
|
||||||
result = prime * result + ((isContainer == null) ? 0 : isContainer.hashCode());
|
result = prime * result + ((isContainer == null) ? 0 : isContainer.hashCode());
|
||||||
result = prime * result + (isEnum ? 1231 : 1237);
|
result = prime * result + (isEnum ? 1231 : 1237);
|
||||||
result = prime * result + ((isNotContainer == null) ? 0 : isNotContainer.hashCode());
|
result = prime * result + ((isNotContainer == null) ? 0 : isNotContainer.hashCode());
|
||||||
|
@ -2220,9 +2220,12 @@ public class DefaultCodegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addVars(CodegenModel m, List<CodegenProperty> vars, Map<String, Property> properties, Set<String> mandatory) {
|
private void addVars(CodegenModel m, List<CodegenProperty> vars, Map<String, Property> properties, Set<String> mandatory) {
|
||||||
final int totalCount = properties.size();
|
// convert set to list so that we can access the next entry in the loop
|
||||||
int count = 0;
|
List<Map.Entry<String, Property>> propertyList = new ArrayList<Map.Entry<String, Property>>(properties.entrySet());
|
||||||
for (Map.Entry<String, Property> entry : properties.entrySet()) {
|
final int totalCount = propertyList.size();
|
||||||
|
for (int i = 0; i < totalCount; i++) {
|
||||||
|
Map.Entry<String, Property> entry = propertyList.get(i);
|
||||||
|
|
||||||
final String key = entry.getKey();
|
final String key = entry.getKey();
|
||||||
final Property prop = entry.getValue();
|
final Property prop = entry.getValue();
|
||||||
|
|
||||||
@ -2236,13 +2239,19 @@ public class DefaultCodegen {
|
|||||||
// m.hasEnums to be set incorrectly if allProperties has enumerations but properties does not.
|
// m.hasEnums to be set incorrectly if allProperties has enumerations but properties does not.
|
||||||
m.hasEnums = true;
|
m.hasEnums = true;
|
||||||
}
|
}
|
||||||
count++;
|
|
||||||
if (count != totalCount) {
|
if (i+1 != totalCount) {
|
||||||
cp.hasMore = true;
|
cp.hasMore = true;
|
||||||
|
// check the next entry to see if it's read only
|
||||||
|
if (!Boolean.TRUE.equals(propertyList.get(i+1).getValue().getReadOnly())) {
|
||||||
|
cp.hasMoreNonReadOnly = true; // next entry is not ready only
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cp.isContainer != null) {
|
if (cp.isContainer != null) {
|
||||||
addImport(m, typeMapping.get("array"));
|
addImport(m, typeMapping.get("array"));
|
||||||
}
|
}
|
||||||
|
|
||||||
addImport(m, cp.baseType);
|
addImport(m, cp.baseType);
|
||||||
addImport(m, cp.complexType);
|
addImport(m, cp.complexType);
|
||||||
vars.add(cp);
|
vars.add(cp);
|
||||||
|
@ -101,6 +101,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
|||||||
typeMapping = new HashMap<String, String>();
|
typeMapping = new HashMap<String, String>();
|
||||||
typeMapping.put("string", "string");
|
typeMapping.put("string", "string");
|
||||||
typeMapping.put("binary", "byte[]");
|
typeMapping.put("binary", "byte[]");
|
||||||
|
typeMapping.put("bytearray", "byte[]");
|
||||||
typeMapping.put("boolean", "bool?");
|
typeMapping.put("boolean", "bool?");
|
||||||
typeMapping.put("integer", "int?");
|
typeMapping.put("integer", "int?");
|
||||||
typeMapping.put("float", "float?");
|
typeMapping.put("float", "float?");
|
||||||
|
@ -52,9 +52,8 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
"String",
|
"String",
|
||||||
"bool",
|
"bool",
|
||||||
"num",
|
|
||||||
"int",
|
"int",
|
||||||
"float")
|
"double")
|
||||||
);
|
);
|
||||||
instantiationTypes.put("array", "List");
|
instantiationTypes.put("array", "List");
|
||||||
instantiationTypes.put("map", "Map");
|
instantiationTypes.put("map", "Map");
|
||||||
@ -66,11 +65,11 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
typeMapping.put("boolean", "bool");
|
typeMapping.put("boolean", "bool");
|
||||||
typeMapping.put("string", "String");
|
typeMapping.put("string", "String");
|
||||||
typeMapping.put("int", "int");
|
typeMapping.put("int", "int");
|
||||||
typeMapping.put("float", "num");
|
typeMapping.put("float", "double");
|
||||||
typeMapping.put("long", "int");
|
typeMapping.put("long", "int");
|
||||||
typeMapping.put("short", "int");
|
typeMapping.put("short", "int");
|
||||||
typeMapping.put("char", "String");
|
typeMapping.put("char", "String");
|
||||||
typeMapping.put("double", "num");
|
typeMapping.put("double", "double");
|
||||||
typeMapping.put("object", "Object");
|
typeMapping.put("object", "Object");
|
||||||
typeMapping.put("integer", "int");
|
typeMapping.put("integer", "int");
|
||||||
typeMapping.put("Date", "DateTime");
|
typeMapping.put("Date", "DateTime");
|
||||||
|
@ -131,6 +131,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "Configuration.go"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,6 +4,7 @@ import io.swagger.codegen.CliOption;
|
|||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
import io.swagger.codegen.CodegenConstants;
|
||||||
import io.swagger.codegen.CodegenOperation;
|
import io.swagger.codegen.CodegenOperation;
|
||||||
|
import io.swagger.codegen.CodegenParameter;
|
||||||
import io.swagger.codegen.CodegenProperty;
|
import io.swagger.codegen.CodegenProperty;
|
||||||
import io.swagger.codegen.CodegenType;
|
import io.swagger.codegen.CodegenType;
|
||||||
import io.swagger.codegen.DefaultCodegen;
|
import io.swagger.codegen.DefaultCodegen;
|
||||||
@ -36,6 +37,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
protected String license = "MIT";
|
protected String license = "MIT";
|
||||||
protected String gitRepoURL = "https://github.com/swagger-api/swagger-codegen";
|
protected String gitRepoURL = "https://github.com/swagger-api/swagger-codegen";
|
||||||
protected String[] specialWords = {"new", "copy"};
|
protected String[] specialWords = {"new", "copy"};
|
||||||
|
protected String apiDocPath = "docs/";
|
||||||
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
public ObjcClientCodegen() {
|
public ObjcClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -46,6 +49,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
apiTemplateFiles.put("api-header.mustache", ".h");
|
apiTemplateFiles.put("api-header.mustache", ".h");
|
||||||
apiTemplateFiles.put("api-body.mustache", ".m");
|
apiTemplateFiles.put("api-body.mustache", ".m");
|
||||||
embeddedTemplateDir = templateDir = "objc";
|
embeddedTemplateDir = templateDir = "objc";
|
||||||
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
defaultIncludes.clear();
|
defaultIncludes.clear();
|
||||||
defaultIncludes.add("bool");
|
defaultIncludes.add("bool");
|
||||||
@ -199,6 +204,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
additionalProperties.put(GIT_REPO_URL, gitRepoURL);
|
additionalProperties.put(GIT_REPO_URL, gitRepoURL);
|
||||||
additionalProperties.put(LICENSE, license);
|
additionalProperties.put(LICENSE, license);
|
||||||
|
|
||||||
|
// make api and model doc path available in mustache template
|
||||||
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
|
|
||||||
String swaggerFolder = podName;
|
String swaggerFolder = podName;
|
||||||
|
|
||||||
modelPackage = swaggerFolder;
|
modelPackage = swaggerFolder;
|
||||||
@ -388,6 +397,26 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + apiDocPath).replace("/", File.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + modelDocPath).replace("/", File.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelDocFilename(String name) {
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toApiDocFilename(String name) {
|
||||||
|
return toApiName(name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
return outputFolder + File.separatorChar + apiPackage();
|
return outputFolder + File.separatorChar + apiPackage();
|
||||||
@ -562,4 +591,75 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setParameterExampleValue(CodegenParameter p) {
|
||||||
|
String example;
|
||||||
|
|
||||||
|
if (p.defaultValue == null) {
|
||||||
|
example = p.example;
|
||||||
|
} else {
|
||||||
|
example = p.defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String type = p.baseType;
|
||||||
|
if (type == null) {
|
||||||
|
type = p.dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("NSString*".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = p.paramName + "_example";
|
||||||
|
}
|
||||||
|
example = "@\"" + escapeText(example) + "\"";
|
||||||
|
} else if ("NSNumber*".equals(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "56";
|
||||||
|
}
|
||||||
|
example = "@" + example;
|
||||||
|
/* OBJC uses NSNumber to represent both int, long, double and float
|
||||||
|
} else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "3.4";
|
||||||
|
} */
|
||||||
|
} else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "True";
|
||||||
|
}
|
||||||
|
} else if ("NSURL*".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "/path/to/file";
|
||||||
|
}
|
||||||
|
//[NSURL fileURLWithPath:@"path/to/file"]
|
||||||
|
example = "[NSURL fileURLWithPath:@\"" + escapeText(example) + "\"]";
|
||||||
|
/*} else if ("NSDate".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "2013-10-20";
|
||||||
|
}
|
||||||
|
example = "'" + escapeText(example) + "'";*/
|
||||||
|
} else if ("NSDate*".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "2013-10-20T19:20:30+01:00";
|
||||||
|
}
|
||||||
|
example = "@\"" + escapeText(example) + "\"";
|
||||||
|
} else if (!languageSpecificPrimitives.contains(type)) {
|
||||||
|
// type is a model class, e.g. User
|
||||||
|
type = type.replace("*", "");
|
||||||
|
// e.g. [[SWGPet alloc] init
|
||||||
|
example = "[[" + type + " alloc] init]";
|
||||||
|
} else {
|
||||||
|
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (example == null) {
|
||||||
|
example = "NULL";
|
||||||
|
} else if (Boolean.TRUE.equals(p.isListContainer)) {
|
||||||
|
example = "@[" + example + "]";
|
||||||
|
} else if (Boolean.TRUE.equals(p.isMapContainer)) {
|
||||||
|
example = "@{@\"key\" : " + example + "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
p.example = example;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
typeMapping = new HashMap<String, String>();
|
typeMapping = new HashMap<String, String>();
|
||||||
typeMapping.put("integer", "int");
|
typeMapping.put("integer", "int");
|
||||||
typeMapping.put("long", "int");
|
typeMapping.put("long", "int");
|
||||||
|
typeMapping.put("number", "float");
|
||||||
typeMapping.put("float", "float");
|
typeMapping.put("float", "float");
|
||||||
typeMapping.put("double", "double");
|
typeMapping.put("double", "double");
|
||||||
typeMapping.put("string", "string");
|
typeMapping.put("string", "string");
|
||||||
|
@ -3,6 +3,7 @@ package io.swagger.codegen.languages;
|
|||||||
import io.swagger.codegen.CliOption;
|
import io.swagger.codegen.CliOption;
|
||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.CodegenParameter;
|
||||||
import io.swagger.codegen.CodegenType;
|
import io.swagger.codegen.CodegenType;
|
||||||
import io.swagger.codegen.DefaultCodegen;
|
import io.swagger.codegen.DefaultCodegen;
|
||||||
import io.swagger.codegen.SupportingFile;
|
import io.swagger.codegen.SupportingFile;
|
||||||
@ -17,6 +18,8 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig {
|
public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
protected String packageName;
|
protected String packageName;
|
||||||
protected String packageVersion;
|
protected String packageVersion;
|
||||||
|
protected String apiDocPath = "docs/";
|
||||||
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
public PythonClientCodegen() {
|
public PythonClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -28,6 +31,9 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
apiTemplateFiles.put("api.mustache", ".py");
|
apiTemplateFiles.put("api.mustache", ".py");
|
||||||
embeddedTemplateDir = templateDir = "python";
|
embeddedTemplateDir = templateDir = "python";
|
||||||
|
|
||||||
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
languageSpecificPrimitives.clear();
|
languageSpecificPrimitives.clear();
|
||||||
languageSpecificPrimitives.add("int");
|
languageSpecificPrimitives.add("int");
|
||||||
languageSpecificPrimitives.add("float");
|
languageSpecificPrimitives.add("float");
|
||||||
@ -36,6 +42,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
languageSpecificPrimitives.add("str");
|
languageSpecificPrimitives.add("str");
|
||||||
languageSpecificPrimitives.add("datetime");
|
languageSpecificPrimitives.add("datetime");
|
||||||
languageSpecificPrimitives.add("date");
|
languageSpecificPrimitives.add("date");
|
||||||
|
languageSpecificPrimitives.add("object");
|
||||||
|
|
||||||
typeMapping.clear();
|
typeMapping.clear();
|
||||||
typeMapping.put("integer", "int");
|
typeMapping.put("integer", "int");
|
||||||
@ -97,6 +104,10 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
||||||
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
||||||
|
|
||||||
|
// make api and model doc path available in mustache template
|
||||||
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
|
|
||||||
String swaggerFolder = packageName;
|
String swaggerFolder = packageName;
|
||||||
|
|
||||||
modelPackage = swaggerFolder + File.separatorChar + "models";
|
modelPackage = swaggerFolder + File.separatorChar + "models";
|
||||||
@ -138,6 +149,27 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return "_" + name;
|
return "_" + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + apiDocPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + modelDocPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelDocFilename(String name) {
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toApiDocFilename(String name) {
|
||||||
|
return toApiName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
return outputFolder + File.separatorChar + apiPackage().replace('.', File.separatorChar);
|
return outputFolder + File.separatorChar + apiPackage().replace('.', File.separatorChar);
|
||||||
@ -388,4 +420,70 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setParameterExampleValue(CodegenParameter p) {
|
||||||
|
String example;
|
||||||
|
|
||||||
|
if (p.defaultValue == null) {
|
||||||
|
example = p.example;
|
||||||
|
} else {
|
||||||
|
example = p.defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String type = p.baseType;
|
||||||
|
if (type == null) {
|
||||||
|
type = p.dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = p.paramName + "_example";
|
||||||
|
}
|
||||||
|
example = "'" + escapeText(example) + "'";
|
||||||
|
} else if ("Integer".equals(type) || "int".equals(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "56";
|
||||||
|
}
|
||||||
|
} else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "3.4";
|
||||||
|
}
|
||||||
|
} else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "True";
|
||||||
|
}
|
||||||
|
} else if ("file".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "/path/to/file";
|
||||||
|
}
|
||||||
|
example = "'" + escapeText(example) + "'";
|
||||||
|
} else if ("Date".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "2013-10-20";
|
||||||
|
}
|
||||||
|
example = "'" + escapeText(example) + "'";
|
||||||
|
} else if ("DateTime".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "2013-10-20T19:20:30+01:00";
|
||||||
|
}
|
||||||
|
example = "'" + escapeText(example) + "'";
|
||||||
|
} else if (!languageSpecificPrimitives.contains(type)) {
|
||||||
|
// type is a model class, e.g. User
|
||||||
|
example = this.packageName + "." + type + "()";
|
||||||
|
} else {
|
||||||
|
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (example == null) {
|
||||||
|
example = "NULL";
|
||||||
|
} else if (Boolean.TRUE.equals(p.isListContainer)) {
|
||||||
|
example = "[" + example + "]";
|
||||||
|
} else if (Boolean.TRUE.equals(p.isMapContainer)) {
|
||||||
|
example = "{'key': " + example + "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
p.example = example;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
languageSpecificPrimitives = new HashSet<String>(
|
languageSpecificPrimitives = new HashSet<String>(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
"Int",
|
"Int",
|
||||||
|
"Int32",
|
||||||
|
"Int64",
|
||||||
"Float",
|
"Float",
|
||||||
"Double",
|
"Double",
|
||||||
"Bool",
|
"Bool",
|
||||||
@ -115,10 +117,10 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
typeMapping.put("string", "String");
|
typeMapping.put("string", "String");
|
||||||
typeMapping.put("char", "Character");
|
typeMapping.put("char", "Character");
|
||||||
typeMapping.put("short", "Int");
|
typeMapping.put("short", "Int");
|
||||||
typeMapping.put("int", "Int");
|
typeMapping.put("int", "Int32");
|
||||||
typeMapping.put("long", "Int");
|
typeMapping.put("long", "Int64");
|
||||||
typeMapping.put("integer", "Int");
|
typeMapping.put("integer", "Int32");
|
||||||
typeMapping.put("Integer", "Int");
|
typeMapping.put("Integer", "Int32");
|
||||||
typeMapping.put("float", "Float");
|
typeMapping.put("float", "Float");
|
||||||
typeMapping.put("number", "Double");
|
typeMapping.put("number", "Double");
|
||||||
typeMapping.put("double", "Double");
|
typeMapping.put("double", "Double");
|
||||||
|
@ -46,6 +46,10 @@ if(hasProperty('target') && target == 'android') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
provided 'javax.annotation:jsr250-api:1.0'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
@ -41,7 +41,7 @@ namespace {{packageName}}.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
{{#vars}}{{^isReadOnly}} /// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
|
{{#vars}}{{^isReadOnly}} /// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
|
||||||
{{/isReadOnly}}{{/vars}}
|
{{/isReadOnly}}{{/vars}}
|
||||||
public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}} {{name}} = null{{#hasMore}}, {{/hasMore}}{{/isReadOnly}}{{/vars}})
|
public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}} {{name}} = null{{#hasMoreNonReadOnly}}, {{/hasMoreNonReadOnly}}{{/isReadOnly}}{{/vars}})
|
||||||
{
|
{
|
||||||
{{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null)
|
{{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null)
|
||||||
if ({{name}} == null)
|
if ({{name}} == null)
|
||||||
|
@ -18,5 +18,5 @@ part 'auth/http_basic_auth.dart';
|
|||||||
|
|
||||||
{{#apiInfo}}{{#apis}}part 'api/{{classVarName}}_api.dart';
|
{{#apiInfo}}{{#apis}}part 'api/{{classVarName}}_api.dart';
|
||||||
{{/apis}}{{/apiInfo}}
|
{{/apis}}{{/apiInfo}}
|
||||||
{{#models}}{{#model}}part 'model/{{classVarName}}.dart';
|
{{#models}}{{#model}}part 'model/{{classFilename}}.dart';
|
||||||
{{/model}}{{/models}}
|
{{/model}}{{/models}}
|
@ -12,18 +12,22 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type {{classname}} struct {
|
type {{classname}} struct {
|
||||||
basePath string
|
Configuration Configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
func New{{classname}}() *{{classname}}{
|
func New{{classname}}() *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
return &{{classname}} {
|
return &{{classname}} {
|
||||||
basePath: "{{basePath}}",
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
return &{{classname}} {
|
return &{{classname}} {
|
||||||
basePath: basePath,
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +41,7 @@ func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
|||||||
//func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
//func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
|
||||||
_sling := sling.New().{{httpMethod}}(a.basePath)
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "{{basePathWithoutHost}}{{path}}"
|
path := "{{basePathWithoutHost}}{{path}}"
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package {{packageName}}
|
||||||
|
|
||||||
|
import (
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
type Configuration struct {
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
ApiKey string `json:"apiKey,omitempty"`
|
||||||
|
Debug bool `json:"debug,omitempty"`
|
||||||
|
DebugFile string `json:"debugFile,omitempty"`
|
||||||
|
OAuthToken string `json:"oAuthToken,omitempty"`
|
||||||
|
Timeout int `json:"timeout,omitempty"`
|
||||||
|
BasePath string `json:"basePath,omitempty"`
|
||||||
|
Host string `json:"host,omitempty"`
|
||||||
|
Scheme string `json:"scheme,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewConfiguration() *Configuration {
|
||||||
|
return &Configuration{
|
||||||
|
BasePath: "{{basePath}}",
|
||||||
|
UserName: "",
|
||||||
|
Debug: false,
|
||||||
|
}
|
||||||
|
}
|
@ -716,11 +716,11 @@ static void (^reachabilityChangeBlock)(int);
|
|||||||
for (NSString *auth in authSettings) {
|
for (NSString *auth in authSettings) {
|
||||||
NSDictionary *authSetting = [[config authSettings] objectForKey:auth];
|
NSDictionary *authSetting = [[config authSettings] objectForKey:auth];
|
||||||
|
|
||||||
if (authSetting) {
|
if (authSetting) { // auth setting is set only if the key is non-empty
|
||||||
if ([authSetting[@"in"] isEqualToString:@"header"]) {
|
if ([authSetting[@"in"] isEqualToString:@"header"] && [authSetting[@"key"] length] != 0) {
|
||||||
[headersWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
[headersWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
||||||
}
|
}
|
||||||
else if ([authSetting[@"in"] isEqualToString:@"query"]) {
|
else if ([authSetting[@"in"] isEqualToString:@"query"] && [authSetting[@"key"] length] != 0) {
|
||||||
[querysWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
[querysWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
self.host = @"{{basePath}}";
|
self.host = @"{{basePath}}";
|
||||||
self.username = @"";
|
self.username = @"";
|
||||||
self.password = @"";
|
self.password = @"";
|
||||||
|
self.accessToken= @"";
|
||||||
self.tempFolderPath = nil;
|
self.tempFolderPath = nil;
|
||||||
self.debug = NO;
|
self.debug = NO;
|
||||||
self.verifySSL = YES;
|
self.verifySSL = YES;
|
||||||
@ -42,18 +43,23 @@
|
|||||||
#pragma mark - Instance Methods
|
#pragma mark - Instance Methods
|
||||||
|
|
||||||
- (NSString *) getApiKeyWithPrefix:(NSString *)key {
|
- (NSString *) getApiKeyWithPrefix:(NSString *)key {
|
||||||
if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key]) {
|
if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key] != (id)[NSNull null] && [[self.apiKey objectForKey:key] length] != 0) { // both api key prefix and api key are set
|
||||||
return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]];
|
return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]];
|
||||||
}
|
}
|
||||||
else if ([self.apiKey objectForKey:key]) {
|
else if ([self.apiKey objectForKey:key] != (id)[NSNull null] && [[self.apiKey objectForKey:key] length] != 0) { // only api key, no api key prefix
|
||||||
return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]];
|
return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]];
|
||||||
}
|
}
|
||||||
else {
|
else { // return empty string if nothing is set
|
||||||
return @"";
|
return @"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) getBasicAuthToken {
|
- (NSString *) getBasicAuthToken {
|
||||||
|
// return empty string if username and password are empty
|
||||||
|
if (self.username.length == 0 && self.password.length == 0){
|
||||||
|
return @"";
|
||||||
|
}
|
||||||
|
|
||||||
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password];
|
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password];
|
||||||
NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]];
|
basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]];
|
||||||
@ -61,6 +67,15 @@
|
|||||||
return basicAuthCredentials;
|
return basicAuthCredentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) getAccessToken {
|
||||||
|
if (self.accessToken.length == 0) { // token not set, return empty string
|
||||||
|
return @"";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [NSString stringWithFormat:@"BEARER %@", self.accessToken];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Setter Methods
|
#pragma mark - Setter Methods
|
||||||
|
|
||||||
- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier {
|
- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier {
|
||||||
@ -126,6 +141,15 @@
|
|||||||
@"value": [self getBasicAuthToken]
|
@"value": [self getBasicAuthToken]
|
||||||
},
|
},
|
||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}
|
||||||
|
@"{{name}}":
|
||||||
|
@{
|
||||||
|
@"type": @"oauth",
|
||||||
|
@"in": @"header",
|
||||||
|
@"key": @"Authorization",
|
||||||
|
@"value": [self getAccessToken]
|
||||||
|
},
|
||||||
|
{{/isOAuth}}
|
||||||
{{/authMethods}}
|
{{/authMethods}}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,11 @@
|
|||||||
*/
|
*/
|
||||||
@property (nonatomic) NSString *password;
|
@property (nonatomic) NSString *password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access token for OAuth
|
||||||
|
*/
|
||||||
|
@property (nonatomic) NSString *accessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temp folder for file download
|
* Temp folder for file download
|
||||||
*/
|
*/
|
||||||
@ -132,6 +137,11 @@
|
|||||||
*/
|
*/
|
||||||
- (NSString *) getBasicAuthToken;
|
- (NSString *) getBasicAuthToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets OAuth access token
|
||||||
|
*/
|
||||||
|
- (NSString *) getAccessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets Authentication Setings
|
* Gets Authentication Setings
|
||||||
*/
|
*/
|
||||||
|
@ -1,20 +1,147 @@
|
|||||||
# {{podName}}
|
# {{podName}}
|
||||||
|
|
||||||
|
{{#appDescription}}
|
||||||
|
{{{appDescription}}}
|
||||||
|
{{/appDescription}}
|
||||||
|
|
||||||
|
This ObjC package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: {{appVersion}}
|
||||||
|
- Package version: {{artifactVersion}}
|
||||||
|
- Build date: {{generatedDate}}
|
||||||
|
- Build package: {{generatorClass}}
|
||||||
|
{{#infoUrl}}
|
||||||
|
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||||
|
{{/infoUrl}}
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
The API client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
|
The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project.
|
||||||
|
|
||||||
## Installation
|
## Installation & Usage
|
||||||
|
### Install from Github using [CocoaPods](https://cocoapods.org/)
|
||||||
|
|
||||||
To install it, put the API client library in your project and then simply add the following line to your Podfile:
|
Add the following to the Podfile:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
pod "{{podName}}", :path => "/path/to/lib"
|
pod '{{podName}}', :git => 'https://github.com/{{gitUserId}}/{{gitRepoId}}.git'
|
||||||
|
```
|
||||||
|
|
||||||
|
To specify a particular branch, append `, :branch => 'branch-name-here'`
|
||||||
|
|
||||||
|
To specify a particular commit, append `, :commit => '11aa22'`
|
||||||
|
|
||||||
|
### Install from local path using [CocoaPods](https://cocoapods.org/)
|
||||||
|
|
||||||
|
Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/{{podName}}) and then add the following to the Podfile:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
pod '{{podName}}', :path => 'Vendor/{{podName}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Import the following:
|
||||||
|
```objc
|
||||||
|
#import <{{podName}}/{{{classPrefix}}}ApiClient.h>
|
||||||
|
#import <{{podName}}/{{{classPrefix}}}Configuration.h>
|
||||||
|
// load models
|
||||||
|
{{#models}}{{#model}}#import <{{podName}}/{{{classname}}}.h>
|
||||||
|
{{/model}}{{/models}}// load API classes for accessing endpoints
|
||||||
|
{{#apiInfo}}{{#apis}}#import <{{podName}}/{{{classname}}}.h>
|
||||||
|
{{/apis}}{{/apiInfo}}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Recommendation
|
## Recommendation
|
||||||
|
|
||||||
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issue.
|
It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
|
```objc
|
||||||
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
|
||||||
|
{{#hasAuthMethods}}
|
||||||
|
{{classPrefix}}Configuration *apiConfig = [{{classPrefix}}Configuration sharedConfig];
|
||||||
|
{{#authMethods}}{{#isBasic}}// Configure HTTP basic authorization (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setUsername:@"YOUR_USERNAME"];
|
||||||
|
[apiConfig setPassword:@"YOUR_PASSWORD"];
|
||||||
|
{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"{{{keyParamName}}}"];
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
//[apiConfig setApiKeyPrefix:@"BEARER" forApiKeyIdentifier:@"{{{keyParamName}}}"];
|
||||||
|
{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||||
|
{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
{{#allParams}}{{{dataType}}} *{{paramName}} = {{{example}}}; // {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
@try
|
||||||
|
{
|
||||||
|
{{classname}} *apiInstance = [[{{classname}} alloc] init];
|
||||||
|
|
||||||
|
{{#summary}} // {{{.}}}
|
||||||
|
{{/summary}} [apiInstance {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
|
||||||
|
{{paramName}}{{/secondaryParam}}:{{paramName}}{{/allParams}}
|
||||||
|
{{#hasParams}}completionHandler: {{/hasParams}}^({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) {
|
||||||
|
{{#returnType}}
|
||||||
|
if (output) {
|
||||||
|
NSLog(@"%@", output);
|
||||||
|
}
|
||||||
|
{{/returnType}}
|
||||||
|
if (error) {
|
||||||
|
NSLog(@"Error: %@", error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
@catch (NSException *exception)
|
||||||
|
{
|
||||||
|
NSLog(@"Exception when calling {{classname}}->{{operationId}}: %@ ", exception.name);
|
||||||
|
NSLog(@"Reason: %@ ", exception.reason);
|
||||||
|
}
|
||||||
|
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
|
||||||
|
{{/model}}{{/models}}
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
{{^authMethods}} All endpoints do not require authorization.
|
||||||
|
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
|
||||||
|
{{#authMethods}}## {{{name}}}
|
||||||
|
|
||||||
|
{{#isApiKey}}- **Type**: API key
|
||||||
|
- **API key parameter name**: {{{keyParamName}}}
|
||||||
|
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||||
|
{{/isApiKey}}
|
||||||
|
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
|
- **Flow**: {{{flow}}}
|
||||||
|
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
||||||
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
|
{{/scopes}}
|
||||||
|
{{/isOAuth}}
|
||||||
|
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
|
@ -0,0 +1,93 @@
|
|||||||
|
# {{classname}}{{#description}}
|
||||||
|
{{description}}{{/description}}
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
# **{{{operationId}}}**
|
||||||
|
```objc
|
||||||
|
-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
|
||||||
|
{{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}}
|
||||||
|
{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler;
|
||||||
|
```
|
||||||
|
|
||||||
|
{{{summary}}}{{#notes}}
|
||||||
|
|
||||||
|
{{{notes}}}{{/notes}}
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```objc
|
||||||
|
{{#hasAuthMethods}}
|
||||||
|
{{classPrefix}}Configuration *apiConfig = [{{classPrefix}}Configuration sharedConfig];
|
||||||
|
{{#authMethods}}{{#isBasic}}// Configure HTTP basic authorization (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setUsername:@"YOUR_USERNAME"];
|
||||||
|
[apiConfig setPassword:@"YOUR_PASSWORD"];
|
||||||
|
{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"{{{keyParamName}}}"];
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
//[apiConfig setApiKeyPrefix:@"BEARER" forApiKeyIdentifier:@"{{{keyParamName}}}"];
|
||||||
|
{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||||
|
{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
{{#allParams}}{{{dataType}}} {{paramName}} = {{{example}}}; // {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
@try
|
||||||
|
{
|
||||||
|
{{classname}} *apiInstance = [[{{classname}} alloc] init];
|
||||||
|
|
||||||
|
{{#summary}} // {{{.}}}
|
||||||
|
{{/summary}} [apiInstance {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
|
||||||
|
{{paramName}}{{/secondaryParam}}:{{paramName}}{{/allParams}}
|
||||||
|
{{#hasParams}}completionHandler: {{/hasParams}}^({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error) {
|
||||||
|
{{#returnType}}
|
||||||
|
if (output) {
|
||||||
|
NSLog(@"%@", output);
|
||||||
|
}
|
||||||
|
{{/returnType}}
|
||||||
|
if (error) {
|
||||||
|
NSLog(@"Error: %@", error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
@catch (NSException *exception)
|
||||||
|
{
|
||||||
|
NSLog(@"Exception when calling {{classname}}->{{operationId}}: %@ ", exception.name);
|
||||||
|
NSLog(@"Reason: %@ ", exception.reason);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
|
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
|
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,11 @@
|
|||||||
|
{{#models}}{{#model}}# {{classname}}
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
{{/model}}{{/models}}
|
@ -259,7 +259,7 @@ class ApiClient
|
|||||||
*
|
*
|
||||||
* @return string Accept (e.g. application/json)
|
* @return string Accept (e.g. application/json)
|
||||||
*/
|
*/
|
||||||
public static function selectHeaderAccept($accept)
|
public function selectHeaderAccept($accept)
|
||||||
{
|
{
|
||||||
if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) {
|
if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) {
|
||||||
return null;
|
return null;
|
||||||
@ -277,7 +277,7 @@ class ApiClient
|
|||||||
*
|
*
|
||||||
* @return string Content-Type (e.g. application/json)
|
* @return string Content-Type (e.g. application/json)
|
||||||
*/
|
*/
|
||||||
public static function selectHeaderContentType($content_type)
|
public function selectHeaderContentType($content_type)
|
||||||
{
|
{
|
||||||
if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) {
|
if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) {
|
||||||
return 'application/json';
|
return 'application/json';
|
||||||
@ -299,9 +299,9 @@ class ApiClient
|
|||||||
{
|
{
|
||||||
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
|
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
|
||||||
$headers = array();
|
$headers = array();
|
||||||
$key = ''; // [+]
|
$key = '';
|
||||||
|
|
||||||
foreach(explode("\n", $raw_headers) as $i => $h)
|
foreach(explode("\n", $raw_headers) as $h)
|
||||||
{
|
{
|
||||||
$h = explode(':', $h, 2);
|
$h = explode(':', $h, 2);
|
||||||
|
|
||||||
@ -311,26 +311,22 @@ class ApiClient
|
|||||||
$headers[$h[0]] = trim($h[1]);
|
$headers[$h[0]] = trim($h[1]);
|
||||||
elseif (is_array($headers[$h[0]]))
|
elseif (is_array($headers[$h[0]]))
|
||||||
{
|
{
|
||||||
// $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); // [-]
|
$headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1])));
|
||||||
// $headers[$h[0]] = $tmp; // [-]
|
|
||||||
$headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); // [+]
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [-]
|
$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));
|
||||||
// $headers[$h[0]] = $tmp; // [-]
|
|
||||||
$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [+]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = $h[0]; // [+]
|
$key = $h[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (substr($h[0], 0, 1) == "\t")
|
||||||
|
$headers[$key] .= "\r\n\t".trim($h[0]);
|
||||||
|
elseif (!$key)
|
||||||
|
$headers[0] = trim($h[0]);trim($h[0]);
|
||||||
}
|
}
|
||||||
else // [+]
|
|
||||||
{ // [+]
|
|
||||||
if (substr($h[0], 0, 1) == "\t") // [+]
|
|
||||||
$headers[$key] .= "\r\n\t".trim($h[0]); // [+]
|
|
||||||
elseif (!$key) // [+]
|
|
||||||
$headers[0] = trim($h[0]);trim($h[0]); // [+]
|
|
||||||
} // [+]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $headers;
|
return $headers;
|
||||||
|
@ -55,14 +55,14 @@ class ObjectSerializer
|
|||||||
public static function sanitizeForSerialization($data)
|
public static function sanitizeForSerialization($data)
|
||||||
{
|
{
|
||||||
if (is_scalar($data) || null === $data) {
|
if (is_scalar($data) || null === $data) {
|
||||||
$sanitized = $data;
|
return $data;
|
||||||
} elseif ($data instanceof \DateTime) {
|
} elseif ($data instanceof \DateTime) {
|
||||||
$sanitized = $data->format(\DateTime::ATOM);
|
return $data->format(\DateTime::ATOM);
|
||||||
} elseif (is_array($data)) {
|
} elseif (is_array($data)) {
|
||||||
foreach ($data as $property => $value) {
|
foreach ($data as $property => $value) {
|
||||||
$data[$property] = self::sanitizeForSerialization($value);
|
$data[$property] = self::sanitizeForSerialization($value);
|
||||||
}
|
}
|
||||||
$sanitized = $data;
|
return $data;
|
||||||
} elseif (is_object($data)) {
|
} elseif (is_object($data)) {
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach (array_keys($data::swaggerTypes()) as $property) {
|
foreach (array_keys($data::swaggerTypes()) as $property) {
|
||||||
@ -71,12 +71,10 @@ class ObjectSerializer
|
|||||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter());
|
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sanitized = (object)$values;
|
return (object)$values;
|
||||||
} else {
|
} else {
|
||||||
$sanitized = (string)$data;
|
return (string)$data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sanitized;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -224,7 +222,7 @@ class ObjectSerializer
|
|||||||
public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null)
|
public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null)
|
||||||
{
|
{
|
||||||
if (null === $data) {
|
if (null === $data) {
|
||||||
$deserialized = null;
|
return null;
|
||||||
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
|
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
|
||||||
$inner = substr($class, 4, -1);
|
$inner = substr($class, 4, -1);
|
||||||
$deserialized = array();
|
$deserialized = array();
|
||||||
@ -235,16 +233,17 @@ class ObjectSerializer
|
|||||||
$deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator);
|
$deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $deserialized;
|
||||||
} elseif (strcasecmp(substr($class, -2), '[]') == 0) {
|
} elseif (strcasecmp(substr($class, -2), '[]') == 0) {
|
||||||
$subClass = substr($class, 0, -2);
|
$subClass = substr($class, 0, -2);
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
$values[] = self::deserialize($value, $subClass, null, $discriminator);
|
$values[] = self::deserialize($value, $subClass, null, $discriminator);
|
||||||
}
|
}
|
||||||
$deserialized = $values;
|
return $values;
|
||||||
} elseif ($class === 'object') {
|
} elseif ($class === 'object') {
|
||||||
settype($data, 'array');
|
settype($data, 'array');
|
||||||
$deserialized = $data;
|
return $data;
|
||||||
} elseif ($class === '\DateTime') {
|
} elseif ($class === '\DateTime') {
|
||||||
// Some API's return an invalid, empty string as a
|
// Some API's return an invalid, empty string as a
|
||||||
// date-time property. DateTime::__construct() will return
|
// date-time property. DateTime::__construct() will return
|
||||||
@ -253,13 +252,13 @@ class ObjectSerializer
|
|||||||
// be interpreted as a missing field/value. Let's handle
|
// be interpreted as a missing field/value. Let's handle
|
||||||
// this graceful.
|
// this graceful.
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
$deserialized = new \DateTime($data);
|
return new \DateTime($data);
|
||||||
} else {
|
} else {
|
||||||
$deserialized = null;
|
return null;
|
||||||
}
|
}
|
||||||
} elseif (in_array($class, array({{&primitives}}))) {
|
} elseif (in_array($class, array({{&primitives}}))) {
|
||||||
settype($data, $class);
|
settype($data, $class);
|
||||||
$deserialized = $data;
|
return $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
// determine file name
|
// determine file name
|
||||||
if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||||
@ -270,6 +269,7 @@ class ObjectSerializer
|
|||||||
$deserialized = new \SplFileObject($filename, "w");
|
$deserialized = new \SplFileObject($filename, "w");
|
||||||
$byte_written = $deserialized->fwrite($data);
|
$byte_written = $deserialized->fwrite($data);
|
||||||
error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile());
|
error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile());
|
||||||
|
return $deserialized;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// If a discriminator is defined and points to a valid subclass, use it.
|
// If a discriminator is defined and points to a valid subclass, use it.
|
||||||
@ -292,9 +292,7 @@ class ObjectSerializer
|
|||||||
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));
|
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$deserialized = $instance;
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $deserialized;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ use \{{invokerPackage}}\ObjectSerializer;
|
|||||||
*/
|
*/
|
||||||
public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->{{operationId}}WithHttpInfo ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
list($response) = $this->{{operationId}}WithHttpInfo ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,11 +130,11 @@ use \{{invokerPackage}}\ObjectSerializer;
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}}));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}}));
|
||||||
|
|
||||||
{{#queryParams}}// query params
|
{{#queryParams}}// query params
|
||||||
{{#collectionFormat}}
|
{{#collectionFormat}}
|
||||||
@ -223,14 +223,14 @@ use \{{invokerPackage}}\ObjectSerializer;
|
|||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\{{invokerPackage}}\ObjectSerializer::deserialize($response, '{{returnType}}', $httpHeader{{#discriminator}}, '{{discriminator}}'{{/discriminator}}), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '{{returnType}}', $httpHeader{{#discriminator}}, '{{discriminator}}'{{/discriminator}}), $statusCode, $httpHeader);
|
||||||
{{/returnType}}{{^returnType}}
|
{{/returnType}}{{^returnType}}
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) { {{#responses}}{{#dataType}}
|
switch ($e->getCode()) { {{#responses}}{{#dataType}}
|
||||||
{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}}
|
{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}}
|
||||||
$data = \{{invokerPackage}}\ObjectSerializer::deserialize($e->getResponseBody(), '{{dataType}}', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '{{dataType}}', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;{{/dataType}}{{/responses}}
|
break;{{/dataType}}{{/responses}}
|
||||||
}
|
}
|
||||||
|
@ -192,11 +192,11 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
|
||||||
return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{/model}}
|
{{/model}}
|
||||||
|
@ -1,73 +1,122 @@
|
|||||||
|
# {{packageName}}
|
||||||
|
{{#appDescription}}
|
||||||
|
{{{appDescription}}}
|
||||||
|
{{/appDescription}}
|
||||||
|
|
||||||
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: {{appVersion}}
|
||||||
|
- Package version: {{packageVersion}}
|
||||||
|
- Build date: {{generatedDate}}
|
||||||
|
- Build package: {{generatorClass}}
|
||||||
|
{{#infoUrl}}
|
||||||
|
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||||
|
{{/infoUrl}}
|
||||||
|
|
||||||
## Requirements.
|
## Requirements.
|
||||||
Python 2.7 and later.
|
|
||||||
|
|
||||||
## Setuptools
|
Python 2.7 and 3.4+
|
||||||
You can install the bindings via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
||||||
|
## Installation & Usage
|
||||||
|
### pip install
|
||||||
|
|
||||||
|
If the python package is hosted on Github, you can install directly from Github
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python setup.py install
|
pip install git+https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}.git
|
||||||
|
```
|
||||||
|
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}.git`)
|
||||||
|
|
||||||
|
Then import the package:
|
||||||
|
```python
|
||||||
|
import {{{packageName}}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can install from Github via pip:
|
### Setuptools
|
||||||
|
|
||||||
|
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install git+https://github.com/geekerzp/swagger_client.git
|
python setup.py install --user
|
||||||
```
|
```
|
||||||
|
(or `sudo python setup.py install` to install the package for all users)
|
||||||
|
|
||||||
To use the bindings, import the pacakge:
|
Then import the package:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import swagger_client
|
import {{{packageName}}}
|
||||||
```
|
|
||||||
|
|
||||||
## Manual Installation
|
|
||||||
If you do not wish to use setuptools, you can download the latest release.
|
|
||||||
Then, to use the bindings, import the package:
|
|
||||||
|
|
||||||
```python
|
|
||||||
import path.to.swagger_client
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
TODO
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
## Documentation
|
```python
|
||||||
|
import time
|
||||||
|
import {{{packageName}}}
|
||||||
|
from {{{packageName}}}.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
# Configure HTTP basic authorization: {{{name}}}
|
||||||
|
{{{packageName}}}.configuration.username = 'YOUR_USERNAME'
|
||||||
|
{{{packageName}}}.configuration.password = 'YOUR_PASSWORD'{{/isBasic}}{{#isApiKey}}
|
||||||
|
# Configure API key authorization: {{{name}}}
|
||||||
|
{{{packageName}}}.configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# {{{packageName}}}.configuration.api_key_prefix['{{{keyParamName}}}'] = 'BEARER'{{/isApiKey}}{{#isOAuth}}
|
||||||
|
# Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
{{{packageName}}}.configuration.access_token = 'YOUR_ACCESS_TOKEN'{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = {{{packageName}}}.{{{classname}}}
|
||||||
|
{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
TODO
|
try:
|
||||||
|
{{#summary}} # {{{.}}}
|
||||||
## Tests
|
{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}
|
||||||
|
pprint(api_response){{/returnType}}
|
||||||
(Please make sure you have [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/) installed)
|
except ApiException as e:
|
||||||
|
print "Exception when calling {{classname}}->{{operationId}}: %s\n" % e
|
||||||
Execute the following command to run the tests in the current Python (v2 or v3) environment:
|
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
```sh
|
|
||||||
$ make test
|
|
||||||
[... magically installs dependencies and runs tests on your virtualenv]
|
|
||||||
Ran 7 tests in 19.289s
|
|
||||||
|
|
||||||
OK
|
|
||||||
```
|
```
|
||||||
or
|
|
||||||
|
|
||||||
```
|
## Documentation for API Endpoints
|
||||||
$ mvn integration-test -rf :PythonPetstoreClientTests
|
|
||||||
Using 2195432783 as seed
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] BUILD SUCCESS
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] Total time: 37.594 s
|
|
||||||
[INFO] Finished at: 2015-05-16T18:00:35+08:00
|
|
||||||
[INFO] Final Memory: 11M/156M
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
```
|
|
||||||
If you want to run the tests in all the python platforms:
|
|
||||||
|
|
||||||
```sh
|
All URIs are relative to *{{basePath}}*
|
||||||
$ make test-all
|
|
||||||
[... tox creates a virtualenv for every platform and runs tests inside of each]
|
Class | Method | HTTP request | Description
|
||||||
py27: commands succeeded
|
------------ | ------------- | ------------- | -------------
|
||||||
py34: commands succeeded
|
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
congratulations :)
|
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
```
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
|
||||||
|
{{/model}}{{/models}}
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
{{^authMethods}} All endpoints do not require authorization.
|
||||||
|
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
|
||||||
|
{{#authMethods}}## {{{name}}}
|
||||||
|
|
||||||
|
{{#isApiKey}}- **Type**: API key
|
||||||
|
- **API key parameter name**: {{{keyParamName}}}
|
||||||
|
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||||
|
{{/isApiKey}}
|
||||||
|
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
|
- **Flow**: {{{flow}}}
|
||||||
|
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
||||||
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
|
{{/scopes}}
|
||||||
|
{{/isOAuth}}
|
||||||
|
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||||
|
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||||
|
@ -47,7 +47,7 @@ class {{classname}}(object):
|
|||||||
self.api_client = config.api_client
|
self.api_client = config.api_client
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
|
|
||||||
def {{nickname}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):
|
def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):
|
||||||
"""
|
"""
|
||||||
{{{summary}}}
|
{{{summary}}}
|
||||||
{{{notes}}}
|
{{{notes}}}
|
||||||
@ -59,10 +59,10 @@ class {{classname}}(object):
|
|||||||
>>> pprint(response)
|
>>> pprint(response)
|
||||||
>>>
|
>>>
|
||||||
{{#sortParamsByRequiredFlag}}
|
{{#sortParamsByRequiredFlag}}
|
||||||
>>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
|
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
|
||||||
{{/sortParamsByRequiredFlag}}
|
{{/sortParamsByRequiredFlag}}
|
||||||
{{^sortParamsByRequiredFlag}}
|
{{^sortParamsByRequiredFlag}}
|
||||||
>>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function)
|
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function)
|
||||||
{{/sortParamsByRequiredFlag}}
|
{{/sortParamsByRequiredFlag}}
|
||||||
|
|
||||||
:param callback function: The callback function
|
:param callback function: The callback function
|
||||||
@ -83,7 +83,7 @@ class {{classname}}(object):
|
|||||||
if key not in all_params:
|
if key not in all_params:
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
"Got an unexpected keyword argument '%s'"
|
"Got an unexpected keyword argument '%s'"
|
||||||
" to method {{nickname}}" % key
|
" to method {{operationId}}" % key
|
||||||
)
|
)
|
||||||
params[key] = val
|
params[key] = val
|
||||||
del params['kwargs']
|
del params['kwargs']
|
||||||
@ -92,7 +92,7 @@ class {{classname}}(object):
|
|||||||
{{#required}}
|
{{#required}}
|
||||||
# verify the required parameter '{{paramName}}' is set
|
# verify the required parameter '{{paramName}}' is set
|
||||||
if ('{{paramName}}' not in params) or (params['{{paramName}}'] is None):
|
if ('{{paramName}}' not in params) or (params['{{paramName}}'] is None):
|
||||||
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{nickname}}`")
|
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`")
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
|
@ -371,7 +371,8 @@ class ApiClient(object):
|
|||||||
elif method == "DELETE":
|
elif method == "DELETE":
|
||||||
return self.rest_client.DELETE(url,
|
return self.rest_client.DELETE(url,
|
||||||
query_params=query_params,
|
query_params=query_params,
|
||||||
headers=headers)
|
headers=headers,
|
||||||
|
body=body)
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"http method must be `GET`, `HEAD`,"
|
"http method must be `GET`, `HEAD`,"
|
||||||
|
@ -0,0 +1,74 @@
|
|||||||
|
# {{packageName}}.{{classname}}{{#description}}
|
||||||
|
{{description}}{{/description}}
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
# **{{{operationId}}}**
|
||||||
|
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
|
|
||||||
|
{{{summary}}}{{#notes}}
|
||||||
|
|
||||||
|
{{{notes}}}{{/notes}}
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import {{{packageName}}}
|
||||||
|
from {{{packageName}}}.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
# Configure HTTP basic authorization: {{{name}}}
|
||||||
|
{{{packageName}}}.configuration.username = 'YOUR_USERNAME'
|
||||||
|
{{{packageName}}}.configuration.password = 'YOUR_PASSWORD'{{/isBasic}}{{#isApiKey}}
|
||||||
|
# Configure API key authorization: {{{name}}}
|
||||||
|
{{{packageName}}}.configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# {{{packageName}}}.configuration.api_key_prefix['{{{keyParamName}}}'] = 'BEARER'{{/isApiKey}}{{#isOAuth}}
|
||||||
|
# Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
{{{packageName}}}.configuration.access_token = 'YOUR_ACCESS_TOKEN'{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = {{{packageName}}}.{{{classname}}}()
|
||||||
|
{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try:
|
||||||
|
{{#summary}} # {{{.}}}
|
||||||
|
{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}
|
||||||
|
pprint(api_response){{/returnType}}
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling {{classname}}->{{operationId}}: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
|
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
|
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,11 @@
|
|||||||
|
{{#models}}{{#model}}# {{classname}}
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
{{/model}}{{/models}}
|
@ -133,8 +133,8 @@ class RESTClientObject(object):
|
|||||||
headers['Content-Type'] = 'application/json'
|
headers['Content-Type'] = 'application/json'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# For `POST`, `PUT`, `PATCH`, `OPTIONS`
|
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
||||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS']:
|
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||||
if query_params:
|
if query_params:
|
||||||
url += '?' + urlencode(query_params)
|
url += '?' + urlencode(query_params)
|
||||||
if headers['Content-Type'] == 'application/json':
|
if headers['Content-Type'] == 'application/json':
|
||||||
@ -154,7 +154,7 @@ class RESTClientObject(object):
|
|||||||
fields=post_params,
|
fields=post_params,
|
||||||
encode_multipart=True,
|
encode_multipart=True,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
# For `GET`, `HEAD`, `DELETE`
|
# For `GET`, `HEAD`
|
||||||
else:
|
else:
|
||||||
r = self.pool_manager.request(method, url,
|
r = self.pool_manager.request(method, url,
|
||||||
fields=query_params,
|
fields=query_params,
|
||||||
@ -195,10 +195,11 @@ class RESTClientObject(object):
|
|||||||
post_params=post_params,
|
post_params=post_params,
|
||||||
body=body)
|
body=body)
|
||||||
|
|
||||||
def DELETE(self, url, headers=None, query_params=None):
|
def DELETE(self, url, headers=None, query_params=None, body=None):
|
||||||
return self.request("DELETE", url,
|
return self.request("DELETE", url,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
query_params=query_params)
|
query_params=query_params,
|
||||||
|
body=body)
|
||||||
|
|
||||||
def POST(self, url, headers=None, query_params=None, post_params=None, body=None):
|
def POST(self, url, headers=None, query_params=None, post_params=None, body=None):
|
||||||
return self.request("POST", url,
|
return self.request("POST", url,
|
||||||
|
@ -21,7 +21,7 @@ module {{moduleName}}
|
|||||||
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
|
{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
|
||||||
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
||||||
{{#returnType}}data, status_code, headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
|
{{#returnType}}data, _status_code, _headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
|
||||||
{{#returnType}}return data{{/returnType}}{{^returnType}}return nil{{/returnType}}
|
{{#returnType}}return data{{/returnType}}{{^returnType}}return nil{{/returnType}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -58,12 +58,12 @@ module {{moduleName}}
|
|||||||
header_params = {}
|
header_params = {}
|
||||||
|
|
||||||
# HTTP header 'Accept' (if needed)
|
# HTTP header 'Accept' (if needed)
|
||||||
_header_accept = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
|
local_header_accept = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
|
||||||
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||||
|
|
||||||
# HTTP header 'Content-Type'
|
# HTTP header 'Content-Type'
|
||||||
_header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
|
local_header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
|
||||||
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type){{#headerParams}}{{#required}}
|
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type){{#headerParams}}{{#required}}
|
||||||
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}{{/required}}{{/headerParams}}{{#headerParams}}{{^required}}
|
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}{{/required}}{{/headerParams}}{{#headerParams}}{{^required}}
|
||||||
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if opts[:'{{{paramName}}}']{{/required}}{{/headerParams}}
|
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if opts[:'{{{paramName}}}']{{/required}}{{/headerParams}}
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ module {{moduleName}}
|
|||||||
# @return [Hash]
|
# @return [Hash]
|
||||||
attr_accessor :default_headers
|
attr_accessor :default_headers
|
||||||
|
|
||||||
|
# Initializes the ApiClient
|
||||||
|
# @option config [Configuration] Configuraiton for initializing the object, default to Configuration.default
|
||||||
def initialize(config = Configuration.default)
|
def initialize(config = Configuration.default)
|
||||||
@config = config
|
@config = config
|
||||||
@user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/#{VERSION}/ruby{{/httpUserAgent}}"
|
@user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/#{VERSION}/ruby{{/httpUserAgent}}"
|
||||||
@ -59,6 +61,15 @@ module {{moduleName}}
|
|||||||
return data, response.code, response.headers
|
return data, response.code, response.headers
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Builds the HTTP request
|
||||||
|
#
|
||||||
|
# @param [String] http_method HTTP method/verb (e.g. POST)
|
||||||
|
# @param [String] path URL path (e.g. /account/new)
|
||||||
|
# @option opts [Hash] :header_params Header parameters
|
||||||
|
# @option opts [Hash] :query_params Query parameters
|
||||||
|
# @option opts [Hash] :form_params Query parameters
|
||||||
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
||||||
|
# @return [Typhoeus::Request] A Typhoeus Request
|
||||||
def build_request(http_method, path, opts = {})
|
def build_request(http_method, path, opts = {})
|
||||||
url = build_request_url(path)
|
url = build_request_url(path)
|
||||||
http_method = http_method.to_sym.downcase
|
http_method = http_method.to_sym.downcase
|
||||||
@ -100,12 +111,15 @@ module {{moduleName}}
|
|||||||
# application/json
|
# application/json
|
||||||
# application/json; charset=UTF8
|
# application/json; charset=UTF8
|
||||||
# APPLICATION/JSON
|
# APPLICATION/JSON
|
||||||
|
# @param [String] mime MIME
|
||||||
|
# @return [Boolean] True if the MIME is applicaton/json
|
||||||
def json_mime?(mime)
|
def json_mime?(mime)
|
||||||
!!(mime =~ /\Aapplication\/json(;.*)?\z/i)
|
!(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deserialize the response to the given return type.
|
# Deserialize the response to the given return type.
|
||||||
#
|
#
|
||||||
|
# @param [Response] response HTTP response
|
||||||
# @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
|
# @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
|
||||||
def deserialize(response, return_type)
|
def deserialize(response, return_type)
|
||||||
body = response.body
|
body = response.body
|
||||||
@ -136,6 +150,9 @@ module {{moduleName}}
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Convert data to the given return type.
|
# Convert data to the given return type.
|
||||||
|
# @param [Object] data Data to be converted
|
||||||
|
# @param [String] return_type Return type
|
||||||
|
# @return [Mixed] Data in a particular type
|
||||||
def convert_to_type(data, return_type)
|
def convert_to_type(data, return_type)
|
||||||
return nil if data.nil?
|
return nil if data.nil?
|
||||||
case return_type
|
case return_type
|
||||||
@ -208,7 +225,7 @@ module {{moduleName}}
|
|||||||
# @param [String] filename the filename to be sanitized
|
# @param [String] filename the filename to be sanitized
|
||||||
# @return [String] the sanitized filename
|
# @return [String] the sanitized filename
|
||||||
def sanitize_filename(filename)
|
def sanitize_filename(filename)
|
||||||
filename.gsub /.*[\/\\]/, ''
|
filename.gsub(/.*[\/\\]/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_request_url(path)
|
def build_request_url(path)
|
||||||
@ -217,6 +234,12 @@ module {{moduleName}}
|
|||||||
URI.encode(@config.base_url + path)
|
URI.encode(@config.base_url + path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Builds the HTTP request body
|
||||||
|
#
|
||||||
|
# @param [Hash] header_params Header parameters
|
||||||
|
# @param [Hash] form_params Query parameters
|
||||||
|
# @param [Object] body HTTP body (JSON/XML)
|
||||||
|
# @return [String] HTTP body data in the form of string
|
||||||
def build_request_body(header_params, form_params, body)
|
def build_request_body(header_params, form_params, body)
|
||||||
# http form
|
# http form
|
||||||
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
||||||
@ -240,6 +263,10 @@ module {{moduleName}}
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Update hearder and query params based on authentication settings.
|
# Update hearder and query params based on authentication settings.
|
||||||
|
#
|
||||||
|
# @param [Hash] header_params Header parameters
|
||||||
|
# @param [Hash] form_params Query parameters
|
||||||
|
# @param [String] auth_names Authentication scheme name
|
||||||
def update_params_for_auth!(header_params, query_params, auth_names)
|
def update_params_for_auth!(header_params, query_params, auth_names)
|
||||||
Array(auth_names).each do |auth_name|
|
Array(auth_names).each do |auth_name|
|
||||||
auth_setting = @config.auth_settings[auth_name]
|
auth_setting = @config.auth_settings[auth_name]
|
||||||
@ -252,6 +279,9 @@ module {{moduleName}}
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Sets user agent in HTTP header
|
||||||
|
#
|
||||||
|
# @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
|
||||||
def user_agent=(user_agent)
|
def user_agent=(user_agent)
|
||||||
@user_agent = user_agent
|
@user_agent = user_agent
|
||||||
@default_headers['User-Agent'] = @user_agent
|
@default_headers['User-Agent'] = @user_agent
|
||||||
@ -283,13 +313,13 @@ module {{moduleName}}
|
|||||||
# @return [String] JSON string representation of the object
|
# @return [String] JSON string representation of the object
|
||||||
def object_to_http_body(model)
|
def object_to_http_body(model)
|
||||||
return model if model.nil? || model.is_a?(String)
|
return model if model.nil? || model.is_a?(String)
|
||||||
_body = nil
|
local_body = nil
|
||||||
if model.is_a?(Array)
|
if model.is_a?(Array)
|
||||||
_body = model.map{|m| object_to_hash(m) }
|
local_body = model.map{|m| object_to_hash(m) }
|
||||||
else
|
else
|
||||||
_body = object_to_hash(model)
|
local_body = object_to_hash(model)
|
||||||
end
|
end
|
||||||
_body.to_json
|
local_body.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# Convert object(non-array) to hash.
|
# Convert object(non-array) to hash.
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
# build the object from hash
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
def build_from_hash(attributes)
|
def build_from_hash(attributes)
|
||||||
return nil unless attributes.is_a?(Hash)
|
return nil unless attributes.is_a?(Hash)
|
||||||
self.class.swagger_types.each_pair do |key, type|
|
self.class.swagger_types.each_pair do |key, type|
|
||||||
if type =~ /^Array<(.*)>/i
|
if type =~ /^Array<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
||||||
else
|
|
||||||
#TODO show warning in debug mode
|
|
||||||
end
|
end
|
||||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
else
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
||||||
# data not found in attributes(hash), not an issue as the data can be optional
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
def _deserialize(type, value)
|
def _deserialize(type, value)
|
||||||
case type.to_sym
|
case type.to_sym
|
||||||
when :DateTime
|
when :DateTime
|
||||||
@ -51,21 +55,25 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else # model
|
else # model
|
||||||
_model = {{moduleName}}.const_get(type).new
|
temp_model = {{moduleName}}.const_get(type).new
|
||||||
_model.build_from_hash(value)
|
temp_model.build_from_hash(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the string representation of the object
|
||||||
|
# @return [String] String presentation of the object
|
||||||
def to_s
|
def to_s
|
||||||
to_hash.to_s
|
to_hash.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# to_body is an alias to to_body (backward compatibility))
|
# to_body is an alias to to_hash (backward compatibility)
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_body
|
def to_body
|
||||||
to_hash
|
to_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# return the object in the form of hash
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_hash
|
def to_hash
|
||||||
hash = {}
|
hash = {}
|
||||||
self.class.attribute_map.each_pair do |attr, param|
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
@ -76,8 +84,10 @@
|
|||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Method to output non-array value in the form of hash
|
# Outputs non-array value in the form of hash
|
||||||
# For object, use to_hash. Otherwise, just return the value
|
# For object, use to_hash. Otherwise, just return the value
|
||||||
|
# @param [Object] value Any valid value
|
||||||
|
# @return [Hash] Returns the value in the form of hash
|
||||||
def _to_hash(value)
|
def _to_hash(value)
|
||||||
if value.is_a?(Array)
|
if value.is_a?(Array)
|
||||||
value.compact.map{ |v| _to_hash(v) }
|
value.compact.map{ |v| _to_hash(v) }
|
||||||
|
@ -28,11 +28,13 @@ module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
def initialize(attributes = {})
|
def initialize(attributes = {})
|
||||||
return unless attributes.is_a?(Hash)
|
return unless attributes.is_a?(Hash)
|
||||||
|
|
||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
if attributes[:'{{{baseName}}}']
|
if attributes[:'{{{baseName}}}']
|
||||||
@ -46,6 +48,7 @@ module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
|||||||
end
|
end
|
||||||
{{#vars}}{{#isEnum}}
|
{{#vars}}{{#isEnum}}
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
|
# @param [Object] {{{name}}} Object to be assigned
|
||||||
def {{{name}}}=({{{name}}})
|
def {{{name}}}=({{{name}}})
|
||||||
allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
|
allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
|
||||||
if {{{name}}} && !allowed_values.include?({{{name}}})
|
if {{{name}}} && !allowed_values.include?({{{name}}})
|
||||||
@ -54,7 +57,8 @@ module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
|||||||
@{{{name}}} = {{{name}}}
|
@{{{name}}} = {{{name}}}
|
||||||
end
|
end
|
||||||
{{/isEnum}}{{/vars}}
|
{{/isEnum}}{{/vars}}
|
||||||
# Check equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def ==(o)
|
def ==(o)
|
||||||
return true if self.equal?(o)
|
return true if self.equal?(o)
|
||||||
self.class == o.class{{#vars}} &&
|
self.class == o.class{{#vars}} &&
|
||||||
@ -62,11 +66,13 @@ module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @see the `==` method
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def eql?(o)
|
def eql?(o)
|
||||||
self == o
|
self == o
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculate hash code according to all attributes.
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Fixnum] Hash code
|
||||||
def hash
|
def hash
|
||||||
[{{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}].hash
|
[{{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}].hash
|
||||||
end
|
end
|
||||||
|
@ -19,6 +19,14 @@ extension Int: JSONEncodable {
|
|||||||
func encodeToJSON() -> AnyObject { return self }
|
func encodeToJSON() -> AnyObject { return self }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension Int32: JSONEncodable {
|
||||||
|
func encodeToJSON() -> AnyObject { return NSNumber(int: self) }
|
||||||
|
}
|
||||||
|
|
||||||
|
extension Int64: JSONEncodable {
|
||||||
|
func encodeToJSON() -> AnyObject { return NSNumber(longLong: self) }
|
||||||
|
}
|
||||||
|
|
||||||
extension Double: JSONEncodable {
|
extension Double: JSONEncodable {
|
||||||
func encodeToJSON() -> AnyObject { return self }
|
func encodeToJSON() -> AnyObject { return self }
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,12 @@ class Decoders {
|
|||||||
|
|
||||||
static func decode<T>(clazz clazz: T.Type, source: AnyObject) -> T {
|
static func decode<T>(clazz clazz: T.Type, source: AnyObject) -> T {
|
||||||
initialize()
|
initialize()
|
||||||
|
if T.self is Int32.Type && source is NSNumber {
|
||||||
|
return source.intValue as! T;
|
||||||
|
}
|
||||||
|
if T.self is Int64.Type && source is NSNumber {
|
||||||
|
return source.longLongValue as! T;
|
||||||
|
}
|
||||||
if source is T {
|
if source is T {
|
||||||
return source as! T
|
return source as! T
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,10 @@ public class {{classname}}: JSONEncodable {
|
|||||||
|
|
||||||
// MARK: JSONEncodable
|
// MARK: JSONEncodable
|
||||||
func encodeToJSON() -> AnyObject {
|
func encodeToJSON() -> AnyObject {
|
||||||
var nillableDictionary = [String:AnyObject?](){{#vars}}{{#isNotContainer}}{{#isPrimitiveType}}{{^isEnum}}
|
var nillableDictionary = [String:AnyObject?](){{#vars}}{{#isNotContainer}}{{#isPrimitiveType}}{{^isEnum}}{{#isInteger}}
|
||||||
nillableDictionary["{{baseName}}"] = self.{{name}}{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}}
|
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isInteger}}{{#isLong}}
|
||||||
|
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isLong}}{{^isLong}}{{^isInteger}}
|
||||||
|
nillableDictionary["{{baseName}}"] = self.{{name}}{{/isInteger}}{{/isLong}}{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}}
|
||||||
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.rawValue{{/isEnum}}{{^isPrimitiveType}}
|
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.rawValue{{/isEnum}}{{^isPrimitiveType}}
|
||||||
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isPrimitiveType}}{{/isNotContainer}}{{#isContainer}}
|
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isPrimitiveType}}{{/isNotContainer}}{{#isContainer}}
|
||||||
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isContainer}}{{/vars}}
|
nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isContainer}}{{/vars}}
|
||||||
|
@ -1314,12 +1314,16 @@
|
|||||||
},
|
},
|
||||||
"Name": {
|
"Name": {
|
||||||
"description": "Model for testing model name same as property name",
|
"description": "Model for testing model name same as property name",
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int32"
|
"format": "int32"
|
||||||
},
|
},
|
||||||
"snake_case": {
|
"snake_case": {
|
||||||
|
"readOnly": true,
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int32"
|
"format": "int32"
|
||||||
}
|
}
|
||||||
@ -1375,6 +1379,59 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"format_test" : {
|
||||||
|
"type" : "object",
|
||||||
|
"required": [
|
||||||
|
"number"
|
||||||
|
],
|
||||||
|
"properties" : {
|
||||||
|
"integer" : {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"int32" : {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"int64" : {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
},
|
||||||
|
"number" : {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"float" : {
|
||||||
|
"type": "number",
|
||||||
|
"format": "float"
|
||||||
|
},
|
||||||
|
"double" : {
|
||||||
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
|
},
|
||||||
|
"string" : {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"byte" : {
|
||||||
|
"type": "string",
|
||||||
|
"format": "byte"
|
||||||
|
},
|
||||||
|
"binary" : {
|
||||||
|
"type": "string",
|
||||||
|
"format": "binary"
|
||||||
|
},
|
||||||
|
"date" : {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date"
|
||||||
|
},
|
||||||
|
"dateTime" : {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"dateTime" : {
|
||||||
|
"type": "string",
|
||||||
|
"format": "password"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ info:
|
|||||||
For this sample, you can use the api key `special-key` to test the authorization filters
|
For this sample, you can use the api key `special-key` to test the authorization filters
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
title: Swagger Petstore
|
title: Swagger Petstore
|
||||||
termsOfService: http://helloreverb.com/terms/
|
termsOfService: http://swagger.io/terms/
|
||||||
contact:
|
contact:
|
||||||
name: apiteam@swagger.io
|
name: apiteam@swagger.io
|
||||||
license:
|
license:
|
||||||
|
2
pom.xml
2
pom.xml
@ -570,7 +570,7 @@
|
|||||||
<commons-lang-version>2.4</commons-lang-version>
|
<commons-lang-version>2.4</commons-lang-version>
|
||||||
<slf4j-version>1.7.12</slf4j-version>
|
<slf4j-version>1.7.12</slf4j-version>
|
||||||
<scala-maven-plugin-version>3.2.1</scala-maven-plugin-version>
|
<scala-maven-plugin-version>3.2.1</scala-maven-plugin-version>
|
||||||
<jmustache-version>1.9</jmustache-version>
|
<jmustache-version>1.12</jmustache-version>
|
||||||
<testng-version>6.9.6</testng-version>
|
<testng-version>6.9.6</testng-version>
|
||||||
<surefire-version>2.18.1</surefire-version>
|
<surefire-version>2.18.1</surefire-version>
|
||||||
<jmockit-version>1.19</jmockit-version>
|
<jmockit-version>1.19</jmockit-version>
|
||||||
|
@ -0,0 +1,291 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
|
namespace IO.Swagger.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[DataContract]
|
||||||
|
public partial class FormatTest : IEquatable<FormatTest>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="FormatTest" /> class.
|
||||||
|
/// Initializes a new instance of the <see cref="FormatTest" />class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Integer">Integer.</param>
|
||||||
|
/// <param name="Int32">Int32.</param>
|
||||||
|
/// <param name="Int64">Int64.</param>
|
||||||
|
/// <param name="Number">Number (required).</param>
|
||||||
|
/// <param name="_Float">_Float.</param>
|
||||||
|
/// <param name="_Double">_Double.</param>
|
||||||
|
/// <param name="_String">_String.</param>
|
||||||
|
/// <param name="_Byte">_Byte.</param>
|
||||||
|
/// <param name="Binary">Binary.</param>
|
||||||
|
/// <param name="Date">Date.</param>
|
||||||
|
/// <param name="DateTime">DateTime.</param>
|
||||||
|
|
||||||
|
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, string DateTime = null)
|
||||||
|
{
|
||||||
|
// to ensure "Number" is required (not null)
|
||||||
|
if (Number == null)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Number is a required property for FormatTest and cannot be null");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Number = Number;
|
||||||
|
}
|
||||||
|
this.Integer = Integer;
|
||||||
|
this.Int32 = Int32;
|
||||||
|
this.Int64 = Int64;
|
||||||
|
this._Float = _Float;
|
||||||
|
this._Double = _Double;
|
||||||
|
this._String = _String;
|
||||||
|
this._Byte = _Byte;
|
||||||
|
this.Binary = Binary;
|
||||||
|
this.Date = Date;
|
||||||
|
this.DateTime = DateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Integer
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="integer", EmitDefaultValue=false)]
|
||||||
|
public int? Integer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Int32
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="int32", EmitDefaultValue=false)]
|
||||||
|
public int? Int32 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Int64
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="int64", EmitDefaultValue=false)]
|
||||||
|
public long? Int64 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Number
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="number", EmitDefaultValue=false)]
|
||||||
|
public double? Number { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets _Float
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="float", EmitDefaultValue=false)]
|
||||||
|
public float? _Float { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets _Double
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="double", EmitDefaultValue=false)]
|
||||||
|
public double? _Double { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets _String
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="string", EmitDefaultValue=false)]
|
||||||
|
public string _String { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets _Byte
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="byte", EmitDefaultValue=false)]
|
||||||
|
public byte[] _Byte { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Binary
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="binary", EmitDefaultValue=false)]
|
||||||
|
public byte[] Binary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Date
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="date", EmitDefaultValue=false)]
|
||||||
|
public DateTime? Date { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DateTime
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="dateTime", EmitDefaultValue=false)]
|
||||||
|
public string DateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
sb.Append("class FormatTest {\n");
|
||||||
|
sb.Append(" Integer: ").Append(Integer).Append("\n");
|
||||||
|
sb.Append(" Int32: ").Append(Int32).Append("\n");
|
||||||
|
sb.Append(" Int64: ").Append(Int64).Append("\n");
|
||||||
|
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||||
|
sb.Append(" _Float: ").Append(_Float).Append("\n");
|
||||||
|
sb.Append(" _Double: ").Append(_Double).Append("\n");
|
||||||
|
sb.Append(" _String: ").Append(_String).Append("\n");
|
||||||
|
sb.Append(" _Byte: ").Append(_Byte).Append("\n");
|
||||||
|
sb.Append(" Binary: ").Append(Binary).Append("\n");
|
||||||
|
sb.Append(" Date: ").Append(Date).Append("\n");
|
||||||
|
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
|
||||||
|
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public string ToJson()
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if objects are equal
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">Object to be compared</param>
|
||||||
|
/// <returns>Boolean</returns>
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
// credit: http://stackoverflow.com/a/10454552/677735
|
||||||
|
return this.Equals(obj as FormatTest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if FormatTest instances are equal
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="other">Instance of FormatTest to be compared</param>
|
||||||
|
/// <returns>Boolean</returns>
|
||||||
|
public bool Equals(FormatTest other)
|
||||||
|
{
|
||||||
|
// credit: http://stackoverflow.com/a/10454552/677735
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return
|
||||||
|
(
|
||||||
|
this.Integer == other.Integer ||
|
||||||
|
this.Integer != null &&
|
||||||
|
this.Integer.Equals(other.Integer)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.Int32 == other.Int32 ||
|
||||||
|
this.Int32 != null &&
|
||||||
|
this.Int32.Equals(other.Int32)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.Int64 == other.Int64 ||
|
||||||
|
this.Int64 != null &&
|
||||||
|
this.Int64.Equals(other.Int64)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.Number == other.Number ||
|
||||||
|
this.Number != null &&
|
||||||
|
this.Number.Equals(other.Number)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this._Float == other._Float ||
|
||||||
|
this._Float != null &&
|
||||||
|
this._Float.Equals(other._Float)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this._Double == other._Double ||
|
||||||
|
this._Double != null &&
|
||||||
|
this._Double.Equals(other._Double)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this._String == other._String ||
|
||||||
|
this._String != null &&
|
||||||
|
this._String.Equals(other._String)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this._Byte == other._Byte ||
|
||||||
|
this._Byte != null &&
|
||||||
|
this._Byte.Equals(other._Byte)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.Binary == other.Binary ||
|
||||||
|
this.Binary != null &&
|
||||||
|
this.Binary.Equals(other.Binary)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.Date == other.Date ||
|
||||||
|
this.Date != null &&
|
||||||
|
this.Date.Equals(other.Date)
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.DateTime == other.DateTime ||
|
||||||
|
this.DateTime != null &&
|
||||||
|
this.DateTime.Equals(other.DateTime)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the hash code
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Hash code</returns>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
// credit: http://stackoverflow.com/a/263416/677735
|
||||||
|
unchecked // Overflow is fine, just wrap
|
||||||
|
{
|
||||||
|
int hash = 41;
|
||||||
|
// Suitable nullity checks etc, of course :)
|
||||||
|
|
||||||
|
if (this.Integer != null)
|
||||||
|
hash = hash * 59 + this.Integer.GetHashCode();
|
||||||
|
|
||||||
|
if (this.Int32 != null)
|
||||||
|
hash = hash * 59 + this.Int32.GetHashCode();
|
||||||
|
|
||||||
|
if (this.Int64 != null)
|
||||||
|
hash = hash * 59 + this.Int64.GetHashCode();
|
||||||
|
|
||||||
|
if (this.Number != null)
|
||||||
|
hash = hash * 59 + this.Number.GetHashCode();
|
||||||
|
|
||||||
|
if (this._Float != null)
|
||||||
|
hash = hash * 59 + this._Float.GetHashCode();
|
||||||
|
|
||||||
|
if (this._Double != null)
|
||||||
|
hash = hash * 59 + this._Double.GetHashCode();
|
||||||
|
|
||||||
|
if (this._String != null)
|
||||||
|
hash = hash * 59 + this._String.GetHashCode();
|
||||||
|
|
||||||
|
if (this._Byte != null)
|
||||||
|
hash = hash * 59 + this._Byte.GetHashCode();
|
||||||
|
|
||||||
|
if (this.Binary != null)
|
||||||
|
hash = hash * 59 + this.Binary.GetHashCode();
|
||||||
|
|
||||||
|
if (this.Date != null)
|
||||||
|
hash = hash * 59 + this.Date.GetHashCode();
|
||||||
|
|
||||||
|
if (this.DateTime != null)
|
||||||
|
hash = hash * 59 + this.DateTime.GetHashCode();
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -22,13 +22,19 @@ namespace IO.Swagger.Model
|
|||||||
/// Initializes a new instance of the <see cref="Name" /> class.
|
/// Initializes a new instance of the <see cref="Name" /> class.
|
||||||
/// Initializes a new instance of the <see cref="Name" />class.
|
/// Initializes a new instance of the <see cref="Name" />class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="_Name">_Name.</param>
|
/// <param name="_Name">_Name (required).</param>
|
||||||
/// <param name="SnakeCase">SnakeCase.</param>
|
|
||||||
|
|
||||||
public Name(int? _Name = null, int? SnakeCase = null)
|
public Name(int? _Name = null)
|
||||||
|
{
|
||||||
|
// to ensure "_Name" is required (not null)
|
||||||
|
if (_Name == null)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("_Name is a required property for Name and cannot be null");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
this._Name = _Name;
|
this._Name = _Name;
|
||||||
this.SnakeCase = SnakeCase;
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +49,7 @@ namespace IO.Swagger.Model
|
|||||||
/// Gets or Sets SnakeCase
|
/// Gets or Sets SnakeCase
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name="snake_case", EmitDefaultValue=false)]
|
[DataMember(Name="snake_case", EmitDefaultValue=false)]
|
||||||
public int? SnakeCase { get; set; }
|
public int? SnakeCase { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
|
@ -66,6 +66,10 @@
|
|||||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Name.cs" />
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Name.cs" />
|
||||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Task.cs" />
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Task.cs" />
|
||||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Model200Response.cs" />
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Model200Response.cs" />
|
||||||
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Animal.cs" />
|
||||||
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Cat.cs" />
|
||||||
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Dog.cs" />
|
||||||
|
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\FormatTest.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<Properties StartupItem="SwaggerClientTest.csproj">
|
<Properties StartupItem="SwaggerClientTest.csproj">
|
||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
|
<MonoDevelop.Ide.Workbench ActiveDocument="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="TestPet.cs" Line="23" Column="17" />
|
<File FileName="TestPet.cs" Line="1" Column="1" />
|
||||||
<File FileName="TestOrder.cs" Line="1" Column="1" />
|
<File FileName="TestOrder.cs" Line="1" Column="1" />
|
||||||
|
<File FileName="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs" Line="1" Column="1" />
|
||||||
|
<File FileName="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs" Line="18" Column="50" />
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
25
samples/client/petstore/go/swagger/Configuration.go
Normal file
25
samples/client/petstore/go/swagger/Configuration.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
type Configuration struct {
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
ApiKey string `json:"apiKey,omitempty"`
|
||||||
|
Debug bool `json:"debug,omitempty"`
|
||||||
|
DebugFile string `json:"debugFile,omitempty"`
|
||||||
|
OAuthToken string `json:"oAuthToken,omitempty"`
|
||||||
|
Timeout int `json:"timeout,omitempty"`
|
||||||
|
BasePath string `json:"basePath,omitempty"`
|
||||||
|
Host string `json:"host,omitempty"`
|
||||||
|
Scheme string `json:"scheme,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewConfiguration() *Configuration {
|
||||||
|
return &Configuration{
|
||||||
|
BasePath: "http://petstore.swagger.io/v2",
|
||||||
|
UserName: "",
|
||||||
|
Debug: false,
|
||||||
|
}
|
||||||
|
}
|
@ -1,29 +1,36 @@
|
|||||||
package swagger
|
package swagger
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/dghubble/sling"
|
"github.com/dghubble/sling"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type PetApi struct {
|
type PetApi struct {
|
||||||
basePath string
|
Configuration Configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPetApi() *PetApi{
|
func NewPetApi() *PetApi{
|
||||||
|
configuration := NewConfiguration()
|
||||||
return &PetApi {
|
return &PetApi {
|
||||||
basePath: "http://petstore.swagger.io/v2",
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPetApiWithBasePath(basePath string) *PetApi{
|
func NewPetApiWithBasePath(basePath string) *PetApi{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
return &PetApi {
|
return &PetApi {
|
||||||
basePath: basePath,
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
@ -33,13 +40,15 @@ func NewPetApiWithBasePath(basePath string) *PetApi{
|
|||||||
//func (a PetApi) AddPet (body Pet) (error) {
|
//func (a PetApi) AddPet (body Pet) (error) {
|
||||||
func (a PetApi) AddPet (body Pet) (error) {
|
func (a PetApi) AddPet (body Pet) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets"
|
path := "/v2/pets"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -47,6 +56,7 @@ func (a PetApi) AddPet (body Pet) (error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -84,6 +94,7 @@ func (a PetApi) AddPet (body Pet) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a pet
|
* Deletes a pet
|
||||||
*
|
*
|
||||||
@ -94,14 +105,16 @@ func (a PetApi) AddPet (body Pet) (error) {
|
|||||||
//func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
//func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
||||||
func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Delete(a.basePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets/{petId}"
|
path := "/v2/pets/{petId}"
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -114,6 +127,7 @@ func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
// response (error) models, which needs to be implemented at some point.
|
// response (error) models, which needs to be implemented at some point.
|
||||||
@ -146,6 +160,7 @@ func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma seperated strings
|
* Multiple status values can be provided with comma seperated strings
|
||||||
@ -155,11 +170,12 @@ func (a PetApi) DeletePet (apiKey string, petId int64) (error) {
|
|||||||
//func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
//func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
||||||
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets/findByStatus"
|
path := "/v2/pets/findByStatus"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
type QueryParams struct {
|
type QueryParams struct {
|
||||||
@ -167,6 +183,7 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
_sling = _sling.QueryStruct(&QueryParams{ status: status })
|
_sling = _sling.QueryStruct(&QueryParams{ status: status })
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -175,6 +192,7 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var successPayload = new([]Pet)
|
var successPayload = new([]Pet)
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
@ -209,6 +227,7 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
@ -218,11 +237,12 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
|||||||
//func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
//func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
||||||
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets/findByTags"
|
path := "/v2/pets/findByTags"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
type QueryParams struct {
|
type QueryParams struct {
|
||||||
@ -230,6 +250,7 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
_sling = _sling.QueryStruct(&QueryParams{ tags: tags })
|
_sling = _sling.QueryStruct(&QueryParams{ tags: tags })
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -238,6 +259,7 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var successPayload = new([]Pet)
|
var successPayload = new([]Pet)
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
@ -272,6 +294,7 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find pet by ID
|
* Find pet by ID
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
@ -281,14 +304,16 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
|||||||
//func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
//func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
||||||
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets/{petId}"
|
path := "/v2/pets/{petId}"
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -297,6 +322,7 @@ func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var successPayload = new(Pet)
|
var successPayload = new(Pet)
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
@ -331,6 +357,7 @@ func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
*
|
*
|
||||||
@ -340,13 +367,15 @@ func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
|||||||
//func (a PetApi) UpdatePet (body Pet) (error) {
|
//func (a PetApi) UpdatePet (body Pet) (error) {
|
||||||
func (a PetApi) UpdatePet (body Pet) (error) {
|
func (a PetApi) UpdatePet (body Pet) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Put(a.basePath)
|
_sling := sling.New().Put(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets"
|
path := "/v2/pets"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -354,6 +383,7 @@ func (a PetApi) UpdatePet (body Pet) (error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -391,6 +421,7 @@ func (a PetApi) UpdatePet (body Pet) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a pet in the store with form data
|
* Updates a pet in the store with form data
|
||||||
*
|
*
|
||||||
@ -402,14 +433,16 @@ func (a PetApi) UpdatePet (body Pet) (error) {
|
|||||||
//func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (error) {
|
//func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (error) {
|
||||||
func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (error) {
|
func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/pets/{petId}"
|
path := "/v2/pets/{petId}"
|
||||||
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -420,11 +453,13 @@ func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (er
|
|||||||
type FormParams struct {
|
type FormParams struct {
|
||||||
name string `url:"name,omitempty"`
|
name string `url:"name,omitempty"`
|
||||||
status string `url:"status,omitempty"`
|
status string `url:"status,omitempty"`
|
||||||
|
|
||||||
}
|
}
|
||||||
_sling = _sling.BodyForm(&FormParams{ name: name,status: status })
|
_sling = _sling.BodyForm(&FormParams{ name: name,status: status })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
// response (error) models, which needs to be implemented at some point.
|
// response (error) models, which needs to be implemented at some point.
|
||||||
@ -457,3 +492,5 @@ func (a PetApi) UpdatePetWithForm (petId string, name string, status string) (er
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,29 +1,36 @@
|
|||||||
package swagger
|
package swagger
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/dghubble/sling"
|
"github.com/dghubble/sling"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type StoreApi struct {
|
type StoreApi struct {
|
||||||
basePath string
|
Configuration Configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStoreApi() *StoreApi{
|
func NewStoreApi() *StoreApi{
|
||||||
|
configuration := NewConfiguration()
|
||||||
return &StoreApi {
|
return &StoreApi {
|
||||||
basePath: "http://petstore.swagger.io/v2",
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStoreApiWithBasePath(basePath string) *StoreApi{
|
func NewStoreApiWithBasePath(basePath string) *StoreApi{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
return &StoreApi {
|
return &StoreApi {
|
||||||
basePath: basePath,
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete purchase order by ID
|
* Delete purchase order by ID
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
@ -33,14 +40,16 @@ func NewStoreApiWithBasePath(basePath string) *StoreApi{
|
|||||||
//func (a StoreApi) DeleteOrder (orderId string) (error) {
|
//func (a StoreApi) DeleteOrder (orderId string) (error) {
|
||||||
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Delete(a.basePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/stores/order/{orderId}"
|
path := "/v2/stores/order/{orderId}"
|
||||||
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1)
|
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -51,6 +60,7 @@ func (a StoreApi) DeleteOrder (orderId string) (error) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
// response (error) models, which needs to be implemented at some point.
|
// response (error) models, which needs to be implemented at some point.
|
||||||
@ -83,6 +93,7 @@ func (a StoreApi) DeleteOrder (orderId string) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find purchase order by ID
|
* Find purchase order by ID
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
@ -92,14 +103,16 @@ func (a StoreApi) DeleteOrder (orderId string) (error) {
|
|||||||
//func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
//func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
||||||
func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/stores/order/{orderId}"
|
path := "/v2/stores/order/{orderId}"
|
||||||
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1)
|
path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -108,6 +121,7 @@ func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var successPayload = new(Order)
|
var successPayload = new(Order)
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
@ -142,6 +156,7 @@ func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
@ -151,13 +166,15 @@ func (a StoreApi) GetOrderById (orderId string) (Order, error) {
|
|||||||
//func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
//func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
||||||
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/stores/order"
|
path := "/v2/stores/order"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -165,6 +182,7 @@ func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -202,3 +220,5 @@ func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,29 +1,36 @@
|
|||||||
package swagger
|
package swagger
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/dghubble/sling"
|
"github.com/dghubble/sling"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserApi struct {
|
type UserApi struct {
|
||||||
basePath string
|
Configuration Configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserApi() *UserApi{
|
func NewUserApi() *UserApi{
|
||||||
|
configuration := NewConfiguration()
|
||||||
return &UserApi {
|
return &UserApi {
|
||||||
basePath: "http://petstore.swagger.io/v2",
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserApiWithBasePath(basePath string) *UserApi{
|
func NewUserApiWithBasePath(basePath string) *UserApi{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
return &UserApi {
|
return &UserApi {
|
||||||
basePath: basePath,
|
Configuration: *configuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create user
|
* Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -33,13 +40,15 @@ func NewUserApiWithBasePath(basePath string) *UserApi{
|
|||||||
//func (a UserApi) CreateUser (body User) (error) {
|
//func (a UserApi) CreateUser (body User) (error) {
|
||||||
func (a UserApi) CreateUser (body User) (error) {
|
func (a UserApi) CreateUser (body User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users"
|
path := "/v2/users"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -47,6 +56,7 @@ func (a UserApi) CreateUser (body User) (error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -84,6 +94,7 @@ func (a UserApi) CreateUser (body User) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
@ -93,13 +104,15 @@ func (a UserApi) CreateUser (body User) (error) {
|
|||||||
//func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
//func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
||||||
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/createWithArray"
|
path := "/v2/users/createWithArray"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -107,6 +120,7 @@ func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -144,6 +158,7 @@ func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
@ -153,13 +168,15 @@ func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
|||||||
//func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
//func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
||||||
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Post(a.basePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/createWithList"
|
path := "/v2/users/createWithList"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -167,6 +184,7 @@ func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -204,6 +222,7 @@ func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete user
|
* Delete user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -213,14 +232,16 @@ func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
|||||||
//func (a UserApi) DeleteUser (username string) (error) {
|
//func (a UserApi) DeleteUser (username string) (error) {
|
||||||
func (a UserApi) DeleteUser (username string) (error) {
|
func (a UserApi) DeleteUser (username string) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Delete(a.basePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/{username}"
|
path := "/v2/users/{username}"
|
||||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -231,6 +252,7 @@ func (a UserApi) DeleteUser (username string) (error) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
// response (error) models, which needs to be implemented at some point.
|
// response (error) models, which needs to be implemented at some point.
|
||||||
@ -263,6 +285,7 @@ func (a UserApi) DeleteUser (username string) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get user by user name
|
* Get user by user name
|
||||||
*
|
*
|
||||||
@ -272,14 +295,16 @@ func (a UserApi) DeleteUser (username string) (error) {
|
|||||||
//func (a UserApi) GetUserByName (username string) (User, error) {
|
//func (a UserApi) GetUserByName (username string) (User, error) {
|
||||||
func (a UserApi) GetUserByName (username string) (User, error) {
|
func (a UserApi) GetUserByName (username string) (User, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/{username}"
|
path := "/v2/users/{username}"
|
||||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -288,6 +313,7 @@ func (a UserApi) GetUserByName (username string) (User, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var successPayload = new(User)
|
var successPayload = new(User)
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
@ -322,6 +348,7 @@ func (a UserApi) GetUserByName (username string) (User, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs user into the system
|
* Logs user into the system
|
||||||
*
|
*
|
||||||
@ -332,11 +359,12 @@ func (a UserApi) GetUserByName (username string) (User, error) {
|
|||||||
//func (a UserApi) LoginUser (username string, password string) (string, error) {
|
//func (a UserApi) LoginUser (username string, password string) (string, error) {
|
||||||
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/login"
|
path := "/v2/users/login"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
type QueryParams struct {
|
type QueryParams struct {
|
||||||
@ -345,6 +373,7 @@ func (a UserApi) LoginUser (username string, password string) (string, error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
_sling = _sling.QueryStruct(&QueryParams{ username: username,password: password })
|
_sling = _sling.QueryStruct(&QueryParams{ username: username,password: password })
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -353,6 +382,7 @@ func (a UserApi) LoginUser (username string, password string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var successPayload = new(string)
|
var successPayload = new(string)
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
@ -387,6 +417,7 @@ func (a UserApi) LoginUser (username string, password string) (string, error) {
|
|||||||
|
|
||||||
return *successPayload, err
|
return *successPayload, err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs out current logged in user session
|
* Logs out current logged in user session
|
||||||
*
|
*
|
||||||
@ -395,13 +426,15 @@ func (a UserApi) LoginUser (username string, password string) (string, error) {
|
|||||||
//func (a UserApi) LogoutUser () (error) {
|
//func (a UserApi) LogoutUser () (error) {
|
||||||
func (a UserApi) LogoutUser () (error) {
|
func (a UserApi) LogoutUser () (error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.basePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/logout"
|
path := "/v2/users/logout"
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -412,6 +445,7 @@ func (a UserApi) LogoutUser () (error) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// We use this map (below) so that any arbitrary error JSON can be handled.
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
// response (error) models, which needs to be implemented at some point.
|
// response (error) models, which needs to be implemented at some point.
|
||||||
@ -444,6 +478,7 @@ func (a UserApi) LogoutUser () (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updated user
|
* Updated user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -454,14 +489,16 @@ func (a UserApi) LogoutUser () (error) {
|
|||||||
//func (a UserApi) UpdateUser (username string, body User) (error) {
|
//func (a UserApi) UpdateUser (username string, body User) (error) {
|
||||||
func (a UserApi) UpdateUser (username string, body User) (error) {
|
func (a UserApi) UpdateUser (username string, body User) (error) {
|
||||||
|
|
||||||
_sling := sling.New().Put(a.basePath)
|
_sling := sling.New().Put(a.Configuration.BasePath)
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := "/v2/users/{username}"
|
path := "/v2/users/{username}"
|
||||||
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1)
|
||||||
|
|
||||||
|
|
||||||
_sling = _sling.Path(path)
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
|
||||||
// accept header
|
// accept header
|
||||||
accepts := []string { "application/json", "application/xml" }
|
accepts := []string { "application/json", "application/xml" }
|
||||||
for key := range accepts {
|
for key := range accepts {
|
||||||
@ -469,6 +506,7 @@ func (a UserApi) UpdateUser (username string, body User) (error) {
|
|||||||
break // only use the first Accept
|
break // only use the first Accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// body params
|
// body params
|
||||||
_sling = _sling.BodyJSON(body)
|
_sling = _sling.BodyJSON(body)
|
||||||
|
|
||||||
@ -506,3 +544,5 @@ func (a UserApi) UpdateUser (username string, body User) (error) {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,6 +46,10 @@ if(hasProperty('target') && target == 'android') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
provided 'javax.annotation:jsr250-api:1.0'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
@ -1,20 +1,200 @@
|
|||||||
# SwaggerClient
|
# SwaggerClient
|
||||||
|
|
||||||
|
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||||
|
|
||||||
|
This ObjC package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version:
|
||||||
|
- Build date: 2016-04-05T23:29:02.396+08:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
The API client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
|
The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project.
|
||||||
|
|
||||||
## Installation
|
## Installation & Usage
|
||||||
|
### Install from Github using [CocoaPods](https://cocoapods.org/)
|
||||||
|
|
||||||
To install it, put the API client library in your project and then simply add the following line to your Podfile:
|
Add the following to the Podfile:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
pod "SwaggerClient", :path => "/path/to/lib"
|
pod 'SwaggerClient', :git => 'https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git'
|
||||||
|
```
|
||||||
|
|
||||||
|
To specify a particular branch, append `, :branch => 'branch-name-here'`
|
||||||
|
|
||||||
|
To specify a particular commit, append `, :commit => '11aa22'`
|
||||||
|
|
||||||
|
### Install from local path using [CocoaPods](https://cocoapods.org/)
|
||||||
|
|
||||||
|
Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
pod 'SwaggerClient', :path => 'Vendor/SwaggerClient'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Import the following:
|
||||||
|
```objc
|
||||||
|
#import <SwaggerClient/SWGApiClient.h>
|
||||||
|
#import <SwaggerClient/SWGConfiguration.h>
|
||||||
|
// load models
|
||||||
|
#import <SwaggerClient/SWG200Response.h>
|
||||||
|
#import <SwaggerClient/SWGAnimal.h>
|
||||||
|
#import <SwaggerClient/SWGCat.h>
|
||||||
|
#import <SwaggerClient/SWGCategory.h>
|
||||||
|
#import <SwaggerClient/SWGDog.h>
|
||||||
|
#import <SwaggerClient/SWGInlineResponse200.h>
|
||||||
|
#import <SwaggerClient/SWGName.h>
|
||||||
|
#import <SwaggerClient/SWGOrder.h>
|
||||||
|
#import <SwaggerClient/SWGPet.h>
|
||||||
|
#import <SwaggerClient/SWGReturn.h>
|
||||||
|
#import <SwaggerClient/SWGSpecialModelName_.h>
|
||||||
|
#import <SwaggerClient/SWGTag.h>
|
||||||
|
#import <SwaggerClient/SWGUser.h>
|
||||||
|
// load API classes for accessing endpoints
|
||||||
|
#import <SwaggerClient/SWGPetApi.h>
|
||||||
|
#import <SwaggerClient/SWGStoreApi.h>
|
||||||
|
#import <SwaggerClient/SWGUserApi.h>
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Recommendation
|
## Recommendation
|
||||||
|
|
||||||
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issue.
|
It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
|
```objc
|
||||||
|
|
||||||
|
SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
|
||||||
|
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||||
|
|
||||||
|
|
||||||
|
SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
|
@try
|
||||||
|
{
|
||||||
|
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
|
||||||
|
|
||||||
|
// Add a new pet to the store
|
||||||
|
[apiInstance addPetWithBody:body
|
||||||
|
completionHandler: ^(NSError* error)) {
|
||||||
|
if (error) {
|
||||||
|
NSLog(@"Error: %@", error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
@catch (NSException *exception)
|
||||||
|
{
|
||||||
|
NSLog(@"Exception when calling SWGPetApi->addPet: %@ ", exception.name);
|
||||||
|
NSLog(@"Reason: %@ ", exception.reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*SWGPetApi* | [**addPetUsingByteArray**](docs/SWGPetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*SWGPetApi* | [**getPetByIdInObject**](docs/SWGPetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
*SWGPetApi* | [**petPetIdtestingByteArraytrueGet**](docs/SWGPetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
|
*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*SWGStoreApi* | [**findOrdersByStatus**](docs/SWGStoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status
|
||||||
|
*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*SWGStoreApi* | [**getInventoryInObject**](docs/SWGStoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||||
|
*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user
|
||||||
|
*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
|
||||||
|
*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
|
||||||
|
*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system
|
||||||
|
*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [SWG200Response](docs/SWG200Response.md)
|
||||||
|
- [SWGAnimal](docs/SWGAnimal.md)
|
||||||
|
- [SWGCat](docs/SWGCat.md)
|
||||||
|
- [SWGCategory](docs/SWGCategory.md)
|
||||||
|
- [SWGDog](docs/SWGDog.md)
|
||||||
|
- [SWGInlineResponse200](docs/SWGInlineResponse200.md)
|
||||||
|
- [SWGName](docs/SWGName.md)
|
||||||
|
- [SWGOrder](docs/SWGOrder.md)
|
||||||
|
- [SWGPet](docs/SWGPet.md)
|
||||||
|
- [SWGReturn](docs/SWGReturn.md)
|
||||||
|
- [SWGSpecialModelName_](docs/SWGSpecialModelName_.md)
|
||||||
|
- [SWGTag](docs/SWGTag.md)
|
||||||
|
- [SWGUser](docs/SWGUser.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
## test_api_key_header
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: test_api_key_header
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_http_basic
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
## test_api_client_secret
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_secret
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_api_client_id
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_id
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_api_key_query
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: test_api_key_query
|
||||||
|
- **Location**: URL query string
|
||||||
|
|
||||||
|
## petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
|
@ -13,7 +13,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import "SWG200Response.h"
|
#import "SWG200Response.h"
|
||||||
|
#import "SWGAnimal.h"
|
||||||
|
#import "SWGCat.h"
|
||||||
#import "SWGCategory.h"
|
#import "SWGCategory.h"
|
||||||
|
#import "SWGDog.h"
|
||||||
#import "SWGInlineResponse200.h"
|
#import "SWGInlineResponse200.h"
|
||||||
#import "SWGName.h"
|
#import "SWGName.h"
|
||||||
#import "SWGOrder.h"
|
#import "SWGOrder.h"
|
||||||
@ -81,7 +84,7 @@ extern NSString *const SWGResponseObjectErrorKey;
|
|||||||
+(bool) getOfflineState;
|
+(bool) getOfflineState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the client reachability, this may be override by the reachability manager if reachability changes
|
* Sets the client reachability, this may be overridden by the reachability manager if reachability changes
|
||||||
*
|
*
|
||||||
* @param The client reachability.
|
* @param The client reachability.
|
||||||
*/
|
*/
|
||||||
|
@ -716,11 +716,11 @@ static void (^reachabilityChangeBlock)(int);
|
|||||||
for (NSString *auth in authSettings) {
|
for (NSString *auth in authSettings) {
|
||||||
NSDictionary *authSetting = [[config authSettings] objectForKey:auth];
|
NSDictionary *authSetting = [[config authSettings] objectForKey:auth];
|
||||||
|
|
||||||
if (authSetting) {
|
if (authSetting) { // auth setting is set only if the key is non-empty
|
||||||
if ([authSetting[@"in"] isEqualToString:@"header"]) {
|
if ([authSetting[@"in"] isEqualToString:@"header"] && [authSetting[@"key"] length] != 0) {
|
||||||
[headersWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
[headersWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
||||||
}
|
}
|
||||||
else if ([authSetting[@"in"] isEqualToString:@"query"]) {
|
else if ([authSetting[@"in"] isEqualToString:@"query"] && [authSetting[@"key"] length] != 0) {
|
||||||
[querysWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
[querysWithAuth setObject:authSetting[@"value"] forKey:authSetting[@"key"]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,11 @@
|
|||||||
*/
|
*/
|
||||||
@property (nonatomic) NSString *password;
|
@property (nonatomic) NSString *password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access token for OAuth
|
||||||
|
*/
|
||||||
|
@property (nonatomic) NSString *accessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temp folder for file download
|
* Temp folder for file download
|
||||||
*/
|
*/
|
||||||
@ -132,6 +137,11 @@
|
|||||||
*/
|
*/
|
||||||
- (NSString *) getBasicAuthToken;
|
- (NSString *) getBasicAuthToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets OAuth access token
|
||||||
|
*/
|
||||||
|
- (NSString *) getAccessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets Authentication Setings
|
* Gets Authentication Setings
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
self.host = @"http://petstore.swagger.io/v2";
|
self.host = @"http://petstore.swagger.io/v2";
|
||||||
self.username = @"";
|
self.username = @"";
|
||||||
self.password = @"";
|
self.password = @"";
|
||||||
|
self.accessToken= @"";
|
||||||
self.tempFolderPath = nil;
|
self.tempFolderPath = nil;
|
||||||
self.debug = NO;
|
self.debug = NO;
|
||||||
self.verifySSL = YES;
|
self.verifySSL = YES;
|
||||||
@ -42,18 +43,23 @@
|
|||||||
#pragma mark - Instance Methods
|
#pragma mark - Instance Methods
|
||||||
|
|
||||||
- (NSString *) getApiKeyWithPrefix:(NSString *)key {
|
- (NSString *) getApiKeyWithPrefix:(NSString *)key {
|
||||||
if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key]) {
|
if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key] != (id)[NSNull null] && [[self.apiKey objectForKey:key] length] != 0) { // both api key prefix and api key are set
|
||||||
return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]];
|
return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]];
|
||||||
}
|
}
|
||||||
else if ([self.apiKey objectForKey:key]) {
|
else if ([self.apiKey objectForKey:key] != (id)[NSNull null] && [[self.apiKey objectForKey:key] length] != 0) { // only api key, no api key prefix
|
||||||
return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]];
|
return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]];
|
||||||
}
|
}
|
||||||
else {
|
else { // return empty string if nothing is set
|
||||||
return @"";
|
return @"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) getBasicAuthToken {
|
- (NSString *) getBasicAuthToken {
|
||||||
|
// return empty string if username and password are empty
|
||||||
|
if (self.username.length == 0 && self.password.length == 0){
|
||||||
|
return @"";
|
||||||
|
}
|
||||||
|
|
||||||
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password];
|
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password];
|
||||||
NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]];
|
basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]];
|
||||||
@ -61,6 +67,15 @@
|
|||||||
return basicAuthCredentials;
|
return basicAuthCredentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) getAccessToken {
|
||||||
|
if (self.accessToken.length == 0) { // token not set, return empty string
|
||||||
|
return @"";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [NSString stringWithFormat:@"BEARER %@", self.accessToken];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Setter Methods
|
#pragma mark - Setter Methods
|
||||||
|
|
||||||
- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier {
|
- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier {
|
||||||
@ -149,6 +164,13 @@
|
|||||||
@"key": @"test_api_key_query",
|
@"key": @"test_api_key_query",
|
||||||
@"value": [self getApiKeyWithPrefix:@"test_api_key_query"]
|
@"value": [self getApiKeyWithPrefix:@"test_api_key_query"]
|
||||||
},
|
},
|
||||||
|
@"petstore_auth":
|
||||||
|
@{
|
||||||
|
@"type": @"oauth",
|
||||||
|
@"in": @"header",
|
||||||
|
@"key": @"Authorization",
|
||||||
|
@"value": [self getAccessToken]
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-03-30T20:57:56.803+08:00
|
- Build date: 2016-04-09T18:00:55.578+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -80,20 +80,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||||
*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
*StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status
|
*StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status
|
||||||
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||||
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
|
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
|
||||||
|
@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||||
[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||||
[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
@ -7,7 +7,7 @@ Method | HTTP request | Description
|
|||||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
@ -90,7 +90,6 @@ class PetApi
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addPet
|
* addPet
|
||||||
*
|
*
|
||||||
@ -102,7 +101,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function addPet($body = null)
|
public function addPet($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->addPetWithHttpInfo ($body);
|
list($response) = $this->addPetWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,11 +125,11 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml'));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -156,7 +155,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -166,7 +164,6 @@ class PetApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -174,7 +171,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addPetUsingByteArray
|
* addPetUsingByteArray
|
||||||
*
|
*
|
||||||
@ -186,7 +182,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function addPetUsingByteArray($body = null)
|
public function addPetUsingByteArray($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->addPetUsingByteArrayWithHttpInfo ($body);
|
list($response) = $this->addPetUsingByteArrayWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,16 +201,16 @@ class PetApi
|
|||||||
|
|
||||||
|
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/pet?testing_byte_array=true";
|
$resourcePath = "/pet?testing_byte_array=true";
|
||||||
$httpBody = '';
|
$httpBody = '';
|
||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml'));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -240,7 +236,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -250,7 +245,6 @@ class PetApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -258,7 +252,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deletePet
|
* deletePet
|
||||||
*
|
*
|
||||||
@ -271,7 +264,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function deletePet($pet_id, $api_key = null)
|
public function deletePet($pet_id, $api_key = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->deletePetWithHttpInfo ($pet_id, $api_key);
|
list($response) = $this->deletePetWithHttpInfo ($pet_id, $api_key);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,20 +293,18 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
// header params
|
// header params
|
||||||
|
|
||||||
if ($api_key !== null) {
|
if ($api_key !== null) {
|
||||||
$headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key);
|
$headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key);
|
||||||
}
|
}
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($pet_id !== null) {
|
if ($pet_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "petId" . "}",
|
"{" . "petId" . "}",
|
||||||
@ -338,7 +329,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -348,7 +338,6 @@ class PetApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -356,7 +345,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findPetsByStatus
|
* findPetsByStatus
|
||||||
*
|
*
|
||||||
@ -368,7 +356,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function findPetsByStatus($status = null)
|
public function findPetsByStatus($status = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->findPetsByStatusWithHttpInfo ($status);
|
list($response) = $this->findPetsByStatusWithHttpInfo ($status);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,18 +380,16 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
|
|
||||||
if (is_array($status)) {
|
if (is_array($status)) {
|
||||||
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true);
|
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($status !== null) {
|
if ($status !== null) {
|
||||||
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
||||||
}
|
}
|
||||||
@ -426,7 +412,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -434,17 +419,15 @@ class PetApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\Pet[]'
|
$headerParams, '\Swagger\Client\Model\Pet[]'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -452,7 +435,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findPetsByTags
|
* findPetsByTags
|
||||||
*
|
*
|
||||||
@ -464,7 +446,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function findPetsByTags($tags = null)
|
public function findPetsByTags($tags = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->findPetsByTagsWithHttpInfo ($tags);
|
list($response) = $this->findPetsByTagsWithHttpInfo ($tags);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,18 +470,16 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
|
|
||||||
if (is_array($tags)) {
|
if (is_array($tags)) {
|
||||||
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true);
|
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tags !== null) {
|
if ($tags !== null) {
|
||||||
$queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags);
|
$queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags);
|
||||||
}
|
}
|
||||||
@ -522,7 +502,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -530,17 +509,15 @@ class PetApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\Pet[]'
|
$headerParams, '\Swagger\Client\Model\Pet[]'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -548,7 +525,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPetById
|
* getPetById
|
||||||
*
|
*
|
||||||
@ -560,7 +536,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function getPetById($pet_id)
|
public function getPetById($pet_id)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->getPetByIdWithHttpInfo ($pet_id);
|
list($response) = $this->getPetByIdWithHttpInfo ($pet_id);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,16 +564,15 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($pet_id !== null) {
|
if ($pet_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "petId" . "}",
|
"{" . "petId" . "}",
|
||||||
@ -629,7 +604,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -637,17 +611,15 @@ class PetApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\Pet'
|
$headerParams, '\Swagger\Client\Model\Pet'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -655,7 +627,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPetByIdInObject
|
* getPetByIdInObject
|
||||||
*
|
*
|
||||||
@ -667,7 +638,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function getPetByIdInObject($pet_id)
|
public function getPetByIdInObject($pet_id)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->getPetByIdInObjectWithHttpInfo ($pet_id);
|
list($response) = $this->getPetByIdInObjectWithHttpInfo ($pet_id);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,21 +661,20 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/pet/{petId}?response=inline_arbitrary_object";
|
$resourcePath = "/pet/{petId}?response=inline_arbitrary_object";
|
||||||
$httpBody = '';
|
$httpBody = '';
|
||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($pet_id !== null) {
|
if ($pet_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "petId" . "}",
|
"{" . "petId" . "}",
|
||||||
@ -736,7 +706,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -744,17 +713,15 @@ class PetApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\InlineResponse200'
|
$headerParams, '\Swagger\Client\Model\InlineResponse200'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -762,7 +729,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* petPetIdtestingByteArraytrueGet
|
* petPetIdtestingByteArraytrueGet
|
||||||
*
|
*
|
||||||
@ -774,7 +740,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function petPetIdtestingByteArraytrueGet($pet_id)
|
public function petPetIdtestingByteArraytrueGet($pet_id)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id);
|
list($response) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,21 +763,20 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/pet/{petId}?testing_byte_array=true";
|
$resourcePath = "/pet/{petId}?testing_byte_array=true";
|
||||||
$httpBody = '';
|
$httpBody = '';
|
||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($pet_id !== null) {
|
if ($pet_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "petId" . "}",
|
"{" . "petId" . "}",
|
||||||
@ -843,7 +808,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -851,17 +815,15 @@ class PetApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, 'string'
|
$headerParams, 'string'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -869,7 +831,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updatePet
|
* updatePet
|
||||||
*
|
*
|
||||||
@ -881,7 +842,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function updatePet($body = null)
|
public function updatePet($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->updatePetWithHttpInfo ($body);
|
list($response) = $this->updatePetWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,11 +866,11 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml'));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -935,7 +896,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -945,7 +905,6 @@ class PetApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -953,7 +912,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updatePetWithForm
|
* updatePetWithForm
|
||||||
*
|
*
|
||||||
@ -967,7 +925,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function updatePetWithForm($pet_id, $name = null, $status = null)
|
public function updatePetWithForm($pet_id, $name = null, $status = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status);
|
list($response) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -997,16 +955,15 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/x-www-form-urlencoded'));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($pet_id !== null) {
|
if ($pet_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "petId" . "}",
|
"{" . "petId" . "}",
|
||||||
@ -1019,16 +976,10 @@ class PetApi
|
|||||||
|
|
||||||
// form params
|
// form params
|
||||||
if ($name !== null) {
|
if ($name !== null) {
|
||||||
|
|
||||||
|
|
||||||
$formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name);
|
$formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name);
|
||||||
|
|
||||||
}// form params
|
}// form params
|
||||||
if ($status !== null) {
|
if ($status !== null) {
|
||||||
|
|
||||||
|
|
||||||
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
|
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1043,7 +994,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -1053,7 +1003,6 @@ class PetApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -1061,7 +1010,6 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploadFile
|
* uploadFile
|
||||||
*
|
*
|
||||||
@ -1075,7 +1023,7 @@ class PetApi
|
|||||||
*/
|
*/
|
||||||
public function uploadFile($pet_id, $additional_metadata = null, $file = null)
|
public function uploadFile($pet_id, $additional_metadata = null, $file = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file);
|
list($response) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,16 +1053,15 @@ class PetApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('multipart/form-data'));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('multipart/form-data'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($pet_id !== null) {
|
if ($pet_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "petId" . "}",
|
"{" . "petId" . "}",
|
||||||
@ -1127,13 +1074,9 @@ class PetApi
|
|||||||
|
|
||||||
// form params
|
// form params
|
||||||
if ($additional_metadata !== null) {
|
if ($additional_metadata !== null) {
|
||||||
|
|
||||||
|
|
||||||
$formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata);
|
$formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata);
|
||||||
|
|
||||||
}// form params
|
}// form params
|
||||||
if ($file !== null) {
|
if ($file !== null) {
|
||||||
|
|
||||||
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
|
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
|
||||||
// See: https://wiki.php.net/rfc/curl-file-upload
|
// See: https://wiki.php.net/rfc/curl-file-upload
|
||||||
if (function_exists('curl_file_create')) {
|
if (function_exists('curl_file_create')) {
|
||||||
@ -1141,8 +1084,6 @@ class PetApi
|
|||||||
} else {
|
} else {
|
||||||
$formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file);
|
$formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1157,7 +1098,6 @@ class PetApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -1167,7 +1107,6 @@ class PetApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -1175,5 +1114,4 @@ class PetApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,6 @@ class StoreApi
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deleteOrder
|
* deleteOrder
|
||||||
*
|
*
|
||||||
@ -102,7 +101,7 @@ class StoreApi
|
|||||||
*/
|
*/
|
||||||
public function deleteOrder($order_id)
|
public function deleteOrder($order_id)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->deleteOrderWithHttpInfo ($order_id);
|
list($response) = $this->deleteOrderWithHttpInfo ($order_id);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,16 +129,15 @@ class StoreApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($order_id !== null) {
|
if ($order_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "orderId" . "}",
|
"{" . "orderId" . "}",
|
||||||
@ -159,7 +157,6 @@ class StoreApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -169,7 +166,6 @@ class StoreApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -177,7 +173,6 @@ class StoreApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findOrdersByStatus
|
* findOrdersByStatus
|
||||||
*
|
*
|
||||||
@ -189,7 +184,7 @@ class StoreApi
|
|||||||
*/
|
*/
|
||||||
public function findOrdersByStatus($status = null)
|
public function findOrdersByStatus($status = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->findOrdersByStatusWithHttpInfo ($status);
|
list($response) = $this->findOrdersByStatusWithHttpInfo ($status);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,14 +208,13 @@ class StoreApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
|
|
||||||
if ($status !== null) {
|
if ($status !== null) {
|
||||||
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
||||||
}
|
}
|
||||||
@ -252,7 +246,6 @@ class StoreApi
|
|||||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -260,17 +253,15 @@ class StoreApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\Order[]'
|
$headerParams, '\Swagger\Client\Model\Order[]'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order[]', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order[]', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -278,7 +269,6 @@ class StoreApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getInventory
|
* getInventory
|
||||||
*
|
*
|
||||||
@ -289,7 +279,7 @@ class StoreApi
|
|||||||
*/
|
*/
|
||||||
public function getInventory()
|
public function getInventory()
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->getInventoryWithHttpInfo ();
|
list($response) = $this->getInventoryWithHttpInfo ();
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,11 +302,11 @@ class StoreApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -340,7 +330,6 @@ class StoreApi
|
|||||||
$headerParams['api_key'] = $apiKey;
|
$headerParams['api_key'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -348,17 +337,15 @@ class StoreApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, 'map[string,int]'
|
$headerParams, 'map[string,int]'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -366,7 +353,6 @@ class StoreApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getInventoryInObject
|
* getInventoryInObject
|
||||||
*
|
*
|
||||||
@ -377,7 +363,7 @@ class StoreApi
|
|||||||
*/
|
*/
|
||||||
public function getInventoryInObject()
|
public function getInventoryInObject()
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->getInventoryInObjectWithHttpInfo ();
|
list($response) = $this->getInventoryInObjectWithHttpInfo ();
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,16 +381,16 @@ class StoreApi
|
|||||||
|
|
||||||
|
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/store/inventory?response=arbitrary_object";
|
$resourcePath = "/store/inventory?response=arbitrary_object";
|
||||||
$httpBody = '';
|
$httpBody = '';
|
||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -428,7 +414,6 @@ class StoreApi
|
|||||||
$headerParams['api_key'] = $apiKey;
|
$headerParams['api_key'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -436,17 +421,15 @@ class StoreApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, 'object'
|
$headerParams, 'object'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -454,7 +437,6 @@ class StoreApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getOrderById
|
* getOrderById
|
||||||
*
|
*
|
||||||
@ -466,7 +448,7 @@ class StoreApi
|
|||||||
*/
|
*/
|
||||||
public function getOrderById($order_id)
|
public function getOrderById($order_id)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->getOrderByIdWithHttpInfo ($order_id);
|
list($response) = $this->getOrderByIdWithHttpInfo ($order_id);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,16 +476,15 @@ class StoreApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($order_id !== null) {
|
if ($order_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "orderId" . "}",
|
"{" . "orderId" . "}",
|
||||||
@ -537,7 +518,6 @@ class StoreApi
|
|||||||
$queryParams['test_api_key_query'] = $apiKey;
|
$queryParams['test_api_key_query'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -545,17 +525,15 @@ class StoreApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\Order'
|
$headerParams, '\Swagger\Client\Model\Order'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -563,7 +541,6 @@ class StoreApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* placeOrder
|
* placeOrder
|
||||||
*
|
*
|
||||||
@ -575,7 +552,7 @@ class StoreApi
|
|||||||
*/
|
*/
|
||||||
public function placeOrder($body = null)
|
public function placeOrder($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->placeOrderWithHttpInfo ($body);
|
list($response) = $this->placeOrderWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,11 +576,11 @@ class StoreApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -638,7 +615,6 @@ class StoreApi
|
|||||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -646,17 +622,15 @@ class StoreApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\Order'
|
$headerParams, '\Swagger\Client\Model\Order'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -664,5 +638,4 @@ class StoreApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,6 @@ class UserApi
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createUser
|
* createUser
|
||||||
*
|
*
|
||||||
@ -102,7 +101,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function createUser($body = null)
|
public function createUser($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->createUserWithHttpInfo ($body);
|
list($response) = $this->createUserWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,11 +125,11 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -151,7 +150,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -161,7 +159,6 @@ class UserApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -169,7 +166,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createUsersWithArrayInput
|
* createUsersWithArrayInput
|
||||||
*
|
*
|
||||||
@ -181,7 +177,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function createUsersWithArrayInput($body = null)
|
public function createUsersWithArrayInput($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->createUsersWithArrayInputWithHttpInfo ($body);
|
list($response) = $this->createUsersWithArrayInputWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,11 +201,11 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -230,7 +226,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -240,7 +235,6 @@ class UserApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -248,7 +242,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createUsersWithListInput
|
* createUsersWithListInput
|
||||||
*
|
*
|
||||||
@ -260,7 +253,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function createUsersWithListInput($body = null)
|
public function createUsersWithListInput($body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->createUsersWithListInputWithHttpInfo ($body);
|
list($response) = $this->createUsersWithListInputWithHttpInfo ($body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,11 +277,11 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -309,7 +302,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -319,7 +311,6 @@ class UserApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -327,7 +318,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deleteUser
|
* deleteUser
|
||||||
*
|
*
|
||||||
@ -339,7 +329,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function deleteUser($username)
|
public function deleteUser($username)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->deleteUserWithHttpInfo ($username);
|
list($response) = $this->deleteUserWithHttpInfo ($username);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,16 +357,15 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($username !== null) {
|
if ($username !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "username" . "}",
|
"{" . "username" . "}",
|
||||||
@ -401,7 +390,6 @@ class UserApi
|
|||||||
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
|
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
|
||||||
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
|
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -411,7 +399,6 @@ class UserApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -419,7 +406,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getUserByName
|
* getUserByName
|
||||||
*
|
*
|
||||||
@ -431,7 +417,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function getUserByName($username)
|
public function getUserByName($username)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->getUserByNameWithHttpInfo ($username);
|
list($response) = $this->getUserByNameWithHttpInfo ($username);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,16 +445,15 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($username !== null) {
|
if ($username !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "username" . "}",
|
"{" . "username" . "}",
|
||||||
@ -488,7 +473,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -496,17 +480,15 @@ class UserApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, '\Swagger\Client\Model\User'
|
$headerParams, '\Swagger\Client\Model\User'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -514,7 +496,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loginUser
|
* loginUser
|
||||||
*
|
*
|
||||||
@ -527,7 +508,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function loginUser($username = null, $password = null)
|
public function loginUser($username = null, $password = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->loginUserWithHttpInfo ($username, $password);
|
list($response) = $this->loginUserWithHttpInfo ($username, $password);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -552,18 +533,16 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
|
|
||||||
if ($username !== null) {
|
if ($username !== null) {
|
||||||
$queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username);
|
$queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username);
|
||||||
}// query params
|
}// query params
|
||||||
|
|
||||||
if ($password !== null) {
|
if ($password !== null) {
|
||||||
$queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password);
|
$queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password);
|
||||||
}
|
}
|
||||||
@ -581,7 +560,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -589,17 +567,15 @@ class UserApi
|
|||||||
$queryParams, $httpBody,
|
$queryParams, $httpBody,
|
||||||
$headerParams, 'string'
|
$headerParams, 'string'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 200:
|
case 200:
|
||||||
$data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
||||||
$e->setResponseObject($data);
|
$e->setResponseObject($data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -607,7 +583,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* logoutUser
|
* logoutUser
|
||||||
*
|
*
|
||||||
@ -618,7 +593,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function logoutUser()
|
public function logoutUser()
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->logoutUserWithHttpInfo ();
|
list($response) = $this->logoutUserWithHttpInfo ();
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,11 +616,11 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -662,7 +637,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -672,7 +646,6 @@ class UserApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -680,7 +653,6 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updateUser
|
* updateUser
|
||||||
*
|
*
|
||||||
@ -693,7 +665,7 @@ class UserApi
|
|||||||
*/
|
*/
|
||||||
public function updateUser($username, $body = null)
|
public function updateUser($username, $body = null)
|
||||||
{
|
{
|
||||||
list($response, $statusCode, $httpHeader) = $this->updateUserWithHttpInfo ($username, $body);
|
list($response) = $this->updateUserWithHttpInfo ($username, $body);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,16 +694,15 @@ class UserApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
|
|
||||||
if ($username !== null) {
|
if ($username !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "username" . "}",
|
"{" . "username" . "}",
|
||||||
@ -755,7 +726,6 @@ class UserApi
|
|||||||
} elseif (count($formParams) > 0) {
|
} elseif (count($formParams) > 0) {
|
||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -765,7 +735,6 @@ class UserApi
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array(null, $statusCode, $httpHeader);
|
return array(null, $statusCode, $httpHeader);
|
||||||
|
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
}
|
}
|
||||||
@ -773,5 +742,4 @@ class UserApi
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ class ApiClient
|
|||||||
*
|
*
|
||||||
* @return string Accept (e.g. application/json)
|
* @return string Accept (e.g. application/json)
|
||||||
*/
|
*/
|
||||||
public static function selectHeaderAccept($accept)
|
public function selectHeaderAccept($accept)
|
||||||
{
|
{
|
||||||
if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) {
|
if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) {
|
||||||
return null;
|
return null;
|
||||||
@ -277,7 +277,7 @@ class ApiClient
|
|||||||
*
|
*
|
||||||
* @return string Content-Type (e.g. application/json)
|
* @return string Content-Type (e.g. application/json)
|
||||||
*/
|
*/
|
||||||
public static function selectHeaderContentType($content_type)
|
public function selectHeaderContentType($content_type)
|
||||||
{
|
{
|
||||||
if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) {
|
if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) {
|
||||||
return 'application/json';
|
return 'application/json';
|
||||||
@ -299,9 +299,9 @@ class ApiClient
|
|||||||
{
|
{
|
||||||
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
|
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
|
||||||
$headers = array();
|
$headers = array();
|
||||||
$key = ''; // [+]
|
$key = '';
|
||||||
|
|
||||||
foreach(explode("\n", $raw_headers) as $i => $h)
|
foreach(explode("\n", $raw_headers) as $h)
|
||||||
{
|
{
|
||||||
$h = explode(':', $h, 2);
|
$h = explode(':', $h, 2);
|
||||||
|
|
||||||
@ -311,26 +311,22 @@ class ApiClient
|
|||||||
$headers[$h[0]] = trim($h[1]);
|
$headers[$h[0]] = trim($h[1]);
|
||||||
elseif (is_array($headers[$h[0]]))
|
elseif (is_array($headers[$h[0]]))
|
||||||
{
|
{
|
||||||
// $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); // [-]
|
$headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1])));
|
||||||
// $headers[$h[0]] = $tmp; // [-]
|
|
||||||
$headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); // [+]
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [-]
|
$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));
|
||||||
// $headers[$h[0]] = $tmp; // [-]
|
|
||||||
$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [+]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = $h[0]; // [+]
|
$key = $h[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (substr($h[0], 0, 1) == "\t")
|
||||||
|
$headers[$key] .= "\r\n\t".trim($h[0]);
|
||||||
|
elseif (!$key)
|
||||||
|
$headers[0] = trim($h[0]);trim($h[0]);
|
||||||
}
|
}
|
||||||
else // [+]
|
|
||||||
{ // [+]
|
|
||||||
if (substr($h[0], 0, 1) == "\t") // [+]
|
|
||||||
$headers[$key] .= "\r\n\t".trim($h[0]); // [+]
|
|
||||||
elseif (!$key) // [+]
|
|
||||||
$headers[0] = trim($h[0]);trim($h[0]); // [+]
|
|
||||||
} // [+]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $headers;
|
return $headers;
|
||||||
|
@ -94,14 +94,12 @@ class Animal implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $class_name
|
* $class_name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $class_name;
|
protected $class_name;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -113,7 +111,6 @@ class Animal implements ArrayAccess
|
|||||||
$this->class_name = $data["class_name"];
|
$this->class_name = $data["class_name"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets class_name
|
* Gets class_name
|
||||||
* @return string
|
* @return string
|
||||||
@ -134,7 +131,6 @@ class Animal implements ArrayAccess
|
|||||||
$this->class_name = $class_name;
|
$this->class_name = $class_name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -182,10 +178,10 @@ class Animal implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -94,14 +94,12 @@ class Cat extends Animal implements ArrayAccess
|
|||||||
return parent::getters() + self::$getters;
|
return parent::getters() + self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $declawed
|
* $declawed
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $declawed;
|
protected $declawed;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -113,7 +111,6 @@ class Cat extends Animal implements ArrayAccess
|
|||||||
$this->declawed = $data["declawed"];
|
$this->declawed = $data["declawed"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets declawed
|
* Gets declawed
|
||||||
* @return bool
|
* @return bool
|
||||||
@ -134,7 +131,6 @@ class Cat extends Animal implements ArrayAccess
|
|||||||
$this->declawed = $declawed;
|
$this->declawed = $declawed;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -182,10 +178,10 @@ class Cat extends Animal implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -98,20 +98,17 @@ class Category implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $name
|
* $name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -124,7 +121,6 @@ class Category implements ArrayAccess
|
|||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets id
|
* Gets id
|
||||||
* @return int
|
* @return int
|
||||||
@ -145,7 +141,6 @@ class Category implements ArrayAccess
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name
|
* Gets name
|
||||||
* @return string
|
* @return string
|
||||||
@ -166,7 +161,6 @@ class Category implements ArrayAccess
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -214,10 +208,10 @@ class Category implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -94,14 +94,12 @@ class Dog extends Animal implements ArrayAccess
|
|||||||
return parent::getters() + self::$getters;
|
return parent::getters() + self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $breed
|
* $breed
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $breed;
|
protected $breed;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -113,7 +111,6 @@ class Dog extends Animal implements ArrayAccess
|
|||||||
$this->breed = $data["breed"];
|
$this->breed = $data["breed"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets breed
|
* Gets breed
|
||||||
* @return string
|
* @return string
|
||||||
@ -134,7 +131,6 @@ class Dog extends Animal implements ArrayAccess
|
|||||||
$this->breed = $breed;
|
$this->breed = $breed;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -182,10 +178,10 @@ class Dog extends Animal implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -114,44 +114,37 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $tags
|
* $tags
|
||||||
* @var \Swagger\Client\Model\Tag[]
|
* @var \Swagger\Client\Model\Tag[]
|
||||||
*/
|
*/
|
||||||
protected $tags;
|
protected $tags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $category
|
* $category
|
||||||
* @var object
|
* @var object
|
||||||
*/
|
*/
|
||||||
protected $category;
|
protected $category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $status pet status in the store
|
* $status pet status in the store
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $status;
|
protected $status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $name
|
* $name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $photo_urls
|
* $photo_urls
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $photo_urls;
|
protected $photo_urls;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -168,7 +161,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->photo_urls = $data["photo_urls"];
|
$this->photo_urls = $data["photo_urls"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets tags
|
* Gets tags
|
||||||
* @return \Swagger\Client\Model\Tag[]
|
* @return \Swagger\Client\Model\Tag[]
|
||||||
@ -189,7 +181,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->tags = $tags;
|
$this->tags = $tags;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets id
|
* Gets id
|
||||||
* @return int
|
* @return int
|
||||||
@ -210,7 +201,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets category
|
* Gets category
|
||||||
* @return object
|
* @return object
|
||||||
@ -231,7 +221,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->category = $category;
|
$this->category = $category;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status
|
* Gets status
|
||||||
* @return string
|
* @return string
|
||||||
@ -255,7 +244,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name
|
* Gets name
|
||||||
* @return string
|
* @return string
|
||||||
@ -276,7 +264,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets photo_urls
|
* Gets photo_urls
|
||||||
* @return string[]
|
* @return string[]
|
||||||
@ -297,7 +284,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
$this->photo_urls = $photo_urls;
|
$this->photo_urls = $photo_urls;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -345,10 +331,10 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ use \ArrayAccess;
|
|||||||
* Model200Response Class Doc Comment
|
* Model200Response Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @description
|
* @description Model for testing model name starting with number
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
@ -94,14 +94,12 @@ class Model200Response implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $name
|
* $name
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -113,7 +111,6 @@ class Model200Response implements ArrayAccess
|
|||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name
|
* Gets name
|
||||||
* @return int
|
* @return int
|
||||||
@ -134,7 +131,6 @@ class Model200Response implements ArrayAccess
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -182,10 +178,10 @@ class Model200Response implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ use \ArrayAccess;
|
|||||||
* ModelReturn Class Doc Comment
|
* ModelReturn Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @description
|
* @description Model for testing reserved words
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
@ -94,14 +94,12 @@ class ModelReturn implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $return
|
* $return
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $return;
|
protected $return;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -113,7 +111,6 @@ class ModelReturn implements ArrayAccess
|
|||||||
$this->return = $data["return"];
|
$this->return = $data["return"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets return
|
* Gets return
|
||||||
* @return int
|
* @return int
|
||||||
@ -134,7 +131,6 @@ class ModelReturn implements ArrayAccess
|
|||||||
$this->return = $return;
|
$this->return = $return;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -182,10 +178,10 @@ class ModelReturn implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ use \ArrayAccess;
|
|||||||
* Name Class Doc Comment
|
* Name Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @description
|
* @description Model for testing model name same as property name
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
@ -98,20 +98,17 @@ class Name implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $name
|
* $name
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $snake_case
|
* $snake_case
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $snake_case;
|
protected $snake_case;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -124,7 +121,6 @@ class Name implements ArrayAccess
|
|||||||
$this->snake_case = $data["snake_case"];
|
$this->snake_case = $data["snake_case"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name
|
* Gets name
|
||||||
* @return int
|
* @return int
|
||||||
@ -145,7 +141,6 @@ class Name implements ArrayAccess
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets snake_case
|
* Gets snake_case
|
||||||
* @return int
|
* @return int
|
||||||
@ -166,7 +161,6 @@ class Name implements ArrayAccess
|
|||||||
$this->snake_case = $snake_case;
|
$this->snake_case = $snake_case;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -214,10 +208,10 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -114,44 +114,37 @@ class Order implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $pet_id
|
* $pet_id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $pet_id;
|
protected $pet_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $quantity
|
* $quantity
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $quantity;
|
protected $quantity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $ship_date
|
* $ship_date
|
||||||
* @var \DateTime
|
* @var \DateTime
|
||||||
*/
|
*/
|
||||||
protected $ship_date;
|
protected $ship_date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $status Order Status
|
* $status Order Status
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $status;
|
protected $status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $complete
|
* $complete
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $complete;
|
protected $complete;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -168,7 +161,6 @@ class Order implements ArrayAccess
|
|||||||
$this->complete = $data["complete"];
|
$this->complete = $data["complete"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets id
|
* Gets id
|
||||||
* @return int
|
* @return int
|
||||||
@ -189,7 +181,6 @@ class Order implements ArrayAccess
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets pet_id
|
* Gets pet_id
|
||||||
* @return int
|
* @return int
|
||||||
@ -210,7 +201,6 @@ class Order implements ArrayAccess
|
|||||||
$this->pet_id = $pet_id;
|
$this->pet_id = $pet_id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets quantity
|
* Gets quantity
|
||||||
* @return int
|
* @return int
|
||||||
@ -231,7 +221,6 @@ class Order implements ArrayAccess
|
|||||||
$this->quantity = $quantity;
|
$this->quantity = $quantity;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets ship_date
|
* Gets ship_date
|
||||||
* @return \DateTime
|
* @return \DateTime
|
||||||
@ -252,7 +241,6 @@ class Order implements ArrayAccess
|
|||||||
$this->ship_date = $ship_date;
|
$this->ship_date = $ship_date;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status
|
* Gets status
|
||||||
* @return string
|
* @return string
|
||||||
@ -276,7 +264,6 @@ class Order implements ArrayAccess
|
|||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets complete
|
* Gets complete
|
||||||
* @return bool
|
* @return bool
|
||||||
@ -297,7 +284,6 @@ class Order implements ArrayAccess
|
|||||||
$this->complete = $complete;
|
$this->complete = $complete;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -345,10 +331,10 @@ class Order implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -114,44 +114,37 @@ class Pet implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $category
|
* $category
|
||||||
* @var \Swagger\Client\Model\Category
|
* @var \Swagger\Client\Model\Category
|
||||||
*/
|
*/
|
||||||
protected $category;
|
protected $category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $name
|
* $name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $photo_urls
|
* $photo_urls
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $photo_urls;
|
protected $photo_urls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $tags
|
* $tags
|
||||||
* @var \Swagger\Client\Model\Tag[]
|
* @var \Swagger\Client\Model\Tag[]
|
||||||
*/
|
*/
|
||||||
protected $tags;
|
protected $tags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $status pet status in the store
|
* $status pet status in the store
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $status;
|
protected $status;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -168,7 +161,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->status = $data["status"];
|
$this->status = $data["status"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets id
|
* Gets id
|
||||||
* @return int
|
* @return int
|
||||||
@ -189,7 +181,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets category
|
* Gets category
|
||||||
* @return \Swagger\Client\Model\Category
|
* @return \Swagger\Client\Model\Category
|
||||||
@ -210,7 +201,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->category = $category;
|
$this->category = $category;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name
|
* Gets name
|
||||||
* @return string
|
* @return string
|
||||||
@ -231,7 +221,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets photo_urls
|
* Gets photo_urls
|
||||||
* @return string[]
|
* @return string[]
|
||||||
@ -252,7 +241,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->photo_urls = $photo_urls;
|
$this->photo_urls = $photo_urls;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets tags
|
* Gets tags
|
||||||
* @return \Swagger\Client\Model\Tag[]
|
* @return \Swagger\Client\Model\Tag[]
|
||||||
@ -273,7 +261,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->tags = $tags;
|
$this->tags = $tags;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status
|
* Gets status
|
||||||
* @return string
|
* @return string
|
||||||
@ -297,7 +284,6 @@ class Pet implements ArrayAccess
|
|||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -345,10 +331,10 @@ class Pet implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -94,14 +94,12 @@ class SpecialModelName implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $special_property_name
|
* $special_property_name
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $special_property_name;
|
protected $special_property_name;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -113,7 +111,6 @@ class SpecialModelName implements ArrayAccess
|
|||||||
$this->special_property_name = $data["special_property_name"];
|
$this->special_property_name = $data["special_property_name"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets special_property_name
|
* Gets special_property_name
|
||||||
* @return int
|
* @return int
|
||||||
@ -134,7 +131,6 @@ class SpecialModelName implements ArrayAccess
|
|||||||
$this->special_property_name = $special_property_name;
|
$this->special_property_name = $special_property_name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -182,10 +178,10 @@ class SpecialModelName implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -98,20 +98,17 @@ class Tag implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $name
|
* $name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -124,7 +121,6 @@ class Tag implements ArrayAccess
|
|||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets id
|
* Gets id
|
||||||
* @return int
|
* @return int
|
||||||
@ -145,7 +141,6 @@ class Tag implements ArrayAccess
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name
|
* Gets name
|
||||||
* @return string
|
* @return string
|
||||||
@ -166,7 +161,6 @@ class Tag implements ArrayAccess
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -214,10 +208,10 @@ class Tag implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -122,56 +122,47 @@ class User implements ArrayAccess
|
|||||||
return self::$getters;
|
return self::$getters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $username
|
* $username
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $username;
|
protected $username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $first_name
|
* $first_name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $first_name;
|
protected $first_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $last_name
|
* $last_name
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $last_name;
|
protected $last_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $email
|
* $email
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $email;
|
protected $email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $password
|
* $password
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $password;
|
protected $password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $phone
|
* $phone
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $phone;
|
protected $phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $user_status User Status
|
* $user_status User Status
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $user_status;
|
protected $user_status;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param mixed[] $data Associated array of property value initalizing the model
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
@ -190,7 +181,6 @@ class User implements ArrayAccess
|
|||||||
$this->user_status = $data["user_status"];
|
$this->user_status = $data["user_status"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets id
|
* Gets id
|
||||||
* @return int
|
* @return int
|
||||||
@ -211,7 +201,6 @@ class User implements ArrayAccess
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets username
|
* Gets username
|
||||||
* @return string
|
* @return string
|
||||||
@ -232,7 +221,6 @@ class User implements ArrayAccess
|
|||||||
$this->username = $username;
|
$this->username = $username;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets first_name
|
* Gets first_name
|
||||||
* @return string
|
* @return string
|
||||||
@ -253,7 +241,6 @@ class User implements ArrayAccess
|
|||||||
$this->first_name = $first_name;
|
$this->first_name = $first_name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets last_name
|
* Gets last_name
|
||||||
* @return string
|
* @return string
|
||||||
@ -274,7 +261,6 @@ class User implements ArrayAccess
|
|||||||
$this->last_name = $last_name;
|
$this->last_name = $last_name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets email
|
* Gets email
|
||||||
* @return string
|
* @return string
|
||||||
@ -295,7 +281,6 @@ class User implements ArrayAccess
|
|||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets password
|
* Gets password
|
||||||
* @return string
|
* @return string
|
||||||
@ -316,7 +301,6 @@ class User implements ArrayAccess
|
|||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets phone
|
* Gets phone
|
||||||
* @return string
|
* @return string
|
||||||
@ -337,7 +321,6 @@ class User implements ArrayAccess
|
|||||||
$this->phone = $phone;
|
$this->phone = $phone;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets user_status
|
* Gets user_status
|
||||||
* @return int
|
* @return int
|
||||||
@ -358,7 +341,6 @@ class User implements ArrayAccess
|
|||||||
$this->user_status = $user_status;
|
$this->user_status = $user_status;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
@ -406,10 +388,10 @@ class User implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
if (defined('JSON_PRETTY_PRINT')) {
|
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -55,14 +55,14 @@ class ObjectSerializer
|
|||||||
public static function sanitizeForSerialization($data)
|
public static function sanitizeForSerialization($data)
|
||||||
{
|
{
|
||||||
if (is_scalar($data) || null === $data) {
|
if (is_scalar($data) || null === $data) {
|
||||||
$sanitized = $data;
|
return $data;
|
||||||
} elseif ($data instanceof \DateTime) {
|
} elseif ($data instanceof \DateTime) {
|
||||||
$sanitized = $data->format(\DateTime::ATOM);
|
return $data->format(\DateTime::ATOM);
|
||||||
} elseif (is_array($data)) {
|
} elseif (is_array($data)) {
|
||||||
foreach ($data as $property => $value) {
|
foreach ($data as $property => $value) {
|
||||||
$data[$property] = self::sanitizeForSerialization($value);
|
$data[$property] = self::sanitizeForSerialization($value);
|
||||||
}
|
}
|
||||||
$sanitized = $data;
|
return $data;
|
||||||
} elseif (is_object($data)) {
|
} elseif (is_object($data)) {
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach (array_keys($data::swaggerTypes()) as $property) {
|
foreach (array_keys($data::swaggerTypes()) as $property) {
|
||||||
@ -71,12 +71,10 @@ class ObjectSerializer
|
|||||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter());
|
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sanitized = (object)$values;
|
return (object)$values;
|
||||||
} else {
|
} else {
|
||||||
$sanitized = (string)$data;
|
return (string)$data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sanitized;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -224,7 +222,7 @@ class ObjectSerializer
|
|||||||
public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null)
|
public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null)
|
||||||
{
|
{
|
||||||
if (null === $data) {
|
if (null === $data) {
|
||||||
$deserialized = null;
|
return null;
|
||||||
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
|
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
|
||||||
$inner = substr($class, 4, -1);
|
$inner = substr($class, 4, -1);
|
||||||
$deserialized = array();
|
$deserialized = array();
|
||||||
@ -235,16 +233,17 @@ class ObjectSerializer
|
|||||||
$deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator);
|
$deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $deserialized;
|
||||||
} elseif (strcasecmp(substr($class, -2), '[]') == 0) {
|
} elseif (strcasecmp(substr($class, -2), '[]') == 0) {
|
||||||
$subClass = substr($class, 0, -2);
|
$subClass = substr($class, 0, -2);
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
$values[] = self::deserialize($value, $subClass, null, $discriminator);
|
$values[] = self::deserialize($value, $subClass, null, $discriminator);
|
||||||
}
|
}
|
||||||
$deserialized = $values;
|
return $values;
|
||||||
} elseif ($class === 'object') {
|
} elseif ($class === 'object') {
|
||||||
settype($data, 'array');
|
settype($data, 'array');
|
||||||
$deserialized = $data;
|
return $data;
|
||||||
} elseif ($class === '\DateTime') {
|
} elseif ($class === '\DateTime') {
|
||||||
// Some API's return an invalid, empty string as a
|
// Some API's return an invalid, empty string as a
|
||||||
// date-time property. DateTime::__construct() will return
|
// date-time property. DateTime::__construct() will return
|
||||||
@ -253,13 +252,13 @@ class ObjectSerializer
|
|||||||
// be interpreted as a missing field/value. Let's handle
|
// be interpreted as a missing field/value. Let's handle
|
||||||
// this graceful.
|
// this graceful.
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
$deserialized = new \DateTime($data);
|
return new \DateTime($data);
|
||||||
} else {
|
} else {
|
||||||
$deserialized = null;
|
return null;
|
||||||
}
|
}
|
||||||
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
||||||
settype($data, $class);
|
settype($data, $class);
|
||||||
$deserialized = $data;
|
return $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
// determine file name
|
// determine file name
|
||||||
if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||||
@ -270,6 +269,7 @@ class ObjectSerializer
|
|||||||
$deserialized = new \SplFileObject($filename, "w");
|
$deserialized = new \SplFileObject($filename, "w");
|
||||||
$byte_written = $deserialized->fwrite($data);
|
$byte_written = $deserialized->fwrite($data);
|
||||||
error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile());
|
error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile());
|
||||||
|
return $deserialized;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// If a discriminator is defined and points to a valid subclass, use it.
|
// If a discriminator is defined and points to a valid subclass, use it.
|
||||||
@ -292,9 +292,7 @@ class ObjectSerializer
|
|||||||
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));
|
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$deserialized = $instance;
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $deserialized;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ namespace Swagger\Client\Model;
|
|||||||
* Model200ResponseTest Class Doc Comment
|
* Model200ResponseTest Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @description
|
* @description Model for testing model name starting with number
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
@ -37,7 +37,7 @@ namespace Swagger\Client\Model;
|
|||||||
* ModelReturnTest Class Doc Comment
|
* ModelReturnTest Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @description
|
* @description Model for testing reserved words
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
@ -37,7 +37,7 @@ namespace Swagger\Client\Model;
|
|||||||
* NameTest Class Doc Comment
|
* NameTest Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @description
|
* @description Model for testing model name same as property name
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
@ -64,7 +64,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for addPet
|
* Test case for addPet
|
||||||
*
|
*
|
||||||
@ -74,7 +73,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_addPet() {
|
public function test_addPet() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for addPetUsingByteArray
|
* Test case for addPetUsingByteArray
|
||||||
*
|
*
|
||||||
@ -84,7 +82,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_addPetUsingByteArray() {
|
public function test_addPetUsingByteArray() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for deletePet
|
* Test case for deletePet
|
||||||
*
|
*
|
||||||
@ -94,7 +91,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_deletePet() {
|
public function test_deletePet() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for findPetsByStatus
|
* Test case for findPetsByStatus
|
||||||
*
|
*
|
||||||
@ -104,7 +100,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_findPetsByStatus() {
|
public function test_findPetsByStatus() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for findPetsByTags
|
* Test case for findPetsByTags
|
||||||
*
|
*
|
||||||
@ -114,7 +109,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_findPetsByTags() {
|
public function test_findPetsByTags() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for getPetById
|
* Test case for getPetById
|
||||||
*
|
*
|
||||||
@ -124,7 +118,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_getPetById() {
|
public function test_getPetById() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for getPetByIdInObject
|
* Test case for getPetByIdInObject
|
||||||
*
|
*
|
||||||
@ -134,7 +127,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_getPetByIdInObject() {
|
public function test_getPetByIdInObject() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for petPetIdtestingByteArraytrueGet
|
* Test case for petPetIdtestingByteArraytrueGet
|
||||||
*
|
*
|
||||||
@ -144,7 +136,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_petPetIdtestingByteArraytrueGet() {
|
public function test_petPetIdtestingByteArraytrueGet() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for updatePet
|
* Test case for updatePet
|
||||||
*
|
*
|
||||||
@ -154,7 +145,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_updatePet() {
|
public function test_updatePet() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for updatePetWithForm
|
* Test case for updatePetWithForm
|
||||||
*
|
*
|
||||||
@ -164,7 +154,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_updatePetWithForm() {
|
public function test_updatePetWithForm() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for uploadFile
|
* Test case for uploadFile
|
||||||
*
|
*
|
||||||
@ -174,5 +163,4 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_uploadFile() {
|
public function test_uploadFile() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for deleteOrder
|
* Test case for deleteOrder
|
||||||
*
|
*
|
||||||
@ -74,7 +73,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_deleteOrder() {
|
public function test_deleteOrder() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for findOrdersByStatus
|
* Test case for findOrdersByStatus
|
||||||
*
|
*
|
||||||
@ -84,7 +82,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_findOrdersByStatus() {
|
public function test_findOrdersByStatus() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for getInventory
|
* Test case for getInventory
|
||||||
*
|
*
|
||||||
@ -94,7 +91,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_getInventory() {
|
public function test_getInventory() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for getInventoryInObject
|
* Test case for getInventoryInObject
|
||||||
*
|
*
|
||||||
@ -104,7 +100,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_getInventoryInObject() {
|
public function test_getInventoryInObject() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for getOrderById
|
* Test case for getOrderById
|
||||||
*
|
*
|
||||||
@ -114,7 +109,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_getOrderById() {
|
public function test_getOrderById() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for placeOrder
|
* Test case for placeOrder
|
||||||
*
|
*
|
||||||
@ -124,5 +118,4 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_placeOrder() {
|
public function test_placeOrder() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for createUser
|
* Test case for createUser
|
||||||
*
|
*
|
||||||
@ -74,7 +73,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_createUser() {
|
public function test_createUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for createUsersWithArrayInput
|
* Test case for createUsersWithArrayInput
|
||||||
*
|
*
|
||||||
@ -84,7 +82,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_createUsersWithArrayInput() {
|
public function test_createUsersWithArrayInput() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for createUsersWithListInput
|
* Test case for createUsersWithListInput
|
||||||
*
|
*
|
||||||
@ -94,7 +91,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_createUsersWithListInput() {
|
public function test_createUsersWithListInput() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for deleteUser
|
* Test case for deleteUser
|
||||||
*
|
*
|
||||||
@ -104,7 +100,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_deleteUser() {
|
public function test_deleteUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for getUserByName
|
* Test case for getUserByName
|
||||||
*
|
*
|
||||||
@ -114,7 +109,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_getUserByName() {
|
public function test_getUserByName() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for loginUser
|
* Test case for loginUser
|
||||||
*
|
*
|
||||||
@ -124,7 +118,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_loginUser() {
|
public function test_loginUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for logoutUser
|
* Test case for logoutUser
|
||||||
*
|
*
|
||||||
@ -134,7 +127,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_logoutUser() {
|
public function test_logoutUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for updateUser
|
* Test case for updateUser
|
||||||
*
|
*
|
||||||
@ -144,5 +136,4 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function test_updateUser() {
|
public function test_updateUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,28 +1,49 @@
|
|||||||
|
# swagger_client
|
||||||
|
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||||
|
|
||||||
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API verion: 1.0.0
|
||||||
|
- Package version:
|
||||||
|
- Build date: 2016-03-30T17:18:44.943+08:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
|
||||||
|
|
||||||
## Requirements.
|
## Requirements.
|
||||||
Python 2.7 and later.
|
|
||||||
|
|
||||||
## Setuptools
|
Python 2.7 and 3.4+
|
||||||
You can install the bindings via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
||||||
|
## Installation & Usage
|
||||||
|
### pip install
|
||||||
|
|
||||||
|
If the python package is hosted on Github, you can install directly from Github
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python setup.py install
|
pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git
|
||||||
```
|
```
|
||||||
|
(you may need to run the command with root permission: `sudo pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git`)
|
||||||
|
|
||||||
Or you can install from Github via pip:
|
Import the pacakge:
|
||||||
|
|
||||||
```sh
|
|
||||||
pip install git+https://github.com/geekerzp/swagger_client.git
|
|
||||||
```
|
|
||||||
|
|
||||||
To use the bindings, import the pacakge:
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import swagger_client
|
import swagger_client
|
||||||
```
|
```
|
||||||
|
|
||||||
## Manual Installation
|
### Setuptools
|
||||||
If you do not wish to use setuptools, you can download the latest release.
|
|
||||||
Then, to use the bindings, import the package:
|
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python setup.py install --user
|
||||||
|
```
|
||||||
|
(or `sudo python setup.py install` to install the package for all users)
|
||||||
|
|
||||||
|
Import the pacakge:
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Installation
|
||||||
|
|
||||||
|
Download the latest release to the project folder (e.g. ./path/to/swagger_client) and import the package:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import path.to.swagger_client
|
import path.to.swagger_client
|
||||||
@ -30,44 +51,126 @@ import path.to.swagger_client
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
TODO
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
## Documentation
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
TODO
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi
|
||||||
|
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
## Tests
|
try:
|
||||||
|
# Add a new pet to the store
|
||||||
(Please make sure you have [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/) installed)
|
api_instance.add_pet(body=body);
|
||||||
|
except ApiException as e:
|
||||||
Execute the following command to run the tests in the current Python (v2 or v3) environment:
|
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||||
|
|
||||||
```sh
|
|
||||||
$ make test
|
|
||||||
[... magically installs dependencies and runs tests on your virtualenv]
|
|
||||||
Ran 7 tests in 19.289s
|
|
||||||
|
|
||||||
OK
|
|
||||||
```
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
```
|
||||||
$ mvn integration-test -rf :PythonPetstoreClientTests
|
|
||||||
Using 2195432783 as seed
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] BUILD SUCCESS
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
[INFO] Total time: 37.594 s
|
|
||||||
[INFO] Finished at: 2015-05-16T18:00:35+08:00
|
|
||||||
[INFO] Final Memory: 11M/156M
|
|
||||||
[INFO] ------------------------------------------------------------------------
|
|
||||||
```
|
|
||||||
If you want to run the tests in all the python platforms:
|
|
||||||
|
|
||||||
```sh
|
## Documentation for API Endpoints
|
||||||
$ make test-all
|
|
||||||
[... tox creates a virtualenv for every platform and runs tests inside of each]
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
py27: commands succeeded
|
|
||||||
py34: commands succeeded
|
Class | Method | HTTP request | Description
|
||||||
congratulations :)
|
------------ | ------------- | ------------- | -------------
|
||||||
```
|
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||||
|
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||||
|
*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [Animal](docs/Animal.md)
|
||||||
|
- [Cat](docs/Cat.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [Dog](docs/Dog.md)
|
||||||
|
- [InlineResponse200](docs/InlineResponse200.md)
|
||||||
|
- [Model200Response](docs/Model200Response.md)
|
||||||
|
- [ModelReturn](docs/ModelReturn.md)
|
||||||
|
- [Name](docs/Name.md)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
## test_api_key_header
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: test_api_key_header
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_http_basic
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
## test_api_client_secret
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_secret
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_api_client_id
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_id
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_api_key_query
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: test_api_key_query
|
||||||
|
- **Location**: URL query string
|
||||||
|
|
||||||
|
## petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
apiteam@swagger.io
|
||||||
|
|
||||||
|
10
samples/client/petstore/python/docs/Animal.md
Normal file
10
samples/client/petstore/python/docs/Animal.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**class_name** | **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)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/python/docs/Cat.md
Normal file
11
samples/client/petstore/python/docs/Cat.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**class_name** | **str** | |
|
||||||
|
**declawed** | **bool** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/python/docs/Category.md
Normal file
11
samples/client/petstore/python/docs/Category.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**name** | **str** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/python/docs/Dog.md
Normal file
11
samples/client/petstore/python/docs/Dog.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**class_name** | **str** | |
|
||||||
|
**breed** | **str** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/python/docs/InlineResponse200.md
Normal file
15
samples/client/petstore/python/docs/InlineResponse200.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# InlineResponse200
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**list[Tag]**](Tag.md) | | [optional]
|
||||||
|
**id** | **int** | |
|
||||||
|
**category** | **object** | | [optional]
|
||||||
|
**status** | **str** | pet status in the store | [optional]
|
||||||
|
**name** | **str** | | [optional]
|
||||||
|
**photo_urls** | **list[str]** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python/docs/Model200Response.md
Normal file
10
samples/client/petstore/python/docs/Model200Response.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Model200Response
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **int** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python/docs/ModelReturn.md
Normal file
10
samples/client/petstore/python/docs/ModelReturn.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# ModelReturn
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_return** | **int** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/python/docs/Name.md
Normal file
11
samples/client/petstore/python/docs/Name.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Name
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **int** | | [optional]
|
||||||
|
**snake_case** | **int** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/python/docs/Order.md
Normal file
15
samples/client/petstore/python/docs/Order.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Order
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**pet_id** | **int** | | [optional]
|
||||||
|
**quantity** | **int** | | [optional]
|
||||||
|
**ship_date** | **datetime** | | [optional]
|
||||||
|
**status** | **str** | Order Status | [optional]
|
||||||
|
**complete** | **bool** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/python/docs/Pet.md
Normal file
15
samples/client/petstore/python/docs/Pet.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**category** | [**Category**](Category.md) | | [optional]
|
||||||
|
**name** | **str** | |
|
||||||
|
**photo_urls** | **list[str]** | |
|
||||||
|
**tags** | [**list[Tag]**](Tag.md) | | [optional]
|
||||||
|
**status** | **str** | pet status in the store | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
596
samples/client/petstore/python/docs/PetApi.md
Normal file
596
samples/client/petstore/python/docs/PetApi.md
Normal file
@ -0,0 +1,596 @@
|
|||||||
|
# swagger_client\PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
|
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
# **add_pet**
|
||||||
|
> add_pet(body=body)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Add a new pet to the store
|
||||||
|
api_instance.add_pet(body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **add_pet_using_byte_array**
|
||||||
|
> add_pet_using_byte_array(body=body)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
body = 'B' # str | Pet object in the form of byte array (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
api_instance.add_pet_using_byte_array(body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->add_pet_using_byte_array: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **str**| Pet object in the form of byte array | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **delete_pet**
|
||||||
|
> delete_pet(pet_id, api_key=api_key)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | Pet id to delete
|
||||||
|
api_key = 'api_key_example' # str | (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Deletes a pet
|
||||||
|
api_instance.delete_pet(pet_id, api_key=api_key);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->delete_pet: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| Pet id to delete |
|
||||||
|
**api_key** | **str**| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **find_pets_by_status**
|
||||||
|
> list[Pet] find_pets_by_status(status=status)
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
Multiple status values can be provided with comma separated strings
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
status = ['available'] # list[str] | Status values that need to be considered for query (optional) (default to available)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Finds Pets by status
|
||||||
|
api_response = api_instance.find_pets_by_status(status=status);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->find_pets_by_status: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | [**list[str]**](str.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**list[Pet]**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **find_pets_by_tags**
|
||||||
|
> list[Pet] find_pets_by_tags(tags=tags)
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
tags = ['tags_example'] # list[str] | Tags to filter by (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Finds Pets by tags
|
||||||
|
api_response = api_instance.find_pets_by_tags(tags=tags);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->find_pets_by_tags: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**list[str]**](str.md)| Tags to filter by | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**list[Pet]**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_pet_by_id**
|
||||||
|
> Pet get_pet_by_id(pet_id)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Find pet by ID
|
||||||
|
api_response = api_instance.get_pet_by_id(pet_id);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->get_pet_by_id: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_pet_by_id_in_object**
|
||||||
|
> InlineResponse200 get_pet_by_id_in_object(pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
api_response = api_instance.get_pet_by_id_in_object(pet_id);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->get_pet_by_id_in_object: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**InlineResponse200**](InlineResponse200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **pet_pet_idtesting_byte_arraytrue_get**
|
||||||
|
> str pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
api_response = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**str**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **update_pet**
|
||||||
|
> update_pet(body=body)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Update an existing pet
|
||||||
|
api_instance.update_pet(body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->update_pet: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **update_pet_with_form**
|
||||||
|
> update_pet_with_form(pet_id, name=name, status=status)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 'pet_id_example' # str | ID of pet that needs to be updated
|
||||||
|
name = 'name_example' # str | Updated name of the pet (optional)
|
||||||
|
status = 'status_example' # str | Updated status of the pet (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Updates a pet in the store with form data
|
||||||
|
api_instance.update_pet_with_form(pet_id, name=name, status=status);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->update_pet_with_form: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **str**| ID of pet that needs to be updated |
|
||||||
|
**name** | **str**| Updated name of the pet | [optional]
|
||||||
|
**status** | **str**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **upload_file**
|
||||||
|
> upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | ID of pet to update
|
||||||
|
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
|
||||||
|
file = '/path/to/file.txt' # file | file to upload (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# uploads an image
|
||||||
|
api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->upload_file: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet to update |
|
||||||
|
**additional_metadata** | **str**| Additional data to pass to server | [optional]
|
||||||
|
**file** | **file**| file to upload | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
10
samples/client/petstore/python/docs/SpecialModelName.md
Normal file
10
samples/client/petstore/python/docs/SpecialModelName.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# SpecialModelName
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**special_property_name** | **int** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
330
samples/client/petstore/python/docs/StoreApi.md
Normal file
330
samples/client/petstore/python/docs/StoreApi.md
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
# swagger_client\StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||||
|
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
# **delete_order**
|
||||||
|
> delete_order(order_id)
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
order_id = 'order_id_example' # str | ID of the order that needs to be deleted
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Delete purchase order by ID
|
||||||
|
api_instance.delete_order(order_id);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->delete_order: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**order_id** | **str**| ID of the order that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **find_orders_by_status**
|
||||||
|
> list[Order] find_orders_by_status(status=status)
|
||||||
|
|
||||||
|
Finds orders by status
|
||||||
|
|
||||||
|
A single status value can be provided as a string
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
status = 'placed' # str | Status value that needs to be considered for query (optional) (default to placed)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Finds orders by status
|
||||||
|
api_response = api_instance.find_orders_by_status(status=status);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->find_orders_by_status: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | **str**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**list[Order]**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_inventory**
|
||||||
|
> dict(str, int) get_inventory()
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Returns pet inventories by status
|
||||||
|
api_response = api_instance.get_inventory();
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->get_inventory: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**dict(str, int)**](dict.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_inventory_in_object**
|
||||||
|
> object get_inventory_in_object()
|
||||||
|
|
||||||
|
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
api_response = api_instance.get_inventory_in_object();
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->get_inventory_in_object: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**object**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_order_by_id**
|
||||||
|
> Order get_order_by_id(order_id)
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_key_header
|
||||||
|
swagger_client.configuration.api_key['test_api_key_header'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['test_api_key_header'] = 'BEARER'
|
||||||
|
# Configure API key authorization: test_api_key_query
|
||||||
|
swagger_client.configuration.api_key['test_api_key_query'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['test_api_key_query'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
order_id = 'order_id_example' # str | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Find purchase order by ID
|
||||||
|
api_response = api_instance.get_order_by_id(order_id);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->get_order_by_id: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**order_id** | **str**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **place_order**
|
||||||
|
> Order place_order(body=body)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY';
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
body = swagger_client.Order() # Order | order placed for purchasing the pet (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Place an order for a pet
|
||||||
|
api_response = api_instance.place_order(body=body);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->place_order: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
11
samples/client/petstore/python/docs/Tag.md
Normal file
11
samples/client/petstore/python/docs/Tag.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Tag
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**name** | **str** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
17
samples/client/petstore/python/docs/User.md
Normal file
17
samples/client/petstore/python/docs/User.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# User
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**username** | **str** | | [optional]
|
||||||
|
**first_name** | **str** | | [optional]
|
||||||
|
**last_name** | **str** | | [optional]
|
||||||
|
**email** | **str** | | [optional]
|
||||||
|
**password** | **str** | | [optional]
|
||||||
|
**phone** | **str** | | [optional]
|
||||||
|
**user_status** | **int** | User Status | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
398
samples/client/petstore/python/docs/UserApi.md
Normal file
398
samples/client/petstore/python/docs/UserApi.md
Normal file
@ -0,0 +1,398 @@
|
|||||||
|
# swagger_client\UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**create_user**](UserApi.md#create_user) | **POST** /user | Create user
|
||||||
|
[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
|
||||||
|
[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
|
||||||
|
[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system
|
||||||
|
[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
# **create_user**
|
||||||
|
> create_user(body=body)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
body = swagger_client.User() # User | Created user object (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Create user
|
||||||
|
api_instance.create_user(body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->create_user: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**User**](User.md)| Created user object | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **create_users_with_array_input**
|
||||||
|
> create_users_with_array_input(body=body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
body = [swagger_client.User()] # list[User] | List of user object (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Creates list of users with given input array
|
||||||
|
api_instance.create_users_with_array_input(body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->create_users_with_array_input: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**list[User]**](User.md)| List of user object | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **create_users_with_list_input**
|
||||||
|
> create_users_with_list_input(body=body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
body = [swagger_client.User()] # list[User] | List of user object (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Creates list of users with given input array
|
||||||
|
api_instance.create_users_with_list_input(body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->create_users_with_list_input: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**list[User]**](User.md)| List of user object | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **delete_user**
|
||||||
|
> delete_user(username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# Configure HTTP basic authorization: test_http_basic
|
||||||
|
swagger_client.configuration.username = 'YOUR_USERNAME'
|
||||||
|
swagger_client.configuration.password = 'YOUR_PASSWORD'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
username = 'username_example' # str | The name that needs to be deleted
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Delete user
|
||||||
|
api_instance.delete_user(username);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->delete_user: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **str**| The name that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_http_basic](../README.md#test_http_basic)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_user_by_name**
|
||||||
|
> User get_user_by_name(username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Get user by user name
|
||||||
|
api_response = api_instance.get_user_by_name(username);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->get_user_by_name: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **str**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **login_user**
|
||||||
|
> str login_user(username=username, password=password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
username = 'username_example' # str | The user name for login (optional)
|
||||||
|
password = 'password_example' # str | The password for login in clear text (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Logs user into the system
|
||||||
|
api_response = api_instance.login_user(username=username, password=password);
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->login_user: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **str**| The user name for login | [optional]
|
||||||
|
**password** | **str**| The password for login in clear text | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**str**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **logout_user**
|
||||||
|
> logout_user()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Logs out current logged in user session
|
||||||
|
api_instance.logout_user();
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->logout_user: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **update_user**
|
||||||
|
> update_user(username, body=body)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.UserApi()
|
||||||
|
username = 'username_example' # str | name that need to be deleted
|
||||||
|
body = swagger_client.User() # User | Updated user object (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Updated user
|
||||||
|
api_instance.update_user(username, body=body);
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling UserApi->update_user: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **str**| name that need to be deleted |
|
||||||
|
**body** | [**User**](User.md)| Updated user object | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
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